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

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

Issue 2736303002: ui/compositor: Enable image decode tasks in the UI compositor. (Closed)
Patch Set: Created 3 years, 9 months 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 <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
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: Only enable image decode tasks if we have more than one worker 189 // Note: Although there is only one image decode thread, we should still get a
190 // thread. 190 // benefit from locking images across several raster tasks. At worst, this
191 settings.image_decode_tasks_enabled = false; 191 // should do as much work as it would anyway.
192 settings.image_decode_tasks_enabled = true;
192 193
193 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; 194 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024;
194 settings.gpu_memory_policy.priority_cutoff_when_visible = 195 settings.gpu_memory_policy.priority_cutoff_when_visible =
195 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; 196 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
196 197
197 base::TimeTicks before_create = base::TimeTicks::Now(); 198 base::TimeTicks before_create = base::TimeTicks::Now();
198 199
199 animation_host_ = cc::AnimationHost::CreateMainInstance(); 200 animation_host_ = cc::AnimationHost::CreateMainInstance();
200 201
201 cc::LayerTreeHost::InitParams params; 202 cc::LayerTreeHost::InitParams params;
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 for (auto& observer : observer_list_) 571 for (auto& observer : observer_list_)
571 observer.OnCompositingLockStateChanged(this); 572 observer.OnCompositingLockStateChanged(this);
572 } 573 }
573 574
574 void Compositor::CancelCompositorLock() { 575 void Compositor::CancelCompositorLock() {
575 if (compositor_lock_) 576 if (compositor_lock_)
576 compositor_lock_->CancelLock(); 577 compositor_lock_->CancelLock();
577 } 578 }
578 579
579 } // namespace ui 580 } // 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