Commit 63642262 authored by Nicolás Peña Moreno's avatar Nicolás Peña Moreno Committed by Commit Bot

Revert "ozone/drm: Render primary framebuffers as RGBA"

This reverts commit 48d1ecaf.

Reason for revert: This CL causes several problems documented at crbug.com/821944

Original change's description:
> ozone/drm: Render primary framebuffers as RGBA
> 
> In preparation for hardware plane underlay support in ChromeOS, we
> need to allow for RGBA primary framebuffers. When using an underlay,
> we cut out a transparent rectangle in the primary framebuffer to allow
> the underlay to show through, while still allowing for RGBA content on
> top of the underlay (for example, video controls or annotations).
> When not using an underlay, the primary framebuffer will be displayed
> as RGBX (opaque) to avoid unnecessary blending in the display
> controller.
> 
> Bug: 789288
> Change-Id: I2fc94e524e250ec9b7e11cd6801e1c8308046a10
> Reviewed-on: https://chromium-review.googlesource.com/801974
> Reviewed-by: Alex Sakhartchouk <alexst@chromium.org>
> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
> Reviewed-by: David Reveman <reveman@chromium.org>
> Reviewed-by: danakj <danakj@chromium.org>
> Reviewed-by: Antoine Labour <piman@chromium.org>
> Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#542877}

TBR=marcheu@chromium.org,reveman@chromium.org,sky@chromium.org,danakj@chromium.org,alexst@chromium.org,dcastagna@chromium.org,piman@chromium.org,hoegsberg@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 789288
Change-Id: I3005e3cb37a1385c5a1cd72bad76d1ffbad1cc63
Reviewed-on: https://chromium-review.googlesource.com/965721Reviewed-by: default avatarNicolás Peña Moreno <npm@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543627}
parent 977ed840
......@@ -94,9 +94,6 @@ const gpu::SurfaceHandle kFakeSurfaceHandle =
const gpu::SurfaceHandle kFakeSurfaceHandle = 1;
#endif
const unsigned int kBufferQueueInternalformat = GL_RGBA;
const gfx::BufferFormat kBufferQueueFormat = gfx::BufferFormat::RGBA_8888;
class MockBufferQueue : public BufferQueue {
public:
MockBufferQueue(gpu::gles2::GLES2Interface* gl,
......@@ -105,8 +102,8 @@ class MockBufferQueue : public BufferQueue {
unsigned int internalformat)
: BufferQueue(gl,
target,
kBufferQueueInternalformat,
kBufferQueueFormat,
internalformat,
display::DisplaySnapshot::PrimaryFormat(),
nullptr,
gpu_memory_buffer_manager,
kFakeSurfaceHandle) {}
......@@ -126,8 +123,7 @@ class BufferQueueTest : public ::testing::Test {
gpu_memory_buffer_manager_.reset(new StubGpuMemoryBufferManager);
mock_output_surface_ = new MockBufferQueue(context_provider_->ContextGL(),
gpu_memory_buffer_manager_.get(),
GL_TEXTURE_2D,
kBufferQueueInternalformat);
GL_TEXTURE_2D, GL_RGB);
output_surface_.reset(mock_output_surface_);
output_surface_->Initialize();
}
......@@ -267,7 +263,7 @@ std::unique_ptr<BufferQueue> CreateBufferQueue(
gpu::gles2::GLES2Interface* gl,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
std::unique_ptr<BufferQueue> buffer_queue(new BufferQueue(
gl, target, kBufferQueueInternalformat, kBufferQueueFormat, nullptr,
gl, target, GL_RGB, display::DisplaySnapshot::PrimaryFormat(), nullptr,
gpu_memory_buffer_manager, kFakeSurfaceHandle));
buffer_queue->Initialize();
return buffer_queue;
......@@ -306,8 +302,7 @@ TEST(BufferQueueStandaloneTest, FboBinding) {
EXPECT_CALL(*context, bindTexture(target, Ne(0U)));
EXPECT_CALL(*context, destroyImageCHROMIUM(1));
Expectation image =
EXPECT_CALL(*context,
createImageCHROMIUM(_, 0, 0, kBufferQueueInternalformat))
EXPECT_CALL(*context, createImageCHROMIUM(_, 0, 0, GL_RGB))
.WillOnce(Return(1));
Expectation fb =
EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U)));
......@@ -337,9 +332,8 @@ TEST(BufferQueueStandaloneTest, CheckBoundFramebuffer) {
context_provider->ContextSupport()));
output_surface.reset(new BufferQueue(
context_provider->ContextGL(), GL_TEXTURE_2D,
kBufferQueueInternalformat, kBufferQueueFormat,
gl_helper.get(),
context_provider->ContextGL(), GL_TEXTURE_2D, GL_RGB,
display::DisplaySnapshot::PrimaryFormat(), gl_helper.get(),
gpu_memory_buffer_manager.get(), kFakeSurfaceHandle));
output_surface->Initialize();
output_surface->Reshape(screen_size, 1.0f, gfx::ColorSpace(), false);
......@@ -628,8 +622,7 @@ TEST_F(BufferQueueMockedContextTest, RecreateBuffers) {
// Expect all 4 images to be destroyed, 3 of the existing textures to be
// copied from and 3 new images to be created.
EXPECT_CALL(*context_, createImageCHROMIUM(_, screen_size.width(),
screen_size.height(),
kBufferQueueInternalformat))
screen_size.height(), GL_RGB))
.Times(3);
Expectation copy1 = EXPECT_CALL(*mock_output_surface_,
CopyBufferDamage(_, displayed->texture, _, _))
......
......@@ -516,12 +516,11 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
disable_overlay_ca_layers),
GetGpuMemoryBufferManager());
#else
DCHECK(capabilities.texture_format_bgra8888);
auto gpu_output_surface =
std::make_unique<GpuSurfacelessBrowserCompositorOutputSurface>(
context_provider, data->surface_handle, vsync_callback,
CreateOverlayCandidateValidator(compositor->widget()),
GL_TEXTURE_2D, GL_BGRA_EXT,
GL_TEXTURE_2D, GL_RGB,
display::DisplaySnapshot::PrimaryFormat(),
GetGpuMemoryBufferManager());
gpu_vsync_control = gpu_output_surface.get();
......
......@@ -143,7 +143,7 @@ std::string DisplaySnapshot::ToString() const {
// static
gfx::BufferFormat DisplaySnapshot::PrimaryFormat() {
return gfx::BufferFormat::BGRA_8888;
return gfx::BufferFormat::BGRX_8888;
}
} // namespace display
......@@ -63,9 +63,7 @@ class ClientNativePixmapFactoryDmabuf : public ClientNativePixmapFactory {
format == gfx::BufferFormat::YVU_420;
case gfx::BufferUsage::SCANOUT:
return format == gfx::BufferFormat::BGRX_8888 ||
format == gfx::BufferFormat::RGBX_8888 ||
format == gfx::BufferFormat::RGBA_8888 ||
format == gfx::BufferFormat::BGRA_8888;
format == gfx::BufferFormat::RGBX_8888;
case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
return
#if defined(ARCH_CPU_X86_FAMILY)
......
......@@ -114,7 +114,7 @@ bool SurfacelessSkiaRenderer::BufferWrapper::Initialize(
->GetSurfaceFactoryOzone()
->CreateNativePixmap(widget, size, format, gfx::BufferUsage::SCANOUT);
scoped_refptr<gl::GLImageNativePixmap> image(
new gl::GLImageNativePixmap(size, GL_BGRA_EXT));
new gl::GLImageNativePixmap(size, GL_RGB));
if (!image->Initialize(pixmap.get(), format)) {
LOG(ERROR) << "Failed to create GLImage";
return false;
......
......@@ -136,7 +136,7 @@ bool GbmSurface::CreatePixmaps() {
if (!pixmap)
return false;
scoped_refptr<gl::GLImageNativePixmap> image =
new gl::GLImageNativePixmap(GetSize(), GL_BGRA_EXT);
new gl::GLImageNativePixmap(GetSize(), GL_RGB);
if (!image->Initialize(pixmap.get(),
display::DisplaySnapshot::PrimaryFormat()))
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment