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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_shared_memory.h" 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 base::MakeUnique<base::SharedMemory>(handle.handle, false), handle.offset, 91 base::MakeUnique<base::SharedMemory>(handle.handle, false), handle.offset,
92 handle.stride)); 92 handle.stride));
93 } 93 }
94 94
95 // static 95 // static
96 bool GpuMemoryBufferImplSharedMemory::IsUsageSupported(gfx::BufferUsage usage) { 96 bool GpuMemoryBufferImplSharedMemory::IsUsageSupported(gfx::BufferUsage usage) {
97 switch (usage) { 97 switch (usage) {
98 case gfx::BufferUsage::GPU_READ: 98 case gfx::BufferUsage::GPU_READ:
99 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: 99 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
100 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: 100 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
101 case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
101 return true; 102 return true;
102 case gfx::BufferUsage::SCANOUT: 103 case gfx::BufferUsage::SCANOUT:
103 return false; 104 return false;
104 } 105 }
105 NOTREACHED(); 106 NOTREACHED();
106 return false; 107 return false;
107 } 108 }
108 109
109 // static 110 // static
110 bool GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 111 bool GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 gfx::GpuMemoryBufferHandle handle; 204 gfx::GpuMemoryBufferHandle handle;
204 handle.type = gfx::SHARED_MEMORY_BUFFER; 205 handle.type = gfx::SHARED_MEMORY_BUFFER;
205 handle.id = id_; 206 handle.id = id_;
206 handle.offset = offset_; 207 handle.offset = offset_;
207 handle.stride = stride_; 208 handle.stride = stride_;
208 handle.handle = shared_memory_->handle(); 209 handle.handle = shared_memory_->handle();
209 return handle; 210 return handle;
210 } 211 }
211 212
212 } // namespace gpu 213 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc ('k') | gpu/ipc/client/gpu_memory_buffer_impl_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698