diff options
author | android-autoroll <android-autoroll@skia-corp.google.com.iam.gserviceaccount.com> | 2023-04-14 15:36:52 +0000 |
---|---|---|
committer | android-autoroll <android-autoroll@skia-corp.google.com.iam.gserviceaccount.com> | 2023-04-14 15:36:52 +0000 |
commit | f59a0a1e1451b660d650757f655d3bf942268826 (patch) | |
tree | c84f2feb5b682ccd35d71858904bf1507dc6b499 | |
parent | 3ace9b2024d5b55a081f8b7ae6df909f8b241fbb (diff) | |
parent | ab77e0fbc0c93351f316e8b1e5a525bd3ea58349 (diff) | |
download | skia-f59a0a1e1451b660d650757f655d3bf942268826.tar.gz |
RESTRICT AUTOMERGE Roll Skia from 0506208ca0e5 to ab77e0fbc0c9 (1 revision)
https://skia.googlesource.com/skia.git/+log/0506208ca0e5..ab77e0fbc0c9
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://skia-autoroll.corp.goog/r/android-u-release-autoroll
Please CC nscobie@google.com,rmistry@google.com,scroggo@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Test: Presubmit checks will test this change.
Exempt-From-Owner-Approval: The autoroll bot does not require owner approval.
Bug: b/186777432
Change-Id: I4d90f97cee3f0f9761cfd88c37b155db62c0edd8
-rw-r--r-- | src/gpu/ganesh/gl/GrGLCaps.cpp | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/src/gpu/ganesh/gl/GrGLCaps.cpp b/src/gpu/ganesh/gl/GrGLCaps.cpp index 63f1ad130b..68e3075fc7 100644 --- a/src/gpu/ganesh/gl/GrGLCaps.cpp +++ b/src/gpu/ganesh/gl/GrGLCaps.cpp @@ -1777,6 +1777,24 @@ void GrGLCaps::initFormatTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa } } + // Do we support the lumincance and luminance_alpha formats + bool lum8Supported = false; + bool lum8SizedFormatSupported = false; + if (GR_IS_GR_GL(standard) && !fIsCoreProfile) { + lum8Supported = true; + lum8SizedFormatSupported = true; + } else if (GR_IS_GR_GL_ES(standard)) { + lum8Supported = true; + // Even on ES3 this extension is required to define LUMINANCE8. GL_LUMINANCE8 is not a + // valid internal format for TexImage2D so we need to be using texture storage to use + // it. Even though we check the extension for texture storage here, we also check to see + // if texStorageSupported may have been disabled for a workaround. + lum8SizedFormatSupported = + texStorageSupported && ctxInfo.hasExtension("GL_EXT_texture_storage"); + } else if (GR_IS_GR_WEBGL(standard)) { + lum8Supported = true; + } + // Format: LUMINANCE8 { FormatInfo& info = this->getFormatInfo(GrGLFormat::kLUMINANCE8); @@ -1785,18 +1803,7 @@ void GrGLCaps::initFormatTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa info.fDefaultExternalFormat = GR_GL_LUMINANCE; info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE; info.fDefaultColorType = GrColorType::kGray_8; - bool lum8Supported = false; - bool lum8SizedFormatSupported = false; - if (GR_IS_GR_GL(standard) && !fIsCoreProfile) { - lum8Supported = true; - lum8SizedFormatSupported = true; - } else if (GR_IS_GR_GL_ES(standard)) { - lum8Supported = true; - // Even on ES3 this extension is required to define LUMINANCE8. - lum8SizedFormatSupported = ctxInfo.hasExtension("GL_EXT_texture_storage"); - } else if (GR_IS_GR_WEBGL(standard)) { - lum8Supported = true; - } + if (lum8Supported) { info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag; } @@ -1865,32 +1872,20 @@ void GrGLCaps::initFormatTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa info.fDefaultExternalFormat = GR_GL_LUMINANCE_ALPHA; info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE; info.fDefaultColorType = GrColorType::kGrayAlpha_88; - bool la8Supported = false; - bool la8SizedFormatSupported = false; - if (GR_IS_GR_GL(standard) && !fIsCoreProfile) { - la8Supported = true; - la8SizedFormatSupported = true; - } else if (GR_IS_GR_GL_ES(standard)) { - la8Supported = true; - // Even on ES3 this extension is required to define LUMINANCE8_ALPHA8. - la8SizedFormatSupported = ctxInfo.hasExtension("GL_EXT_texture_storage"); - } else if (GR_IS_GR_WEBGL(standard)) { - la8Supported = true; - } - if (la8Supported) { + if (lum8Supported) { info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag; } - if (texStorageSupported && la8SizedFormatSupported) { + if (texStorageSupported && lum8SizedFormatSupported) { info.fFlags |= FormatInfo::kUseTexStorage_Flag; info.fInternalFormatForTexImageOrStorage = GR_GL_LUMINANCE8_ALPHA8; - } else if (texImageSupportsSizedInternalFormat && la8SizedFormatSupported) { + } else if (texImageSupportsSizedInternalFormat && lum8SizedFormatSupported) { info.fInternalFormatForTexImageOrStorage = GR_GL_LUMINANCE8_ALPHA8; } else { info.fInternalFormatForTexImageOrStorage = GR_GL_LUMINANCE_ALPHA; } // See note in LUMINANCE8 section about not attaching to framebuffers. - if (la8Supported) { + if (lum8Supported) { info.fColorTypeInfoCount = 1; info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount); int ctIdx = 0; |