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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |