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

Side by Side Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 1282313002: Add YUV_420_BIPLANAR to gfx::BufferFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmb-planes
Patch Set: Fix ozone build Created 5 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_buffer/tests/gl_manager.h" 5 #include "gpu/command_buffer/tests/gl_manager.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 case gfx::BufferFormat::RGBA_4444: 50 case gfx::BufferFormat::RGBA_4444:
51 case gfx::BufferFormat::RGBA_8888: 51 case gfx::BufferFormat::RGBA_8888:
52 case gfx::BufferFormat::RGBX_8888: 52 case gfx::BufferFormat::RGBX_8888:
53 case gfx::BufferFormat::BGRA_8888: 53 case gfx::BufferFormat::BGRA_8888:
54 return 1; 54 return 1;
55 case gfx::BufferFormat::YUV_420: { 55 case gfx::BufferFormat::YUV_420: {
56 static size_t factor[] = {1, 2, 2}; 56 static size_t factor[] = {1, 2, 2};
57 DCHECK_LT(static_cast<size_t>(plane), arraysize(factor)); 57 DCHECK_LT(static_cast<size_t>(plane), arraysize(factor));
58 return factor[plane]; 58 return factor[plane];
59 } 59 }
60 case gfx::BufferFormat::YUV_420_BIPLANAR: {
61 static size_t factor[] = {1, 2};
62 DCHECK_LT(static_cast<size_t>(plane), arraysize(factor));
63 return factor[plane];
64 }
60 } 65 }
61 NOTREACHED(); 66 NOTREACHED();
62 return 0; 67 return 0;
63 } 68 }
64 69
65 size_t StrideInBytes(size_t width, gfx::BufferFormat format, int plane) { 70 size_t StrideInBytes(size_t width, gfx::BufferFormat format, int plane) {
66 switch (format) { 71 switch (format) {
67 case gfx::BufferFormat::ATCIA: 72 case gfx::BufferFormat::ATCIA:
68 case gfx::BufferFormat::DXT5: 73 case gfx::BufferFormat::DXT5:
69 DCHECK_EQ(plane, 0); 74 DCHECK_EQ(plane, 0);
(...skipping 11 matching lines...) Expand all
81 return width * 2; 86 return width * 2;
82 case gfx::BufferFormat::RGBA_8888: 87 case gfx::BufferFormat::RGBA_8888:
83 case gfx::BufferFormat::BGRA_8888: 88 case gfx::BufferFormat::BGRA_8888:
84 DCHECK_EQ(plane, 0); 89 DCHECK_EQ(plane, 0);
85 return width * 4; 90 return width * 4;
86 case gfx::BufferFormat::RGBX_8888: 91 case gfx::BufferFormat::RGBX_8888:
87 NOTREACHED(); 92 NOTREACHED();
88 return 0; 93 return 0;
89 case gfx::BufferFormat::YUV_420: 94 case gfx::BufferFormat::YUV_420:
90 return width / SubsamplingFactor(format, plane); 95 return width / SubsamplingFactor(format, plane);
96 case gfx::BufferFormat::YUV_420_BIPLANAR:
97 return width;
91 } 98 }
92 99
93 NOTREACHED(); 100 NOTREACHED();
94 return 0; 101 return 0;
95 } 102 }
96 103
97 size_t BufferSizeInBytes(const gfx::Size& size, gfx::BufferFormat format) { 104 size_t BufferSizeInBytes(const gfx::Size& size, gfx::BufferFormat format) {
98 size_t size_in_bytes = 0; 105 size_t size_in_bytes = 0;
99 size_t num_planes = gfx::GpuMemoryBuffer::NumberOfPlanes(format); 106 size_t num_planes = gfx::GpuMemoryBuffer::NumberOfPlanes(format);
100 for (size_t i = 0; i < num_planes; ++i) { 107 for (size_t i = 0; i < num_planes; ++i) {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 void GLManager::SetLock(base::Lock*) { 505 void GLManager::SetLock(base::Lock*) {
499 NOTIMPLEMENTED(); 506 NOTIMPLEMENTED();
500 } 507 }
501 508
502 bool GLManager::IsGpuChannelLost() { 509 bool GLManager::IsGpuChannelLost() {
503 NOTIMPLEMENTED(); 510 NOTIMPLEMENTED();
504 return false; 511 return false;
505 } 512 }
506 513
507 } // namespace gpu 514 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698