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

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

Issue 2684993005: (NotForReview) Enable YUV video overlay on Skylake ChromeOS.
Patch Set: rebase to ToT (Mar/27) 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
« no previous file with comments | « gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc ('k') | gpu/ipc/common/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 case gfx::BufferFormat::YUV_420_BIPLANAR: { 140 case gfx::BufferFormat::YUV_420_BIPLANAR: {
141 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format); 141 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format);
142 for (size_t i = 0; i < num_planes; ++i) { 142 for (size_t i = 0; i < num_planes; ++i) {
143 size_t factor = gfx::SubsamplingFactorForBufferFormat(format, i); 143 size_t factor = gfx::SubsamplingFactorForBufferFormat(format, i);
144 if (size.width() % factor || size.height() % factor) 144 if (size.width() % factor || size.height() % factor)
145 return false; 145 return false;
146 } 146 }
147 return true; 147 return true;
148 } 148 }
149 case gfx::BufferFormat::UYVY_422: 149 case gfx::BufferFormat::UYVY_422:
150 case gfx::BufferFormat::YUYV_422:
150 return size.width() % 2 == 0; 151 return size.width() % 2 == 0;
151 } 152 }
152 153
153 NOTREACHED(); 154 NOTREACHED();
154 return false; 155 return false;
155 } 156 }
156 157
157 // static 158 // static
158 base::Closure GpuMemoryBufferImplSharedMemory::AllocateForTesting( 159 base::Closure GpuMemoryBufferImplSharedMemory::AllocateForTesting(
159 const gfx::Size& size, 160 const gfx::Size& size,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 gfx::GpuMemoryBufferHandle handle; 205 gfx::GpuMemoryBufferHandle handle;
205 handle.type = gfx::SHARED_MEMORY_BUFFER; 206 handle.type = gfx::SHARED_MEMORY_BUFFER;
206 handle.id = id_; 207 handle.id = id_;
207 handle.offset = offset_; 208 handle.offset = offset_;
208 handle.stride = stride_; 209 handle.stride = stride_;
209 handle.handle = shared_memory_->handle(); 210 handle.handle = shared_memory_->handle();
210 return handle; 211 return handle;
211 } 212 }
212 213
213 } // namespace gpu 214 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc ('k') | gpu/ipc/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698