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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 settings.use_one_copy = IsUIOneCopyEnabled(); | 134 settings.use_one_copy = IsUIOneCopyEnabled(); |
135 | 135 |
136 // TODO(reveman): We currently assume that the compositor will use BGRA_8888 | 136 // TODO(reveman): We currently assume that the compositor will use BGRA_8888 |
137 // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will | 137 // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will |
138 // use we hardcode BGRA_8888 here for now. We should instead | 138 // use we hardcode BGRA_8888 here for now. We should instead |
139 // move decisions about GpuMemoryBuffer format to the browser embedder so we | 139 // move decisions about GpuMemoryBuffer format to the browser embedder so we |
140 // know it here, and pass that decision to the compositor for each usage. | 140 // know it here, and pass that decision to the compositor for each usage. |
141 // crbug.com/490362 | 141 // crbug.com/490362 |
142 gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888; | 142 gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888; |
143 | 143 |
144 gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::MAP; | |
145 // TODO(danakj): Do this for partial raster: | |
146 // Use PERSISTENT_MAP memory buffers to support partial tile raster for | 144 // Use PERSISTENT_MAP memory buffers to support partial tile raster for |
147 // software raster into GpuMemoryBuffers. | 145 // software raster into GpuMemoryBuffers. |
148 // gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::PERSISTENT_MAP; | 146 gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::PERSISTENT_MAP; |
149 // settings.use_persistent_map_gpu_memory_buffer_usage = true; | 147 settings.use_persistent_map_for_gpu_memory_buffers = true; |
150 | 148 |
151 settings.use_image_texture_target = | 149 settings.use_image_texture_target = |
152 context_factory_->GetImageTextureTarget(format, usage); | 150 context_factory_->GetImageTextureTarget(format, usage); |
153 | 151 |
154 // Note: gathering of pixel refs is only needed when using multiple | 152 // Note: gathering of pixel refs is only needed when using multiple |
155 // raster threads. | 153 // raster threads. |
156 settings.gather_pixel_refs = false; | 154 settings.gather_pixel_refs = false; |
157 | 155 |
158 base::TimeTicks before_create = base::TimeTicks::Now(); | 156 base::TimeTicks before_create = base::TimeTicks::Now(); |
159 | 157 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 observer_list_, | 454 observer_list_, |
457 OnCompositingLockStateChanged(this)); | 455 OnCompositingLockStateChanged(this)); |
458 } | 456 } |
459 | 457 |
460 void Compositor::CancelCompositorLock() { | 458 void Compositor::CancelCompositorLock() { |
461 if (compositor_lock_) | 459 if (compositor_lock_) |
462 compositor_lock_->CancelLock(); | 460 compositor_lock_->CancelLock(); |
463 } | 461 } |
464 | 462 |
465 } // namespace ui | 463 } // namespace ui |
OLD | NEW |