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

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

Issue 2585653003: gpu: Move buffer format to target texture map into gpu host. (Closed)
Patch Set: . Created 4 years 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 | « ui/aura/mus/mus_context_factory.cc ('k') | 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 // Populate buffer_to_texture_target_map for all buffer usage/formats. 171 // Populate buffer_to_texture_target_map for all buffer usage/formats.
172 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); 172 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST);
173 ++usage_idx) { 173 ++usage_idx) {
174 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); 174 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx);
175 for (int format_idx = 0; 175 for (int format_idx = 0;
176 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); 176 format_idx <= static_cast<int>(gfx::BufferFormat::LAST);
177 ++format_idx) { 177 ++format_idx) {
178 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); 178 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx);
179 uint32_t target = context_factory_->GetImageTextureTarget(format, usage); 179 uint32_t target = context_factory_->GetImageTextureTarget(format, usage);
180 settings.renderer_settings.buffer_to_texture_target_map.insert( 180 settings.renderer_settings
181 cc::BufferToTextureTargetMap::value_type( 181 .buffer_to_texture_target_map[std::make_pair(usage, format)] = target;
182 cc::BufferToTextureTargetKey(usage, format), target));
183 } 182 }
184 } 183 }
185 184
186 // Note: Only enable image decode tasks if we have more than one worker 185 // Note: Only enable image decode tasks if we have more than one worker
187 // thread. 186 // thread.
188 settings.image_decode_tasks_enabled = false; 187 settings.image_decode_tasks_enabled = false;
189 188
190 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; 189 settings.gpu_memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024;
191 settings.gpu_memory_policy.priority_cutoff_when_visible = 190 settings.gpu_memory_policy.priority_cutoff_when_visible =
192 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; 191 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 for (auto& observer : observer_list_) 557 for (auto& observer : observer_list_)
559 observer.OnCompositingLockStateChanged(this); 558 observer.OnCompositingLockStateChanged(this);
560 } 559 }
561 560
562 void Compositor::CancelCompositorLock() { 561 void Compositor::CancelCompositorLock() {
563 if (compositor_lock_) 562 if (compositor_lock_)
564 compositor_lock_->CancelLock(); 563 compositor_lock_->CancelLock();
565 } 564 }
566 565
567 } // namespace ui 566 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/mus/mus_context_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698