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

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

Issue 2920793005: gpu: support R16 GPUMemoryBuffer (Closed)
Patch Set: Add bug number to TODO. 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
« no previous file with comments | « ui/gl/gl_image_native_pixmap.cc ('k') | ui/ozone/platform/drm/common/drm_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..abd8aa2f839109f7d3536639e88ed7c9325620ed 100644
--- a/ui/gl/test/gl_image_test_support.cc
+++ b/ui/gl/test/gl_image_test_support.cc
@@ -60,6 +60,15 @@ void GLImageTestSupport::SetBufferDataToColor(int width,
memset(&data[y * stride], color[0], width);
}
return;
+ case gfx::BufferFormat::R_16:
+ DCHECK_EQ(0, plane);
+ 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] = static_cast<uint16_t>(color[0] << 8);
+ }
+ }
+ return;
case gfx::BufferFormat::BGR_565:
DCHECK_EQ(0, plane);
for (int y = 0; y < height; ++y) {
« no previous file with comments | « ui/gl/gl_image_native_pixmap.cc ('k') | ui/ozone/platform/drm/common/drm_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698