OLD | NEW |
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 case gfx::BufferFormat::RGBA_4444: | 51 case gfx::BufferFormat::RGBA_4444: |
52 case gfx::BufferFormat::RGBA_8888: | 52 case gfx::BufferFormat::RGBA_8888: |
53 case gfx::BufferFormat::RGBX_8888: | 53 case gfx::BufferFormat::RGBX_8888: |
54 case gfx::BufferFormat::BGRA_8888: | 54 case gfx::BufferFormat::BGRA_8888: |
55 return 1; | 55 return 1; |
56 case gfx::BufferFormat::YUV_420: { | 56 case gfx::BufferFormat::YUV_420: { |
57 static size_t factor[] = {1, 2, 2}; | 57 static size_t factor[] = {1, 2, 2}; |
58 DCHECK_LT(static_cast<size_t>(plane), arraysize(factor)); | 58 DCHECK_LT(static_cast<size_t>(plane), arraysize(factor)); |
59 return factor[plane]; | 59 return factor[plane]; |
60 } | 60 } |
| 61 case gfx::BufferFormat::YUV_420_BIPLANAR: { |
| 62 static size_t factor[] = {1, 2}; |
| 63 DCHECK_LT(static_cast<size_t>(plane), arraysize(factor)); |
| 64 return factor[plane]; |
| 65 } |
61 } | 66 } |
62 NOTREACHED(); | 67 NOTREACHED(); |
63 return 0; | 68 return 0; |
64 } | 69 } |
65 | 70 |
66 size_t StrideInBytes(size_t width, gfx::BufferFormat format, int plane) { | 71 size_t StrideInBytes(size_t width, gfx::BufferFormat format, int plane) { |
67 switch (format) { | 72 switch (format) { |
68 case gfx::BufferFormat::ATCIA: | 73 case gfx::BufferFormat::ATCIA: |
69 case gfx::BufferFormat::DXT5: | 74 case gfx::BufferFormat::DXT5: |
70 DCHECK_EQ(plane, 0); | 75 DCHECK_EQ(plane, 0); |
(...skipping 11 matching lines...) Expand all Loading... |
82 return width * 2; | 87 return width * 2; |
83 case gfx::BufferFormat::RGBA_8888: | 88 case gfx::BufferFormat::RGBA_8888: |
84 case gfx::BufferFormat::BGRA_8888: | 89 case gfx::BufferFormat::BGRA_8888: |
85 DCHECK_EQ(plane, 0); | 90 DCHECK_EQ(plane, 0); |
86 return width * 4; | 91 return width * 4; |
87 case gfx::BufferFormat::RGBX_8888: | 92 case gfx::BufferFormat::RGBX_8888: |
88 NOTREACHED(); | 93 NOTREACHED(); |
89 return 0; | 94 return 0; |
90 case gfx::BufferFormat::YUV_420: | 95 case gfx::BufferFormat::YUV_420: |
91 return width / SubsamplingFactor(format, plane); | 96 return width / SubsamplingFactor(format, plane); |
| 97 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 98 return width; |
92 } | 99 } |
93 | 100 |
94 NOTREACHED(); | 101 NOTREACHED(); |
95 return 0; | 102 return 0; |
96 } | 103 } |
97 | 104 |
98 size_t BufferSizeInBytes(const gfx::Size& size, gfx::BufferFormat format) { | 105 size_t BufferSizeInBytes(const gfx::Size& size, gfx::BufferFormat format) { |
99 size_t size_in_bytes = 0; | 106 size_t size_in_bytes = 0; |
100 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format); | 107 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format); |
101 for (size_t i = 0; i < num_planes; ++i) { | 108 for (size_t i = 0; i < num_planes; ++i) { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 void GLManager::SetLock(base::Lock*) { | 506 void GLManager::SetLock(base::Lock*) { |
500 NOTIMPLEMENTED(); | 507 NOTIMPLEMENTED(); |
501 } | 508 } |
502 | 509 |
503 bool GLManager::IsGpuChannelLost() { | 510 bool GLManager::IsGpuChannelLost() { |
504 NOTIMPLEMENTED(); | 511 NOTIMPLEMENTED(); |
505 return false; | 512 return false; |
506 } | 513 } |
507 | 514 |
508 } // namespace gpu | 515 } // namespace gpu |
OLD | NEW |