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

Unified Diff: ui/compositor/compositor.cc

Issue 2120713002: Fix use_image_texture_target inconsistencies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix content browsertests Created 4 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
« 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 b217cddc5028a4f0e3813a2e6ff461599f9eee22..a1b001f3390791e7ee3dc3e9c7426b777513c8a9 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 buffer_to_texture_target_map for all buffer usage/formats.
+ for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST);
+ ++usage_idx) {
+ gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx);
+ for (int format_idx = 0;
+ format_idx <= static_cast<int>(gfx::BufferFormat::LAST);
+ ++format_idx) {
+ gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx);
+ uint32_t target = context_factory_->GetImageTextureTarget(format, usage);
+ settings.renderer_settings.buffer_to_texture_target_map.insert(
+ cc::BufferToTextureTargetMap::value_type(
+ cc::BufferToTextureTargetKey(usage, format), target));
+ }
}
// Note: Only enable image decode tasks if we have more than one worker
« 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