diff options
author | bsalomon <bsalomon@google.com> | 2015-11-22 14:51:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-22 14:51:00 -0800 |
commit | 7ea33f5e1ae9eb1fb1e7377d6edf6acdcf71d103 (patch) | |
tree | 92aa7841b61ab93ec8a95d834e309ae0d2cf04e8 /src/gpu/gl/GrGLCaps.cpp | |
parent | de3aac8cea8a7113f31591e6e02c51fe0ac45280 (diff) |
Initial version of external_oes texture support and unit test
Committed: https://skia.googlesource.com/skia/+/27a048700778d4cebfc23301d1780649791b0e03
Review URL: https://codereview.chromium.org/1451683002
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 28401fe9e6..a768b37105 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -46,6 +46,7 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions, fUseNonVBOVertexAndIndexDynamicData = false; fIsCoreProfile = false; fBindFragDataLocationSupport = false; + fExternalTextureSupport = false; fSRGBWriteControl = false; fRGBA8888PixelsOpsAreSlow = false; fPartialFBOReadIsSlow = false; @@ -259,6 +260,16 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, fBindUniformLocationSupport = false; #endif + if (ctxInfo.hasExtension("GL_OES_EGL_image_external")) { + if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { + fExternalTextureSupport = true; + } else if (ctxInfo.hasExtension("GL_OES_EGL_image_external_essl3") || + ctxInfo.hasExtension("OES_EGL_image_external_essl3")) { + // At least one driver has been found that has this extension without the "GL_" prefix. + fExternalTextureSupport = true; + } + } + #ifdef SK_BUILD_FOR_WIN // We're assuming that on Windows Chromium we're using ANGLE. bool isANGLE = kANGLE_GrGLDriver == ctxInfo.driver() || @@ -588,13 +599,21 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { glslCaps->fSecondaryOutputExtensionString = "GL_EXT_blend_func_extended"; } + if (fExternalTextureSupport) { + if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) { + glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external"; + } else { + glslCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3"; + } + } + // The Tegra3 compiler will sometimes never return if we have min(abs(x), 1.0), so we must do // the abs first in a separate expression. if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { glslCaps->fCanUseMinAndAbsTogether = false; } - // On Intel GPU there is an issue where it reads the second arguement to atan "- %s.x" as an int + // On Intel GPU there is an issue where it reads the second argument to atan "- %s.x" as an int // thus must us -1.0 * %s.x to work correctly if (kIntel_GrGLVendor == ctxInfo.vendor()) { glslCaps->fMustForceNegatedAtanParamToFloat = true; |