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

Side by Side Diff: ui/gl/test/gl_image_test_support.cc

Issue 2920793005: gpu: support R16 GPUMemoryBuffer (Closed)
Patch Set: return capabilities.texture_norm16 Created 3 years, 6 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 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
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:
aleksandar.stojiljkovic 2017/06/08 14:27:56 are there any tests using this? Should be somethi
riju_ 2017/06/09 08:20:10 Thanks.
riju_ 2017/06/09 08:20:10 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698