Index: ui/compositor/compositor.cc |
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc |
index cbd42b63040ff89588a5a9436c2f661e4a8ad45e..5a2d926d2f7fc83d7125d18e35c3907a457233b1 100644 |
--- a/ui/compositor/compositor.cc |
+++ b/ui/compositor/compositor.cc |
@@ -37,7 +37,6 @@ |
#include "ui/compositor/dip_util.h" |
#include "ui/compositor/layer.h" |
#include "ui/compositor/layer_animator_collection.h" |
-#include "ui/gl/gl_context.h" |
#include "ui/gl/gl_switches.h" |
namespace { |
@@ -159,19 +158,19 @@ Compositor::Compositor(ui::ContextFactory* context_factory, |
// doesn't currently support partial raster. |
settings.use_partial_raster = !settings.use_zero_copy; |
- // Use CPU_READ_WRITE_PERSISTENT memory buffers to support partial tile |
- // raster if needed. |
- gfx::BufferUsage usage = |
- settings.use_partial_raster |
- ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT |
- : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; |
- |
- 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); |
+ // Populate use_image_texture_targets for all buffer usage/formats. |
+ for (size_t usage_idx = 0; |
+ usage_idx <= static_cast<size_t>(gfx::BufferUsage::LAST) + 1; |
+ ++usage_idx) { |
+ gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); |
+ for (size_t format_idx = 0; |
+ format_idx < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; |
+ ++format_idx) { |
+ gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); |
+ uint32_t target = context_factory_->GetImageTextureTarget(format, usage); |
+ settings.renderer_settings.use_image_texture_targets.emplace( |
+ cc::RendererSettings::ImageTextureTargetKey(usage, format), target); |
+ } |
} |
// Note: Only enable image decode tasks if we have more than one worker |