| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 settings.initial_debug_state.show_screen_space_rects = | 139 settings.initial_debug_state.show_screen_space_rects = |
| 140 command_line->HasSwitch(cc::switches::kUIShowScreenSpaceRects); | 140 command_line->HasSwitch(cc::switches::kUIShowScreenSpaceRects); |
| 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 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 147 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
| 148 | 148 |
| 149 settings.renderer_settings.use_rgba_4444_textures = | 149 if (command_line->HasSwitch(switches::kUIEnableRGBA4444Textures)) |
| 150 command_line->HasSwitch(switches::kUIEnableRGBA4444Textures); | 150 settings.renderer_settings.preferred_tile_format = cc::RGBA_4444; |
| 151 | 151 |
| 152 // UI compositor always uses partial raster if not using zero-copy. Zero copy | 152 // UI compositor always uses partial raster if not using zero-copy. Zero copy |
| 153 // doesn't currently support partial raster. | 153 // doesn't currently support partial raster. |
| 154 settings.use_partial_raster = !settings.use_zero_copy; | 154 settings.use_partial_raster = !settings.use_zero_copy; |
| 155 | 155 |
| 156 // Use CPU_READ_WRITE_PERSISTENT memory buffers to support partial tile | 156 // Use CPU_READ_WRITE_PERSISTENT memory buffers to support partial tile |
| 157 // raster if needed. | 157 // raster if needed. |
| 158 gfx::BufferUsage usage = | 158 gfx::BufferUsage usage = |
| 159 settings.use_partial_raster | 159 settings.use_partial_raster |
| 160 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT | 160 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 observer_list_, | 522 observer_list_, |
| 523 OnCompositingLockStateChanged(this)); | 523 OnCompositingLockStateChanged(this)); |
| 524 } | 524 } |
| 525 | 525 |
| 526 void Compositor::CancelCompositorLock() { | 526 void Compositor::CancelCompositorLock() { |
| 527 if (compositor_lock_) | 527 if (compositor_lock_) |
| 528 compositor_lock_->CancelLock(); | 528 compositor_lock_->CancelLock(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 } // namespace ui | 531 } // namespace ui |
| OLD | NEW |