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