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

Unified Diff: ui/gl/test/gl_image_test_support.cc

Issue 2920793005: gpu: support R16 GPUMemoryBuffer (Closed)
Patch Set: Fix Aleks's comments 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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/test/gl_image_test_support.cc
diff --git a/ui/gl/test/gl_image_test_support.cc b/ui/gl/test/gl_image_test_support.cc
index b77b2fd9d3863fd9553c0a50210d3647139f864a..3863b052db92f7b90cbb07c53add57ff4c51c087 100644
--- a/ui/gl/test/gl_image_test_support.cc
+++ b/ui/gl/test/gl_image_test_support.cc
@@ -60,6 +60,17 @@ void GLImageTestSupport::SetBufferDataToColor(int width,
memset(&data[y * stride], color[0], width);
}
return;
+ case gfx::BufferFormat::R_16:
+ DCHECK_EQ(0, plane);
+ uint16_t red;
+ red = (uint16_t)color[0] << 8;
reveman 2017/06/14 17:47:21 nit: "uint16_t red = static_cast<uint16_t>(color[0
riju_ 2017/06/20 13:21:31 Done.
+ for (int y = 0; y < height; ++y) {
+ uint16_t* row = reinterpret_cast<uint16_t*>(data + y * stride);
+ for (int x = 0; x < width; ++x) {
+ row[x] = red;
+ }
+ }
+ return;
case gfx::BufferFormat::BGR_565:
DCHECK_EQ(0, plane);
for (int y = 0; y < height; ++y) {

Powered by Google App Engine
This is Rietveld 408576698