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

Unified Diff: ui/gl/gl_image_io_surface.mm

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/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..c9fabee5a262ca1981680274e241c27770d08fbe 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:
Ken Russell (switch to Gerrit) 2017/06/09 22:37:39 Note: I checked CGLIOSurface.h and confirmed that
riju_ 2017/06/13 15:34:14 Thanks, I am doing the check here-> https://codere
Ken Russell (switch to Gerrit) 2017/06/13 23:52:36 Thanks. Reviewed that other change; it isn't neces
riju_ 2017/06/14 07:14:46 Acknowledged.
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:
@@ -140,6 +146,8 @@ GLenum DataType(gfx::BufferFormat format) {
case gfx::BufferFormat::R_8:
case gfx::BufferFormat::RG_88:
return GL_UNSIGNED_BYTE;
+ case gfx::BufferFormat::R_16:
+ return GL_UNSIGNED_SHORT;
case gfx::BufferFormat::BGRA_8888:
case gfx::BufferFormat::BGRX_8888:
case gfx::BufferFormat::RGBA_8888:

Powered by Google App Engine
This is Rietveld 408576698