| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 uint32_t target = context_factory_->GetImageTextureTarget(format, usage); | 165 uint32_t target = context_factory_->GetImageTextureTarget(format, usage); |
| 166 settings.renderer_settings | 166 settings.renderer_settings |
| 167 .buffer_to_texture_target_map[std::make_pair(usage, format)] = target; | 167 .buffer_to_texture_target_map[std::make_pair(usage, format)] = target; |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; | 171 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; |
| 172 settings.gpu_memory_policy.priority_cutoff_when_visible = | 172 settings.gpu_memory_policy.priority_cutoff_when_visible = |
| 173 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; | 173 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; |
| 174 | 174 |
| 175 settings.disallow_non_exact_resource_reuse = |
| 176 command_line->HasSwitch(cc::switches::kDisallowNonExactResourceReuse); |
| 177 settings.renderer_settings.disallow_non_exact_resource_reuse = |
| 178 settings.disallow_non_exact_resource_reuse; |
| 179 |
| 175 base::TimeTicks before_create = base::TimeTicks::Now(); | 180 base::TimeTicks before_create = base::TimeTicks::Now(); |
| 176 | 181 |
| 177 animation_host_ = cc::AnimationHost::CreateMainInstance(); | 182 animation_host_ = cc::AnimationHost::CreateMainInstance(); |
| 178 | 183 |
| 179 cc::LayerTreeHost::InitParams params; | 184 cc::LayerTreeHost::InitParams params; |
| 180 params.client = this; | 185 params.client = this; |
| 181 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); | 186 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); |
| 182 params.settings = &settings; | 187 params.settings = &settings; |
| 183 params.main_task_runner = task_runner_; | 188 params.main_task_runner = task_runner_; |
| 184 params.mutator_host = animation_host_.get(); | 189 params.mutator_host = animation_host_.get(); |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 void Compositor::TimeoutLocks() { | 585 void Compositor::TimeoutLocks() { |
| 581 // Make a copy, we're going to cause |active_locks_| to become | 586 // Make a copy, we're going to cause |active_locks_| to become |
| 582 // empty. | 587 // empty. |
| 583 std::vector<CompositorLock*> locks = active_locks_; | 588 std::vector<CompositorLock*> locks = active_locks_; |
| 584 for (auto* lock : locks) | 589 for (auto* lock : locks) |
| 585 lock->TimeoutLock(); | 590 lock->TimeoutLock(); |
| 586 DCHECK(active_locks_.empty()); | 591 DCHECK(active_locks_.empty()); |
| 587 } | 592 } |
| 588 | 593 |
| 589 } // namespace ui | 594 } // namespace ui |
| OLD | NEW |