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

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: Change switches::kContentImageTextureTarget to a list of image texture targets Created 5 years, 5 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
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index edc4622ff25ad13f3afe906e98fd5a1bf78783a4..76b13935fe747af4a257945ebc9d5349b00cf582 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -137,21 +137,17 @@ 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::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888;
-
// Use PERSISTENT_MAP memory buffers to support partial tile raster for
// software raster into GpuMemoryBuffers.
gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::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 < gfx::GpuMemoryBuffer::FORMAT_LAST + 1;
+ format++) {
+ settings.use_image_texture_targets[format] =
reveman 2015/07/27 17:07:15 nit: DCHECK_GT(settings.use_image_texture_targets.
+ context_factory_->GetImageTextureTarget(
+ static_cast<gfx::GpuMemoryBuffer::Format>(format), usage);
+ }
// Note: gathering of pixel refs is only needed when using multiple
// raster threads.
« content/renderer/render_thread_impl.cc ('K') | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698