Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: ui/compositor/compositor.cc

Issue 1413003005: Set gpu memory policy in UI compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve bot failures. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 static_cast<gfx::BufferFormat>(format), usage); 159 static_cast<gfx::BufferFormat>(format), usage);
160 } 160 }
161 161
162 // Note: Only enable image decode tasks if we have more than one worker 162 // Note: Only enable image decode tasks if we have more than one worker
163 // thread. 163 // thread.
164 settings.image_decode_tasks_enabled = false; 164 settings.image_decode_tasks_enabled = false;
165 165
166 settings.use_compositor_animation_timelines = 166 settings.use_compositor_animation_timelines =
167 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines); 167 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines);
168 168
169 #if !defined(OS_ANDROID)
170 // TODO(sohanjg): Revisit this memory usage in tile manager.
171 cc::ManagedMemoryPolicy policy(
172 512 * 1024 * 1024, gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
173 settings.memory_policy_.num_resources_limit);
174 settings.memory_policy_ = policy;
175 #endif
176
169 base::TimeTicks before_create = base::TimeTicks::Now(); 177 base::TimeTicks before_create = base::TimeTicks::Now();
170 178
171 cc::LayerTreeHost::InitParams params; 179 cc::LayerTreeHost::InitParams params;
172 params.client = this; 180 params.client = this;
173 params.shared_bitmap_manager = context_factory_->GetSharedBitmapManager(); 181 params.shared_bitmap_manager = context_factory_->GetSharedBitmapManager();
174 params.gpu_memory_buffer_manager = 182 params.gpu_memory_buffer_manager =
175 context_factory_->GetGpuMemoryBufferManager(); 183 context_factory_->GetGpuMemoryBufferManager();
176 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); 184 params.task_graph_runner = context_factory_->GetTaskGraphRunner();
177 params.settings = &settings; 185 params.settings = &settings;
178 params.main_task_runner = task_runner_; 186 params.main_task_runner = task_runner_;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 observer_list_, 500 observer_list_,
493 OnCompositingLockStateChanged(this)); 501 OnCompositingLockStateChanged(this));
494 } 502 }
495 503
496 void Compositor::CancelCompositorLock() { 504 void Compositor::CancelCompositorLock() {
497 if (compositor_lock_) 505 if (compositor_lock_)
498 compositor_lock_->CancelLock(); 506 compositor_lock_->CancelLock();
499 } 507 }
500 508
501 } // namespace ui 509 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698