Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: ui/compositor/compositor.cc

Issue 1251693003: cc: Fix the format of GpuMemoryBuffer for SurfaceTexture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/fake_compositor_dependencies.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 015a6ea51e36b8caf725ed48a130cbf1b018ce58..b5474a7c5f50482c258a427015547f64fd5b70ec 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -137,21 +137,18 @@ Compositor::Compositor(gfx::AcceleratedWidget widget,
settings.use_zero_copy = IsUIZeroCopyEnabled();
settings.use_one_copy = IsUIOneCopyEnabled();
- // TODO(reveman): We currently assume that the compositor will use BGRA_8888
- // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will
- // use we hardcode BGRA_8888 here for now. We should instead
- // move decisions about GpuMemoryBuffer format to the browser embedder so we
- // know it here, and pass that decision to the compositor for each usage.
- // crbug.com/490362
- gfx::BufferFormat format = gfx::BufferFormat::BGRA_8888;
-
// Use PERSISTENT_MAP memory buffers to support partial tile raster for
// software raster into GpuMemoryBuffers.
gfx::BufferUsage usage = gfx::BufferUsage::PERSISTENT_MAP;
settings.use_persistent_map_for_gpu_memory_buffers = true;
- settings.use_image_texture_target =
- context_factory_->GetImageTextureTarget(format, usage);
+ for (size_t format = 0;
+ format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) {
+ DCHECK_GT(settings.use_image_texture_targets.size(), format);
+ settings.use_image_texture_targets[format] =
+ context_factory_->GetImageTextureTarget(
+ static_cast<gfx::BufferFormat>(format), usage);
+ }
// Note: gathering of pixel refs is only needed when using multiple
// raster threads.
« no previous file with comments | « content/test/fake_compositor_dependencies.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698