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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 for (int format_idx = 0; | 179 for (int format_idx = 0; |
180 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); | 180 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); |
181 ++format_idx) { | 181 ++format_idx) { |
182 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); | 182 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); |
183 uint32_t target = context_factory_->GetImageTextureTarget(format, usage); | 183 uint32_t target = context_factory_->GetImageTextureTarget(format, usage); |
184 settings.renderer_settings | 184 settings.renderer_settings |
185 .buffer_to_texture_target_map[std::make_pair(usage, format)] = target; | 185 .buffer_to_texture_target_map[std::make_pair(usage, format)] = target; |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 // Note: Although there is only one image decode thread, we should still get a | |
190 // benefit from locking images across several raster tasks. At worst, this | |
191 // should do as much work as it would anyway. | |
192 settings.image_decode_tasks_enabled = true; | |
193 | |
194 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; | 189 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; |
195 settings.gpu_memory_policy.priority_cutoff_when_visible = | 190 settings.gpu_memory_policy.priority_cutoff_when_visible = |
196 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; | 191 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; |
197 | 192 |
198 base::TimeTicks before_create = base::TimeTicks::Now(); | 193 base::TimeTicks before_create = base::TimeTicks::Now(); |
199 | 194 |
200 animation_host_ = cc::AnimationHost::CreateMainInstance(); | 195 animation_host_ = cc::AnimationHost::CreateMainInstance(); |
201 | 196 |
202 cc::LayerTreeHost::InitParams params; | 197 cc::LayerTreeHost::InitParams params; |
203 params.client = this; | 198 params.client = this; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 void Compositor::TimeoutLocks() { | 596 void Compositor::TimeoutLocks() { |
602 // Make a copy, we're going to cause |active_locks_| to become | 597 // Make a copy, we're going to cause |active_locks_| to become |
603 // empty. | 598 // empty. |
604 std::vector<CompositorLock*> locks = active_locks_; | 599 std::vector<CompositorLock*> locks = active_locks_; |
605 for (auto* lock : locks) | 600 for (auto* lock : locks) |
606 lock->TimeoutLock(); | 601 lock->TimeoutLock(); |
607 DCHECK(active_locks_.empty()); | 602 DCHECK(active_locks_.empty()); |
608 } | 603 } |
609 | 604 |
610 } // namespace ui | 605 } // namespace ui |
OLD | NEW |