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

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: feedback 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 cbd42b63040ff89588a5a9436c2f661e4a8ad45e..cce3c3315f58ea629e93777436402fa6dc61e62a 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 (size_t usage_idx = 0;
danakj 2016/07/19 20:37:56 why size_t and not int?
ericrk 2016/07/19 21:47:46 No reason - previous code used size_t, but I can't
+ usage_idx < static_cast<size_t>(gfx::BufferUsage::LAST) + 1;
danakj 2016/07/19 20:37:56 nit: use <= instead of +1
ericrk 2016/07/19 21:47:46 Done.
+ ++usage_idx) {
+ gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx);
+ for (size_t format_idx = 0;
danakj 2016/07/19 20:37:56 why size_t and not int?
ericrk 2016/07/19 21:47:46 Done.
+ format_idx < static_cast<size_t>(gfx::BufferFormat::LAST) + 1;
danakj 2016/07/19 20:37:56 nit: <= instead of +1
ericrk 2016/07/19 21:47:46 Done.
+ ++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.emplace(
+ 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