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

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

Issue 2376293003: gpu: support RG_88 GpuMemoryBuffer (Closed)
Patch Set: resolve hubbe's review Created 4 years, 2 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
« no previous file with comments | « ui/gl/gl_image_memory.cc ('k') | ui/ozone/gl/gl_image_ozone_native_pixmap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gl/gl_implementation.h" 9 #include "ui/gl/gl_implementation.h"
10 #include "ui/gl/init/gl_factory.h" 10 #include "ui/gl/init/gl_factory.h"
(...skipping 28 matching lines...) Expand all
39 // static 39 // static
40 void GLImageTestSupport::SetBufferDataToColor(int width, 40 void GLImageTestSupport::SetBufferDataToColor(int width,
41 int height, 41 int height,
42 int stride, 42 int stride,
43 int plane, 43 int plane,
44 gfx::BufferFormat format, 44 gfx::BufferFormat format,
45 const uint8_t color[4], 45 const uint8_t color[4],
46 uint8_t* data) { 46 uint8_t* data) {
47 switch (format) { 47 switch (format) {
48 case gfx::BufferFormat::R_8: 48 case gfx::BufferFormat::R_8:
49 case gfx::BufferFormat::RG_88:
49 DCHECK_EQ(0, plane); 50 DCHECK_EQ(0, plane);
50 for (int y = 0; y < height; ++y) { 51 for (int y = 0; y < height; ++y) {
51 memset(&data[y * stride], color[0], width); 52 memset(&data[y * stride], color[0], width);
52 } 53 }
53 return; 54 return;
54 case gfx::BufferFormat::BGR_565: 55 case gfx::BufferFormat::BGR_565:
55 DCHECK_EQ(0, plane); 56 DCHECK_EQ(0, plane);
56 for (int y = 0; y < height; ++y) { 57 for (int y = 0; y < height; ++y) {
57 for (int x = 0; x < width; ++x) { 58 for (int x = 0; x < width; ++x) {
58 *reinterpret_cast<uint16_t*>(&data[y * stride + x * 2]) = 59 *reinterpret_cast<uint16_t*>(&data[y * stride + x * 2]) =
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 case gfx::BufferFormat::ETC1: 166 case gfx::BufferFormat::ETC1:
166 case gfx::BufferFormat::RGBA_4444: 167 case gfx::BufferFormat::RGBA_4444:
167 case gfx::BufferFormat::UYVY_422: 168 case gfx::BufferFormat::UYVY_422:
168 NOTREACHED(); 169 NOTREACHED();
169 return; 170 return;
170 } 171 }
171 NOTREACHED(); 172 NOTREACHED();
172 } 173 }
173 174
174 } // namespace gl 175 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_image_memory.cc ('k') | ui/ozone/gl/gl_image_ozone_native_pixmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698