Commit cc0ee6e2 authored by Stéphane Marchesin's avatar Stéphane Marchesin Committed by Commit Bot

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

This reverts commit 11b329d7.

This breaks samus

TBR=avi@chromium.org,marcheu@chromium.org,reveman@chromium.org,sky@chromium.org,danakj@chromium.org,alexst@chromium.org,dcastagna@chromium.org,piman@chromium.org,hoegsberg@chromium.org
BUG=chromium:827188
TEST=revert fixes it

Change-Id: Ieca93d4bc1d8827edc07749971f23e52291051ae
Reviewed-on: https://chromium-review.googlesource.com/989076
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: default avatarStéphane Marchesin <marcheu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547374}
parent 50f4dddc
......@@ -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, _, _))
......
......@@ -519,13 +519,12 @@ 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,
std::move(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