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