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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc

Issue 2717963002: ui: Add gfx::BufferUsage::SCANOUT_CPU_READ_WRITE. (Closed)
Patch Set: SCANOUT_CPU_READ_WRITE as valid shm usage 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h" 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
11 #include "ui/gfx/buffer_format_util.h" 11 #include "ui/gfx/buffer_format_util.h"
12 #include "ui/gfx/icc_profile.h" 12 #include "ui/gfx/icc_profile.h"
13 #include "ui/gfx/mac/io_surface.h" 13 #include "ui/gfx/mac/io_surface.h"
14 14
15 namespace gpu { 15 namespace gpu {
16 namespace { 16 namespace {
17 17
18 uint32_t LockFlags(gfx::BufferUsage usage) { 18 uint32_t LockFlags(gfx::BufferUsage usage) {
19 switch (usage) { 19 switch (usage) {
20 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: 20 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
21 return kIOSurfaceLockAvoidSync; 21 return kIOSurfaceLockAvoidSync;
22 case gfx::BufferUsage::GPU_READ: 22 case gfx::BufferUsage::GPU_READ:
23 case gfx::BufferUsage::SCANOUT: 23 case gfx::BufferUsage::SCANOUT:
24 case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
24 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: 25 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
25 return 0; 26 return 0;
26 } 27 }
27 NOTREACHED(); 28 NOTREACHED();
28 return 0; 29 return 0;
29 } 30 }
30 31
31 void NoOp() {} 32 void NoOp() {}
32 33
33 } // namespace 34 } // namespace
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 134 }
134 135
135 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { 136 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const {
136 gfx::GpuMemoryBufferHandle handle; 137 gfx::GpuMemoryBufferHandle handle;
137 handle.type = gfx::IO_SURFACE_BUFFER; 138 handle.type = gfx::IO_SURFACE_BUFFER;
138 handle.id = id_; 139 handle.id = id_;
139 return handle; 140 return handle;
140 } 141 }
141 142
142 } // namespace gpu 143 } // namespace gpu
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_internals_ui.cc ('k') | gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698