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

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

Issue 2930143004: Add DIRECT_COMPOSITION GpuMemoryBuffer type.
Patch Set: fix build Created 3 years, 6 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::SCANOUT_CPU_READ_WRITE:
25 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: 25 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
26 return 0; 26 return 0;
27 case gfx::BufferUsage::SCANOUT_ASYNC:
28 break;
27 } 29 }
28 NOTREACHED(); 30 NOTREACHED();
29 return 0; 31 return 0;
30 } 32 }
31 33
32 void NoOp() {} 34 void NoOp() {}
33 35
34 } // namespace 36 } // namespace
35 37
36 GpuMemoryBufferImplIOSurface::GpuMemoryBufferImplIOSurface( 38 GpuMemoryBufferImplIOSurface::GpuMemoryBufferImplIOSurface(
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 136 }
135 137
136 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { 138 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const {
137 gfx::GpuMemoryBufferHandle handle; 139 gfx::GpuMemoryBufferHandle handle;
138 handle.type = gfx::IO_SURFACE_BUFFER; 140 handle.type = gfx::IO_SURFACE_BUFFER;
139 handle.id = id_; 141 handle.id = id_;
140 return handle; 142 return handle;
141 } 143 }
142 144
143 } // namespace gpu 145 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698