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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 settings.initial_debug_state.show_replica_screen_space_rects = | 141 settings.initial_debug_state.show_replica_screen_space_rects = |
142 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); | 142 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); |
143 | 143 |
144 settings.initial_debug_state.SetRecordRenderingStats( | 144 settings.initial_debug_state.SetRecordRenderingStats( |
145 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); | 145 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
146 | 146 |
147 if (command_line->HasSwitch(cc::switches::kDisableCompositorPropertyTrees)) | 147 if (command_line->HasSwitch(cc::switches::kDisableCompositorPropertyTrees)) |
148 settings.use_property_trees = false; | 148 settings.use_property_trees = false; |
149 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 149 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
150 | 150 |
151 settings.renderer_settings.use_rgba_4444_textures = | 151 if (command_line->HasSwitch(switches::kUIEnableRGBA4444Textures)) |
152 command_line->HasSwitch(switches::kUIEnableRGBA4444Textures); | 152 settings.renderer_settings.preferred_tile_format = cc::RGBA_4444; |
153 | 153 |
154 // 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 |
155 // doesn't currently support partial raster. | 155 // doesn't currently support partial raster. |
156 settings.use_partial_raster = !settings.use_zero_copy; | 156 settings.use_partial_raster = !settings.use_zero_copy; |
157 | 157 |
158 // Use CPU_READ_WRITE_PERSISTENT memory buffers to support partial tile | 158 // Use CPU_READ_WRITE_PERSISTENT memory buffers to support partial tile |
159 // raster if needed. | 159 // raster if needed. |
160 gfx::BufferUsage usage = | 160 gfx::BufferUsage usage = |
161 settings.use_partial_raster | 161 settings.use_partial_raster |
162 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT | 162 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 observer_list_, | 524 observer_list_, |
525 OnCompositingLockStateChanged(this)); | 525 OnCompositingLockStateChanged(this)); |
526 } | 526 } |
527 | 527 |
528 void Compositor::CancelCompositorLock() { | 528 void Compositor::CancelCompositorLock() { |
529 if (compositor_lock_) | 529 if (compositor_lock_) |
530 compositor_lock_->CancelLock(); | 530 compositor_lock_->CancelLock(); |
531 } | 531 } |
532 | 532 |
533 } // namespace ui | 533 } // namespace ui |
OLD | NEW |