diff options
author | Brian Osman <brianosman@google.com> | 2018-03-02 11:01:10 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-02 18:19:50 +0000 |
commit | 10fc6fddf24878f4f34e75c1bcc11e4499edfcc0 (patch) | |
tree | b3bd1d9263dbcf53c688d412e1e719fa97674b23 /src/gpu/gl | |
parent | fde6fa0903b3cedc463c1a753268ffcf30ad7a38 (diff) |
Revert "Revert "Add 1010102 support to Ganesh""
This reverts commit ded47a50143470d1acdafa03e878cc7da5608038.
Bug: skia:
Change-Id: I7d7552e6ccc8591cae91426407ab13b628b93b68
Reviewed-on: https://skia-review.googlesource.com/111760
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 24 | ||||
-rw-r--r-- | src/gpu/gl/GrGLDefines.h | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 1 | ||||
-rw-r--r-- | src/gpu/gl/GrGLUtil.cpp | 2 |
4 files changed, 28 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index e70cb9d25b..ad3cfeaa66 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -1611,6 +1611,25 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions, } fConfigTable[kRGBA_4444_GrPixelConfig].fSwizzle = GrSwizzle::RGBA(); + fConfigTable[kRGBA_1010102_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL_RGBA; + fConfigTable[kRGBA_1010102_GrPixelConfig].fFormats.fSizedInternalFormat = GR_GL_RGB10_A2; + fConfigTable[kRGBA_1010102_GrPixelConfig].fFormats.fExternalFormat[kOther_ExternalFormatUsage] = + GR_GL_RGBA; + fConfigTable[kRGBA_1010102_GrPixelConfig].fFormats.fExternalType = + GR_GL_UNSIGNED_INT_2_10_10_10_REV; + fConfigTable[kRGBA_1010102_GrPixelConfig].fFormatType = kNormalizedFixedPoint_FormatType; + if (kGL_GrGLStandard == standard || version >= GR_GL_VER(3, 0)) { + fConfigTable[kRGBA_1010102_GrPixelConfig].fFlags = ConfigInfo::kTextureable_Flag | + allRenderFlags; + } + if (texStorageSupported) { + fConfigTable[kRGBA_1010102_GrPixelConfig].fFlags |= ConfigInfo::kCanUseTexStorage_Flag; + } + if (texelBufferSupport) { + fConfigTable[kRGBA_1010102_GrPixelConfig].fFlags |= ConfigInfo::kCanUseWithTexelBuffer_Flag; + } + fConfigTable[kRGBA_1010102_GrPixelConfig].fSwizzle = GrSwizzle::RGBA(); + bool alpha8IsValidForGL = kGL_GrGLStandard == standard && (!fIsCoreProfile || version <= GR_GL_VER(3, 0)); @@ -2519,7 +2538,10 @@ bool validate_sized_format(GrGLenum format, SkColorType ct, GrPixelConfig* confi } break; case kRGBA_1010102_SkColorType: - return false; + if (GR_GL_RGB10_A2 == format) { + *config = kRGBA_1010102_GrPixelConfig; + } + break; case kRGB_101010x_SkColorType: return false; case kGray_8_SkColorType: diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h index 9da060b412..e5e74eb68e 100644 --- a/src/gpu/gl/GrGLDefines.h +++ b/src/gpu/gl/GrGLDefines.h @@ -508,6 +508,7 @@ #define GR_GL_RGBA4 0x8056 #define GR_GL_RGB5_A1 0x8057 #define GR_GL_RGBA8 0x8058 +#define GR_GL_RGB10_A2 0x8059 #define GR_GL_SRGB8_ALPHA8 0x8C43 #define GR_GL_RGBA16F 0x881A #define GR_GL_RGBA32F 0x8814 @@ -529,6 +530,7 @@ #define GR_GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GR_GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GR_GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GR_GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 /* Shaders */ #define GR_GL_FRAGMENT_SHADER 0x8B30 diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index af7c4706d3..a571f5a81e 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -800,6 +800,7 @@ static inline GrGLint config_alignment(GrPixelConfig config) { case kBGRA_8888_GrPixelConfig: case kSRGBA_8888_GrPixelConfig: case kSBGRA_8888_GrPixelConfig: + case kRGBA_1010102_GrPixelConfig: case kRGBA_float_GrPixelConfig: case kRG_float_GrPixelConfig: return 4; diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp index 791d9ecfcb..6b44402c1b 100644 --- a/src/gpu/gl/GrGLUtil.cpp +++ b/src/gpu/gl/GrGLUtil.cpp @@ -504,6 +504,8 @@ GrPixelConfig GrGLSizedFormatToPixelConfig(GrGLenum sizedFormat) { return kRGB_565_GrPixelConfig; case GR_GL_RGBA4: return kRGBA_4444_GrPixelConfig; + case GR_GL_RGB10_A2: + return kRGBA_1010102_GrPixelConfig; case GR_GL_LUMINANCE8: return kGray_8_GrPixelConfig; case GR_GL_RGBA32F: |