Index: components/display_compositor/buffer_queue.cc |
diff --git a/components/display_compositor/buffer_queue.cc b/components/display_compositor/buffer_queue.cc |
index bcdb62c3d21157019b5df48f4ea8c1ded7670a95..49b9cdb97264e1873e3e9d0d1d3e756e75bdbcab 100644 |
--- a/components/display_compositor/buffer_queue.cc |
+++ b/components/display_compositor/buffer_queue.cc |
@@ -14,6 +14,7 @@ |
#include "gpu/command_buffer/common/gpu_memory_buffer_support.h" |
#include "third_party/skia/include/core/SkRect.h" |
#include "third_party/skia/include/core/SkRegion.h" |
+#include "ui/display/types/display_mode.h" |
#include "ui/gfx/gpu_memory_buffer.h" |
#include "ui/gfx/skia_util.h" |
@@ -212,10 +213,11 @@ std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() { |
// We don't want to allow anything more than triple buffering. |
DCHECK_LT(allocated_count_, 4U); |
+ gfx::BufferFormat format = ui::DisplayMode::PrimaryFormat(); |
+ DCHECK_EQ(static_cast<uint32_t>(GL_RGBA), internal_format_); |
std::unique_ptr<gfx::GpuMemoryBuffer> buffer( |
gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer( |
- size_, gpu::DefaultBufferFormatForImageFormat(internal_format_), |
- gfx::BufferUsage::SCANOUT, surface_handle_)); |
+ size_, format, gfx::BufferUsage::SCANOUT, surface_handle_)); |
if (!buffer.get()) { |
gl_->DeleteTextures(1, &texture); |
DLOG(ERROR) << "Failed to allocate GPU memory buffer"; |