Bug 1229946 - report GL_ARB_texture_rg extension to SkiaGL to avoid using GL_ALPHA render targets. r=jgilbert
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -100,16 +100,17 @@ static const char *const sExtensionNames
"GL_ARB_robustness",
"GL_ARB_sampler_objects",
"GL_ARB_seamless_cube_map",
"GL_ARB_sync",
"GL_ARB_texture_compression",
"GL_ARB_texture_float",
"GL_ARB_texture_non_power_of_two",
"GL_ARB_texture_rectangle",
+ "GL_ARB_texture_rg",
"GL_ARB_texture_storage",
"GL_ARB_texture_swizzle",
"GL_ARB_timer_query",
"GL_ARB_transform_feedback2",
"GL_ARB_uniform_buffer_object",
"GL_ARB_vertex_array_object",
"GL_EXT_bgra",
"GL_EXT_blend_minmax",
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -133,16 +133,17 @@ enum class GLFeature {
texture_3D,
texture_3D_compressed,
texture_3D_copy,
texture_float,
texture_float_linear,
texture_half_float,
texture_half_float_linear,
texture_non_power_of_two,
+ texture_rg,
texture_storage,
texture_swizzle,
transform_feedback2,
uniform_buffer_object,
uniform_matrix_nonsquare,
vertex_array_object,
EnumMax
};
@@ -422,16 +423,17 @@ public:
ARB_robustness,
ARB_sampler_objects,
ARB_seamless_cube_map,
ARB_sync,
ARB_texture_compression,
ARB_texture_float,
ARB_texture_non_power_of_two,
ARB_texture_rectangle,
+ ARB_texture_rg,
ARB_texture_storage,
ARB_texture_swizzle,
ARB_timer_query,
ARB_transform_feedback2,
ARB_uniform_buffer_object,
ARB_vertex_array_object,
EXT_bgra,
EXT_blend_minmax,
--- a/gfx/gl/GLContextFeatures.cpp
+++ b/gfx/gl/GLContextFeatures.cpp
@@ -686,16 +686,25 @@ static const FeatureInfo sFeatureInfoArr
GLContext::Extension_None,
{
GLContext::ARB_texture_non_power_of_two,
GLContext::OES_texture_npot,
GLContext::Extensions_End
}
},
{
+ "texture_rg",
+ GLVersion::GL3,
+ GLESVersion::ES3,
+ GLContext::ARB_texture_rg,
+ {
+ GLContext::Extensions_End
+ }
+ },
+ {
"texture_storage",
GLVersion::GL4_2,
GLESVersion::ES3,
GLContext::ARB_texture_storage,
{
/*
* Not including GL_EXT_texture_storage here because it
* doesn't guarantee glTexStorage3D, which is required for
--- a/gfx/gl/SkiaGLGlue.cpp
+++ b/gfx/gl/SkiaGLGlue.cpp
@@ -366,16 +366,20 @@ const GLubyte* glGetString_mozilla(GrGLe
strcat(extensionsString, "GL_OES_standard_derivatives ");
}
} else {
if (sGLContext.get()->IsSupported(GLFeature::framebuffer_object)) {
strcat(extensionsString, "GL_ARB_framebuffer_object ");
} else if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_framebuffer_object)) {
strcat(extensionsString, "GL_EXT_framebuffer_object ");
}
+
+ if (sGLContext.get()->IsSupported(GLFeature::texture_rg)) {
+ strcat(extensionsString, "GL_ARB_texture_rg ");
+ }
}
if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_texture_format_BGRA8888)) {
strcat(extensionsString, "GL_EXT_texture_format_BGRA8888 ");
}
if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_packed_depth_stencil)) {
strcat(extensionsString, "GL_EXT_packed_depth_stencil ");