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

Unified Diff: ui/gl/gl_image_io_surface.mm

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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/gl_image_io_surface.mm
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
index fc4df49f478ff007cbbfd681ce8c63cd8493582d..c32b75d2124b8b15ea2569fabc1f83784fe9989c 100644
--- a/ui/gl/gl_image_io_surface.mm
+++ b/ui/gl/gl_image_io_surface.mm
@@ -32,6 +32,7 @@ namespace {
bool ValidInternalFormat(unsigned internalformat) {
switch (internalformat) {
case GL_RED:
+ case GL_R16_EXT:
case GL_RG:
case GL_BGRA_EXT:
case GL_RGB:
@@ -54,6 +55,7 @@ bool ValidFormat(gfx::BufferFormat format) {
case gfx::BufferFormat::UYVY_422:
case gfx::BufferFormat::YUV_420_BIPLANAR:
return true;
+ case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::ATC:
case gfx::BufferFormat::ATCIA:
@@ -75,6 +77,8 @@ GLenum TextureFormat(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
return GL_RED;
+ case gfx::BufferFormat::R_16:
+ return GL_R16_EXT;
case gfx::BufferFormat::RG_88:
return GL_RG;
case gfx::BufferFormat::BGRA_8888:
@@ -107,6 +111,8 @@ GLenum DataFormat(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
return GL_RED;
+ case gfx::BufferFormat::R_16:
+ return GL_R16_EXT;
case gfx::BufferFormat::RG_88:
return GL_RG;
case gfx::BufferFormat::BGRA_8888:
@@ -138,6 +144,7 @@ GLenum DataFormat(gfx::BufferFormat format) {
GLenum DataType(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::R_16:
aleksandar.stojiljkovic 2017/06/08 14:27:56 should return GL_UNSIGNED_SHORT
riju_ 2017/06/09 08:20:10 Done.
case gfx::BufferFormat::RG_88:
return GL_UNSIGNED_BYTE;
case gfx::BufferFormat::BGRA_8888:

Powered by Google App Engine
This is Rietveld 408576698