OLD | NEW |
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 "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h" | 5 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/common/mac/io_surface_manager.h" | 8 #include "content/common/mac/io_surface_manager.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 namespace { | 11 namespace { |
12 | 12 |
13 uint32_t LockFlags(gfx::GpuMemoryBuffer::Usage usage) { | 13 uint32_t LockFlags(gfx::GpuMemoryBuffer::Usage usage) { |
14 switch (usage) { | 14 switch (usage) { |
15 case gfx::GpuMemoryBuffer::MAP: | 15 case gfx::GpuMemoryBuffer::MAP: |
16 return kIOSurfaceLockAvoidSync; | 16 return kIOSurfaceLockAvoidSync; |
17 case gfx::GpuMemoryBuffer::PERSISTENT_MAP: | 17 case gfx::GpuMemoryBuffer::PERSISTENT_MAP: |
18 return 0; | 18 return 0; |
19 case gfx::GpuMemoryBuffer::SCANOUT: | 19 case gfx::GpuMemoryBuffer::SCANOUT: |
20 NOTREACHED(); | |
21 return 0; | 20 return 0; |
22 } | 21 } |
23 NOTREACHED(); | 22 NOTREACHED(); |
24 return 0; | 23 return 0; |
25 } | 24 } |
26 | 25 |
27 } // namespace | 26 } // namespace |
28 | 27 |
29 GpuMemoryBufferImplIOSurface::GpuMemoryBufferImplIOSurface( | 28 GpuMemoryBufferImplIOSurface::GpuMemoryBufferImplIOSurface( |
30 gfx::GpuMemoryBufferId id, | 29 gfx::GpuMemoryBufferId id, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 77 } |
79 | 78 |
80 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { | 79 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { |
81 gfx::GpuMemoryBufferHandle handle; | 80 gfx::GpuMemoryBufferHandle handle; |
82 handle.type = gfx::IO_SURFACE_BUFFER; | 81 handle.type = gfx::IO_SURFACE_BUFFER; |
83 handle.id = id_; | 82 handle.id = id_; |
84 return handle; | 83 return handle; |
85 } | 84 } |
86 | 85 |
87 } // namespace content | 86 } // namespace content |
OLD | NEW |