diff options
| author | 2018-01-17 13:18:27 -0800 | |
|---|---|---|
| committer | 2018-01-17 13:18:27 -0800 | |
| commit | 62b22cb0915e5cf79e8181bf812a133ca6b9d2b3 (patch) | |
| tree | cda5f325d4e40ba3fc9058386bd09ca05203cd96 | |
| parent | 3fb6ea960f2cfd859c0c8207e5e5a470cb512a28 (diff) | |
[GLUtils] Use GL_* types for FP16 bitmap.
This patch makes sure getInternalFormat() returns GL_RGBA16F for FP16 bitmap,
getType() should return GL_HALF_FLOAT per spec
https://www.khronos.org/registry/OpenGL/extensions/OES/OES_vertex_half_float.txt,
finally, make sure checkFormat should enforce the correct format and type.
BUG: 72065799
Test: none
Change-Id: I63e79e11b1668b455e64ce20c6db806a1179fb6c
| -rw-r--r-- | core/jni/android/opengl/util.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp index 1676d4b91e3d..f3aeb32f3f86 100644 --- a/core/jni/android/opengl/util.cpp +++ b/core/jni/android/opengl/util.cpp @@ -27,6 +27,7 @@ #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> +#include <GLES3/gl3.h> #include <ETC1/etc1.h> #include <SkBitmap.h> @@ -641,7 +642,7 @@ static int checkFormat(SkColorType colorType, int format, int type) } break; case kRGBA_F16_SkColorType: - if (type == GL_HALF_FLOAT_OES && format == PIXEL_FORMAT_RGBA_FP16) + if (type == GL_HALF_FLOAT && format == GL_RGBA16F) return 0; break; default: @@ -662,7 +663,7 @@ static int getInternalFormat(SkColorType colorType) case kRGB_565_SkColorType: return GL_RGB; case kRGBA_F16_SkColorType: - return PIXEL_FORMAT_RGBA_FP16; + return GL_RGBA16F; default: return -1; } @@ -680,7 +681,7 @@ static int getType(SkColorType colorType) case kRGB_565_SkColorType: return GL_UNSIGNED_SHORT_5_6_5; case kRGBA_F16_SkColorType: - return GL_HALF_FLOAT_OES; + return GL_HALF_FLOAT; default: return -1; } |