| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "third_party/skia/include/core/SkBitmap.h" | 37 #include "third_party/skia/include/core/SkBitmap.h" |
| 38 #include "ui/compositor/compositor_observer.h" | 38 #include "ui/compositor/compositor_observer.h" |
| 39 #include "ui/compositor/compositor_switches.h" | 39 #include "ui/compositor/compositor_switches.h" |
| 40 #include "ui/compositor/compositor_vsync_manager.h" | 40 #include "ui/compositor/compositor_vsync_manager.h" |
| 41 #include "ui/compositor/dip_util.h" | 41 #include "ui/compositor/dip_util.h" |
| 42 #include "ui/compositor/layer.h" | 42 #include "ui/compositor/layer.h" |
| 43 #include "ui/compositor/layer_animator_collection.h" | 43 #include "ui/compositor/layer_animator_collection.h" |
| 44 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 44 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 45 #include "ui/display/display_switches.h" | 45 #include "ui/display/display_switches.h" |
| 46 #include "ui/gfx/icc_profile.h" | 46 #include "ui/gfx/icc_profile.h" |
| 47 #include "ui/gfx/switches.h" |
| 47 #include "ui/gl/gl_switches.h" | 48 #include "ui/gl/gl_switches.h" |
| 48 | 49 |
| 49 namespace ui { | 50 namespace ui { |
| 50 | 51 |
| 51 Compositor::Compositor(const cc::FrameSinkId& frame_sink_id, | 52 Compositor::Compositor(const cc::FrameSinkId& frame_sink_id, |
| 52 ui::ContextFactory* context_factory, | 53 ui::ContextFactory* context_factory, |
| 53 ui::ContextFactoryPrivate* context_factory_private, | 54 ui::ContextFactoryPrivate* context_factory_private, |
| 54 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | 55 scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
| 55 : context_factory_(context_factory), | 56 : context_factory_(context_factory), |
| 56 context_factory_private_(context_factory_private), | 57 context_factory_private_(context_factory_private), |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 139 |
| 139 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 140 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
| 140 | 141 |
| 141 if (command_line->HasSwitch(switches::kUIEnableRGBA4444Textures)) | 142 if (command_line->HasSwitch(switches::kUIEnableRGBA4444Textures)) |
| 142 settings.renderer_settings.preferred_tile_format = cc::RGBA_4444; | 143 settings.renderer_settings.preferred_tile_format = cc::RGBA_4444; |
| 143 | 144 |
| 144 settings.use_layer_lists = | 145 settings.use_layer_lists = |
| 145 command_line->HasSwitch(cc::switches::kUIEnableLayerLists); | 146 command_line->HasSwitch(cc::switches::kUIEnableLayerLists); |
| 146 | 147 |
| 147 settings.enable_color_correct_rasterization = | 148 settings.enable_color_correct_rasterization = |
| 148 command_line->HasSwitch(cc::switches::kEnableColorCorrectRendering); | 149 command_line->HasSwitch(switches::kEnableColorCorrectRendering); |
| 149 settings.renderer_settings.enable_color_correct_rendering = | 150 settings.renderer_settings.enable_color_correct_rendering = |
| 150 settings.enable_color_correct_rasterization || | 151 settings.enable_color_correct_rasterization || |
| 151 command_line->HasSwitch(switches::kEnableHDR); | 152 command_line->HasSwitch(switches::kEnableHDR); |
| 152 | 153 |
| 153 // UI compositor always uses partial raster if not using zero-copy. Zero copy | 154 // UI compositor always uses partial raster if not using zero-copy. Zero copy |
| 154 // doesn't currently support partial raster. | 155 // doesn't currently support partial raster. |
| 155 settings.use_partial_raster = !settings.use_zero_copy; | 156 settings.use_partial_raster = !settings.use_zero_copy; |
| 156 | 157 |
| 157 // Populate buffer_to_texture_target_map for all buffer usage/formats. | 158 // Populate buffer_to_texture_target_map for all buffer usage/formats. |
| 158 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); | 159 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 void Compositor::TimeoutLocks() { | 581 void Compositor::TimeoutLocks() { |
| 581 // Make a copy, we're going to cause |active_locks_| to become | 582 // Make a copy, we're going to cause |active_locks_| to become |
| 582 // empty. | 583 // empty. |
| 583 std::vector<CompositorLock*> locks = active_locks_; | 584 std::vector<CompositorLock*> locks = active_locks_; |
| 584 for (auto* lock : locks) | 585 for (auto* lock : locks) |
| 585 lock->TimeoutLock(); | 586 lock->TimeoutLock(); |
| 586 DCHECK(active_locks_.empty()); | 587 DCHECK(active_locks_.empty()); |
| 587 } | 588 } |
| 588 | 589 |
| 589 } // namespace ui | 590 } // namespace ui |
| OLD | NEW |