OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/gl/test/gl_image_test_support.h" | 5 #include "ui/gl/test/gl_image_test_support.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ui/gfx/half_float.h" | 9 #include "ui/gfx/half_float.h" |
10 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // static | 47 // static |
48 void GLImageTestSupport::SetBufferDataToColor(int width, | 48 void GLImageTestSupport::SetBufferDataToColor(int width, |
49 int height, | 49 int height, |
50 int stride, | 50 int stride, |
51 int plane, | 51 int plane, |
52 gfx::BufferFormat format, | 52 gfx::BufferFormat format, |
53 const uint8_t color[4], | 53 const uint8_t color[4], |
54 uint8_t* data) { | 54 uint8_t* data) { |
55 switch (format) { | 55 switch (format) { |
56 case gfx::BufferFormat::R_8: | 56 case gfx::BufferFormat::R_8: |
| 57 case gfx::BufferFormat::R_16: |
57 case gfx::BufferFormat::RG_88: | 58 case gfx::BufferFormat::RG_88: |
58 DCHECK_EQ(0, plane); | 59 DCHECK_EQ(0, plane); |
59 for (int y = 0; y < height; ++y) { | 60 for (int y = 0; y < height; ++y) { |
60 memset(&data[y * stride], color[0], width); | 61 memset(&data[y * stride], color[0], width); |
61 } | 62 } |
62 return; | 63 return; |
63 case gfx::BufferFormat::BGR_565: | 64 case gfx::BufferFormat::BGR_565: |
64 DCHECK_EQ(0, plane); | 65 DCHECK_EQ(0, plane); |
65 for (int y = 0; y < height; ++y) { | 66 for (int y = 0; y < height; ++y) { |
66 for (int x = 0; x < width; ++x) { | 67 for (int x = 0; x < width; ++x) { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 case gfx::BufferFormat::ETC1: | 194 case gfx::BufferFormat::ETC1: |
194 case gfx::BufferFormat::RGBA_4444: | 195 case gfx::BufferFormat::RGBA_4444: |
195 case gfx::BufferFormat::UYVY_422: | 196 case gfx::BufferFormat::UYVY_422: |
196 NOTREACHED(); | 197 NOTREACHED(); |
197 return; | 198 return; |
198 } | 199 } |
199 NOTREACHED(); | 200 NOTREACHED(); |
200 } | 201 } |
201 | 202 |
202 } // namespace gl | 203 } // namespace gl |
OLD | NEW |