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

Unified Diff: ui/gl/gl_image_memory.cc

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_memory.cc
diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc
index 20e694ff2fc322d622370749b3d97c5345492f67..0b15f822e5850bc50f4ee1fc5c9398f0d7325eea 100644
--- a/ui/gl/gl_image_memory.cc
+++ b/ui/gl/gl_image_memory.cc
@@ -45,6 +45,7 @@ bool ValidFormat(gfx::BufferFormat format) {
case gfx::BufferFormat::DXT5:
case gfx::BufferFormat::ETC1:
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_4444:
@@ -73,6 +74,7 @@ bool IsCompressedFormat(gfx::BufferFormat format) {
case gfx::BufferFormat::ETC1:
return true;
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_4444:
@@ -107,6 +109,8 @@ GLenum TextureFormat(gfx::BufferFormat format) {
return GL_ETC1_RGB8_OES;
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::RGBA_4444:
@@ -142,6 +146,7 @@ GLenum DataFormat(gfx::BufferFormat format) {
case gfx::BufferFormat::BGRA_8888:
case gfx::BufferFormat::RGBA_F16:
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::ATC:
case gfx::BufferFormat::ATCIA:
@@ -171,6 +176,7 @@ GLenum DataType(gfx::BufferFormat format) {
case gfx::BufferFormat::BGRX_8888:
case gfx::BufferFormat::BGRA_8888:
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::R_16:
aleksandar.stojiljkovic 2017/06/08 14:27:56 GL_UNSIGNED_SHORT
riju_ 2017/06/09 08:20:10 Done.
case gfx::BufferFormat::RG_88:
return GL_UNSIGNED_BYTE;
case gfx::BufferFormat::RGBA_F16:
@@ -206,6 +212,8 @@ GLint DataRowLength(size_t stride, gfx::BufferFormat format) {
return base::checked_cast<GLint>(stride) / 8;
case gfx::BufferFormat::R_8:
return base::checked_cast<GLint>(stride);
+ case gfx::BufferFormat::R_16:
+ return base::checked_cast<GLint>(stride);
aleksandar.stojiljkovic 2017/06/08 14:27:56 return base::checked_cast<GLint>(stride) => return
riju_ 2017/06/09 08:20:10 Done.
case gfx::BufferFormat::ATC:
case gfx::BufferFormat::ATCIA:
case gfx::BufferFormat::DXT1:
@@ -319,6 +327,7 @@ std::unique_ptr<uint8_t[]> GLES2Data(const gfx::Size& size,
case gfx::BufferFormat::BGRA_8888:
case gfx::BufferFormat::RGBA_F16:
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88: {
size_t gles2_data_stride =
RowSizeForBufferFormat(size.width(), format, 0);

Powered by Google App Engine
This is Rietveld 408576698