Index: ui/compositor/compositor.cc |
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc |
index f80b75fe298d605fc960165d0c257b4659733907..68b390af4d4cde27c325dadaf071e64e8508b0fe 100644 |
--- a/ui/compositor/compositor.cc |
+++ b/ui/compositor/compositor.cc |
@@ -129,9 +129,28 @@ Compositor::Compositor(gfx::AcceleratedWidget widget, |
settings.impl_side_painting = IsUIImplSidePaintingEnabled(); |
settings.use_display_lists = IsUISlimmingPaintEnabled(); |
settings.use_cached_picture_in_display_list = false; |
+ |
settings.use_zero_copy = IsUIZeroCopyEnabled(); |
settings.use_one_copy = IsUIOneCopyEnabled(); |
- settings.use_image_texture_target = context_factory_->GetImageTextureTarget(); |
+ |
+ // 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; |
+ gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::MAP; |
+ |
+ // Use PERSISTENT_MAP memory buffers to support partial tile updates in the |
+ // one-copy implementation. |
+ if (IsUIOneCopyEnabled()) { |
reveman
2015/05/22 17:15:13
What if IsUIZeroCopyEnabled() is also enabled? Wit
danakj
2015/05/26 19:02:52
If zero copy is enabled, then one copy is disabled
reveman
2015/05/26 20:12:37
Ah, didn't realize that we have checks inside thes
danakj
2015/05/26 20:17:37
But there's no point turning it on for zero copy i
danakj
2015/05/26 23:37:34
Done.
|
+ usage = gfx::GpuMemoryBuffer::PERSISTENT_MAP; |
+ settings.have_persistent_gpu_memory_buffers = true; |
+ } |
+ settings.use_image_texture_target = |
+ context_factory_->GetImageTextureTarget(format, usage); |
+ |
// Note: gathering of pixel refs is only needed when using multiple |
// raster threads. |
settings.gather_pixel_refs = false; |