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

Unified Diff: ui/compositor/compositor_util.cc

Issue 2895273002: Unified the use of BufferToTextureTargetMap for all the Processes (Closed)
Patch Set: nit taken care Created 3 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 | « 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 0ced0a7e6e56e76f233a7ead518c88880e418a34..e8464b8bdab1ef50561635bf9059fd1891aad91a 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(
+ const 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 =
base::FeatureList::IsEnabled(features::kColorCorrectRendering) ||
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);
renderer_settings.allow_antialiasing =
« no previous file with comments | « ui/compositor/compositor_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698