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

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

Issue 1269503007: Unify graphics buffer format & usage enums for GpuMemoryBuffer & SurfaceFactoryOzone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add header to BUILD.gn Created 5 years, 4 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 | « ui/compositor/compositor.h ('k') | ui/compositor/test/in_process_context_factory.h » ('j') | 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 settings.use_zero_copy = IsUIZeroCopyEnabled(); 137 settings.use_zero_copy = IsUIZeroCopyEnabled();
138 settings.use_one_copy = IsUIOneCopyEnabled(); 138 settings.use_one_copy = IsUIOneCopyEnabled();
139 139
140 // TODO(reveman): We currently assume that the compositor will use BGRA_8888 140 // TODO(reveman): We currently assume that the compositor will use BGRA_8888
141 // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will 141 // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will
142 // use we hardcode BGRA_8888 here for now. We should instead 142 // use we hardcode BGRA_8888 here for now. We should instead
143 // move decisions about GpuMemoryBuffer format to the browser embedder so we 143 // move decisions about GpuMemoryBuffer format to the browser embedder so we
144 // know it here, and pass that decision to the compositor for each usage. 144 // know it here, and pass that decision to the compositor for each usage.
145 // crbug.com/490362 145 // crbug.com/490362
146 gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888; 146 gfx::BufferFormat format = gfx::BufferFormat::BGRA_8888;
147 147
148 // Use PERSISTENT_MAP memory buffers to support partial tile raster for 148 // Use PERSISTENT_MAP memory buffers to support partial tile raster for
149 // software raster into GpuMemoryBuffers. 149 // software raster into GpuMemoryBuffers.
150 gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::PERSISTENT_MAP; 150 gfx::BufferUsage usage = gfx::BufferUsage::PERSISTENT_MAP;
151 settings.use_persistent_map_for_gpu_memory_buffers = true; 151 settings.use_persistent_map_for_gpu_memory_buffers = true;
152 152
153 settings.use_image_texture_target = 153 settings.use_image_texture_target =
154 context_factory_->GetImageTextureTarget(format, usage); 154 context_factory_->GetImageTextureTarget(format, usage);
155 155
156 // Note: gathering of pixel refs is only needed when using multiple 156 // Note: gathering of pixel refs is only needed when using multiple
157 // raster threads. 157 // raster threads.
158 settings.gather_pixel_refs = false; 158 settings.gather_pixel_refs = false;
159 159
160 settings.use_compositor_animation_timelines = 160 settings.use_compositor_animation_timelines =
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 observer_list_, 458 observer_list_,
459 OnCompositingLockStateChanged(this)); 459 OnCompositingLockStateChanged(this));
460 } 460 }
461 461
462 void Compositor::CancelCompositorLock() { 462 void Compositor::CancelCompositorLock() {
463 if (compositor_lock_) 463 if (compositor_lock_)
464 compositor_lock_->CancelLock(); 464 compositor_lock_->CancelLock();
465 } 465 }
466 466
467 } // namespace ui 467 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/test/in_process_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698