| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/compositor_util.h" | 5 #include "ui/compositor/compositor_util.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "cc/base/switches.h" | 8 #include "cc/base/switches.h" |
| 9 #include "cc/output/renderer_settings.h" | 9 #include "cc/output/renderer_settings.h" |
| 10 #include "ui/compositor/compositor_switches.h" | 10 #include "ui/compositor/compositor_switches.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 23 renderer_settings.finish_rendering_on_resize = true; | 23 renderer_settings.finish_rendering_on_resize = true; |
| 24 #elif defined(OS_MACOSX) | 24 #elif defined(OS_MACOSX) |
| 25 renderer_settings.release_overlay_resources_after_gpu_query = true; | 25 renderer_settings.release_overlay_resources_after_gpu_query = true; |
| 26 #endif | 26 #endif |
| 27 renderer_settings.gl_composited_texture_quad_border = | 27 renderer_settings.gl_composited_texture_quad_border = |
| 28 command_line->HasSwitch(cc::switches::kGlCompositedTextureQuadBorder); | 28 command_line->HasSwitch(cc::switches::kGlCompositedTextureQuadBorder); |
| 29 renderer_settings.show_overdraw_feedback = | 29 renderer_settings.show_overdraw_feedback = |
| 30 command_line->HasSwitch(cc::switches::kShowOverdrawFeedback); | 30 command_line->HasSwitch(cc::switches::kShowOverdrawFeedback); |
| 31 renderer_settings.enable_color_correct_rendering = | 31 renderer_settings.enable_color_correct_rendering = |
| 32 command_line->HasSwitch(switches::kEnableColorCorrectRendering) || | 32 base::FeatureList::IsEnabled(features::kColorCorrectRendering) || |
| 33 command_line->HasSwitch(switches::kEnableHDR); | 33 command_line->HasSwitch(switches::kEnableHDR); |
| 34 // Populate buffer_to_texture_target_map for all buffer usage/formats. | 34 // Populate buffer_to_texture_target_map for all buffer usage/formats. |
| 35 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); | 35 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); |
| 36 ++usage_idx) { | 36 ++usage_idx) { |
| 37 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); | 37 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); |
| 38 for (int format_idx = 0; | 38 for (int format_idx = 0; |
| 39 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); | 39 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); |
| 40 ++format_idx) { | 40 ++format_idx) { |
| 41 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); | 41 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); |
| 42 renderer_settings.resource_settings | 42 renderer_settings.resource_settings |
| 43 .buffer_to_texture_target_map[std::make_pair(usage, format)] = | 43 .buffer_to_texture_target_map[std::make_pair(usage, format)] = |
| 44 get_texture_target(format, usage); | 44 get_texture_target(format, usage); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 renderer_settings.disallow_non_exact_resource_reuse = | 47 renderer_settings.disallow_non_exact_resource_reuse = |
| 48 command_line->HasSwitch(cc::switches::kDisallowNonExactResourceReuse); | 48 command_line->HasSwitch(cc::switches::kDisallowNonExactResourceReuse); |
| 49 renderer_settings.allow_antialiasing = | 49 renderer_settings.allow_antialiasing = |
| 50 !command_line->HasSwitch(cc::switches::kDisableCompositedAntialiasing); | 50 !command_line->HasSwitch(cc::switches::kDisableCompositedAntialiasing); |
| 51 | 51 |
| 52 return renderer_settings; | 52 return renderer_settings; |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace ui | 55 } // namespace ui |
| OLD | NEW |