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

Unified Diff: ui/compositor/compositor_util.cc

Issue 2895273002: Unified the use of BufferToTextureTargetMap for all the Processes (Closed)
Patch Set: Unified BufferToTextureTargetMap for all the Processes Created 3 years, 6 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
« ui/compositor/compositor_util.h ('K') | « ui/compositor/compositor_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor_util.cc
diff --git a/ui/compositor/compositor_util.cc b/ui/compositor/compositor_util.cc
index 63bc27330faaae78f9c9c0d74d25f05d6f0ce585..6bce1dcee8d01f415a337546eba3d9f0fe1a3649 100644
--- a/ui/compositor/compositor_util.cc
+++ b/ui/compositor/compositor_util.cc
@@ -13,8 +13,8 @@
namespace ui {
-cc::RendererSettings CreateRendererSettings(uint32_t (
- *get_texture_target)(gfx::BufferFormat format, gfx::BufferUsage usage)) {
+cc::RendererSettings CreateRendererSettings(
+ cc::BufferToTextureTargetMap image_targets) {
cc::RendererSettings renderer_settings;
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
renderer_settings.partial_swap_enabled =
@@ -31,19 +31,9 @@ cc::RendererSettings CreateRendererSettings(uint32_t (
renderer_settings.enable_color_correct_rendering =
command_line->HasSwitch(switches::kEnableColorCorrectRendering) ||
command_line->HasSwitch(switches::kEnableHDR);
- // 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);
- renderer_settings.resource_settings
- .buffer_to_texture_target_map[std::make_pair(usage, format)] =
- get_texture_target(format, usage);
- }
- }
+ renderer_settings.resource_settings.buffer_to_texture_target_map =
+ image_targets;
+
renderer_settings.disallow_non_exact_resource_reuse =
command_line->HasSwitch(cc::switches::kDisallowNonExactResourceReuse);
« ui/compositor/compositor_util.h ('K') | « ui/compositor/compositor_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698