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 <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 settings.initial_debug_state.show_replica_screen_space_rects = | 132 settings.initial_debug_state.show_replica_screen_space_rects = |
133 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); | 133 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); |
134 | 134 |
135 settings.initial_debug_state.SetRecordRenderingStats( | 135 settings.initial_debug_state.SetRecordRenderingStats( |
136 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); | 136 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
137 | 137 |
138 if (command_line->HasSwitch(cc::switches::kDisableCompositorPropertyTrees)) | 138 if (command_line->HasSwitch(cc::switches::kDisableCompositorPropertyTrees)) |
139 settings.use_property_trees = false; | 139 settings.use_property_trees = false; |
140 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 140 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
141 | 141 |
142 settings.renderer_settings.use_rgba_4444_textures = | 142 if (command_line->HasSwitch(switches::kUIEnableRGBA4444Textures)) |
143 command_line->HasSwitch(switches::kUIEnableRGBA4444Textures); | 143 settings.renderer_settings.preferred_tile_format = cc::RGBA_4444; |
144 | 144 |
145 // UI compositor always uses partial raster if not using zero-copy. Zero copy | 145 // UI compositor always uses partial raster if not using zero-copy. Zero copy |
146 // doesn't currently support partial raster. | 146 // doesn't currently support partial raster. |
147 settings.use_partial_raster = !settings.use_zero_copy; | 147 settings.use_partial_raster = !settings.use_zero_copy; |
148 | 148 |
149 // Use CPU_READ_WRITE_PERSISTENT memory buffers to support partial tile | 149 // Use CPU_READ_WRITE_PERSISTENT memory buffers to support partial tile |
150 // raster if needed. | 150 // raster if needed. |
151 gfx::BufferUsage usage = | 151 gfx::BufferUsage usage = |
152 settings.use_partial_raster | 152 settings.use_partial_raster |
153 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT | 153 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 observer_list_, | 502 observer_list_, |
503 OnCompositingLockStateChanged(this)); | 503 OnCompositingLockStateChanged(this)); |
504 } | 504 } |
505 | 505 |
506 void Compositor::CancelCompositorLock() { | 506 void Compositor::CancelCompositorLock() { |
507 if (compositor_lock_) | 507 if (compositor_lock_) |
508 compositor_lock_->CancelLock(); | 508 compositor_lock_->CancelLock(); |
509 } | 509 } |
510 | 510 |
511 } // namespace ui | 511 } // namespace ui |
OLD | NEW |