aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Weiliang Chen <weiliangc@chromium.org>2018-05-30 15:07:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-30 20:04:48 +0000
commit00f8866a321332f07520e3c12963aa1332bb7e82 (patch)
tree30d1f602aea7172654f40b32ed44f5442580d9ab
parent331c266ed716526478a10885aff66181cec64486 (diff)
Check for ANGLE's implementation of texture_rectangle
ANGLE has implemented extension to support for texture_rectangle. Check for its existence as well as GL_ARB_texture_rectangle extension. Intended to follow up on Chrome side to avoid copy into texture 2d for PaintCanvasVideoRenderer. Bug: skia:7903 Change-Id: I450aa7fcd08628831251a9e142fd50719723282d Reviewed-on: https://skia-review.googlesource.com/130962 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Weiliang Chen <weiliangc@chromium.org>
-rw-r--r--gm/rectangletexture.cpp3
-rw-r--r--src/gpu/gl/GrGLCaps.cpp5
-rw-r--r--src/gpu/gl/GrGLDefines.h2
-rw-r--r--tools/gpu/gl/GLTestContext.cpp3
4 files changed, 7 insertions, 6 deletions
diff --git a/gm/rectangletexture.cpp b/gm/rectangletexture.cpp
index 1ce915bf52..13e4e79bef 100644
--- a/gm/rectangletexture.cpp
+++ b/gm/rectangletexture.cpp
@@ -72,7 +72,8 @@ protected:
}
if (!(kGL_GrGLStandard == glCtx->standard() && glCtx->version() >= GR_GL_VER(3, 1)) &&
- !glCtx->hasExtension("GL_ARB_texture_rectangle")) {
+ !(glCtx->hasExtension("GL_ARB_texture_rectangle") ||
+ glCtx->hasExtension("GL_ANGLE_texture_rectangle"))) {
return nullptr;
}
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 4660cdaf53..22f248b70a 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -221,7 +221,8 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fBindUniformLocationSupport = ctxInfo.hasExtension("GL_CHROMIUM_bind_uniform_location");
if (kGL_GrGLStandard == standard) {
- if (version >= GR_GL_VER(3, 1) || ctxInfo.hasExtension("GL_ARB_texture_rectangle")) {
+ if (version >= GR_GL_VER(3, 1) || ctxInfo.hasExtension("GL_ARB_texture_rectangle") ||
+ ctxInfo.hasExtension("GL_ANGLE_texture_rectangle")) {
// We also require textureSize() support for rectangle 2D samplers which was added in
// GLSL 1.40.
if (ctxInfo.glslGeneration() >= k140_GrGLSLGeneration) {
@@ -2921,5 +2922,3 @@ bool GrGLCaps::getConfigFromBackendFormat(const GrBackendFormat& format, SkColor
}
return validate_sized_format(*glFormat, ct, config, fStandard);
}
-
-
diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h
index 645397316b..2c829835e6 100644
--- a/src/gpu/gl/GrGLDefines.h
+++ b/src/gpu/gl/GrGLDefines.h
@@ -1042,7 +1042,7 @@
/* GL_OES_EGL_image_external */
#define GR_GL_TEXTURE_EXTERNAL 0x8D65
-/* GL_ARB_texture_rectangle */
+/* GL_ARB_texture_rectangle or GL_ANGLE_texture_rectangle */
#define GR_GL_TEXTURE_RECTANGLE 0x84F5
/* GL_EXT_window_rectangles */
diff --git a/tools/gpu/gl/GLTestContext.cpp b/tools/gpu/gl/GLTestContext.cpp
index 7a67a8a969..6a80707132 100644
--- a/tools/gpu/gl/GLTestContext.cpp
+++ b/tools/gpu/gl/GLTestContext.cpp
@@ -318,7 +318,8 @@ GrGLint GLTestContext::createTextureRectangle(int width, int height, GrGLenum in
GrGLenum externalFormat, GrGLenum externalType,
GrGLvoid* data) {
if (!(kGL_GrGLStandard == fGL->fStandard && GrGLGetVersion(fGL.get()) >= GR_GL_VER(3, 1)) &&
- !fGL->fExtensions.has("GL_ARB_texture_rectangle")) {
+ !(fGL->fExtensions.has("GL_ARB_texture_rectangle") ||
+ fGL->fExtensions.has("GL_ANGLE_texture_rectangle"))) {
return 0;
}