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

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

Issue 2689453002: Introduce gfx::BufferFormat::YUYV_422
Patch Set: rebase to ToT 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 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 case gfx::BufferFormat::YUV_420_BIPLANAR: { 142 case gfx::BufferFormat::YUV_420_BIPLANAR: {
143 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format); 143 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format);
144 for (size_t i = 0; i < num_planes; ++i) { 144 for (size_t i = 0; i < num_planes; ++i) {
145 size_t factor = gfx::SubsamplingFactorForBufferFormat(format, i); 145 size_t factor = gfx::SubsamplingFactorForBufferFormat(format, i);
146 if (size.width() % factor || size.height() % factor) 146 if (size.width() % factor || size.height() % factor)
147 return false; 147 return false;
148 } 148 }
149 return true; 149 return true;
150 } 150 }
151 case gfx::BufferFormat::UYVY_422: 151 case gfx::BufferFormat::UYVY_422:
152 case gfx::BufferFormat::YUYV_422:
152 return size.width() % 2 == 0; 153 return size.width() % 2 == 0;
153 } 154 }
154 155
155 NOTREACHED(); 156 NOTREACHED();
156 return false; 157 return false;
157 } 158 }
158 159
159 // static 160 // static
160 base::Closure GpuMemoryBufferImplSharedMemory::AllocateForTesting( 161 base::Closure GpuMemoryBufferImplSharedMemory::AllocateForTesting(
161 const gfx::Size& size, 162 const gfx::Size& size,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return handle; 213 return handle;
213 } 214 }
214 215
215 base::trace_event::MemoryAllocatorDumpGuid 216 base::trace_event::MemoryAllocatorDumpGuid
216 GpuMemoryBufferImplSharedMemory::GetGUIDForTracing( 217 GpuMemoryBufferImplSharedMemory::GetGUIDForTracing(
217 uint64_t tracing_process_id) const { 218 uint64_t tracing_process_id) const {
218 return gfx::GetSharedMemoryGUIDForTracing(tracing_process_id, id_); 219 return gfx::GetSharedMemoryGUIDForTracing(tracing_process_id, id_);
219 } 220 }
220 221
221 } // namespace gpu 222 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc ('k') | gpu/ipc/host/gpu_memory_buffer_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698