Bug 987828 - 3/4 - Use IsGLES instead of IsGLES2 - r=jgilbert

This commit is contained in:
Benoit Jacob 2014-03-31 05:10:49 -04:00
Родитель 8bc46df497
Коммит dcf7236aab
14 изменённых файлов: 53 добавлений и 53 удалений

Просмотреть файл

@ -60,7 +60,7 @@ WebGLContext::CreateQuery()
if (IsContextLost()) if (IsContextLost())
return nullptr; return nullptr;
if (mActiveOcclusionQuery && !gl->IsGLES2()) { if (mActiveOcclusionQuery && !gl->IsGLES()) {
/* http://www.opengl.org/registry/specs/ARB/occlusion_query.txt /* http://www.opengl.org/registry/specs/ARB/occlusion_query.txt
* Calling either GenQueriesARB or DeleteQueriesARB while any query of * Calling either GenQueriesARB or DeleteQueriesARB while any query of
* any target is active causes an INVALID_OPERATION error to be * any target is active causes an INVALID_OPERATION error to be
@ -95,7 +95,7 @@ WebGLContext::DeleteQuery(WebGLQuery *query)
EndQuery(query->mType); EndQuery(query->mType);
} }
if (mActiveOcclusionQuery && !gl->IsGLES2()) { if (mActiveOcclusionQuery && !gl->IsGLES()) {
/* http://www.opengl.org/registry/specs/ARB/occlusion_query.txt /* http://www.opengl.org/registry/specs/ARB/occlusion_query.txt
* Calling either GenQueriesARB or DeleteQueriesARB while any query of * Calling either GenQueriesARB or DeleteQueriesARB while any query of
* any target is active causes an INVALID_OPERATION error to be * any target is active causes an INVALID_OPERATION error to be

Просмотреть файл

@ -460,7 +460,7 @@ WebGLContext::WhatDoesVertexAttrib0Need()
} }
#endif #endif
if (MOZ_LIKELY(gl->IsGLES2() || if (MOZ_LIKELY(gl->IsGLES() ||
mBoundVertexArray->IsAttribArrayEnabled(0))) mBoundVertexArray->IsAttribArrayEnabled(0)))
{ {
return WebGLVertexAttrib0Status::Default; return WebGLVertexAttrib0Status::Default;

Просмотреть файл

@ -2348,14 +2348,14 @@ WebGLContext::RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei
case LOCAL_GL_RGBA4: case LOCAL_GL_RGBA4:
case LOCAL_GL_RGB5_A1: case LOCAL_GL_RGB5_A1:
// 16-bit RGBA formats are not supported on desktop GL // 16-bit RGBA formats are not supported on desktop GL
if (!gl->IsGLES2()) internalformatForGL = LOCAL_GL_RGBA8; if (!gl->IsGLES()) internalformatForGL = LOCAL_GL_RGBA8;
break; break;
case LOCAL_GL_RGB565: case LOCAL_GL_RGB565:
// the RGB565 format is not supported on desktop GL // the RGB565 format is not supported on desktop GL
if (!gl->IsGLES2()) internalformatForGL = LOCAL_GL_RGB8; if (!gl->IsGLES()) internalformatForGL = LOCAL_GL_RGB8;
break; break;
case LOCAL_GL_DEPTH_COMPONENT16: case LOCAL_GL_DEPTH_COMPONENT16:
if (!gl->IsGLES2() || gl->IsExtensionSupported(gl::GLContext::OES_depth24)) if (!gl->IsGLES() || gl->IsExtensionSupported(gl::GLContext::OES_depth24))
internalformatForGL = LOCAL_GL_DEPTH_COMPONENT24; internalformatForGL = LOCAL_GL_DEPTH_COMPONENT24;
else if (gl->IsExtensionSupported(gl::GLContext::OES_packed_depth_stencil)) else if (gl->IsExtensionSupported(gl::GLContext::OES_packed_depth_stencil))
internalformatForGL = LOCAL_GL_DEPTH24_STENCIL8; internalformatForGL = LOCAL_GL_DEPTH24_STENCIL8;
@ -2956,7 +2956,7 @@ WebGLContext::CompileShader(WebGLShader *shader)
MakeContextCurrent(); MakeContextCurrent();
ShShaderOutput targetShaderSourceLanguage = gl->IsGLES2() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT; ShShaderOutput targetShaderSourceLanguage = gl->IsGLES() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT;
bool useShaderSourceTranslation = true; bool useShaderSourceTranslation = true;
if (shader->NeedsTranslation() && mShaderValidation) { if (shader->NeedsTranslation() && mShaderValidation) {
@ -3526,7 +3526,7 @@ GLenum WebGLContext::CheckedTexImage2D(GLenum target,
// convert type for half float if not on GLES2 // convert type for half float if not on GLES2
GLenum realType = type; GLenum realType = type;
if (realType == LOCAL_GL_HALF_FLOAT_OES && !gl->IsGLES2()) { if (realType == LOCAL_GL_HALF_FLOAT_OES && !gl->IsGLES()) {
realType = LOCAL_GL_HALF_FLOAT; realType = LOCAL_GL_HALF_FLOAT;
} }
@ -3608,7 +3608,7 @@ WebGLContext::TexImage2D_base(GLenum target, GLint level, GLenum internalformat,
// Handle ES2 and GL differences in floating point internal formats. Note that // Handle ES2 and GL differences in floating point internal formats. Note that
// format == internalformat, as checked above and as required by ES. // format == internalformat, as checked above and as required by ES.
internalformat = InternalFormatForFormatAndType(format, type, gl->IsGLES2()); internalformat = InternalFormatForFormatAndType(format, type, gl->IsGLES());
// Handle ES2 and GL differences when supporting sRGB internal formats. GL ES // Handle ES2 and GL differences when supporting sRGB internal formats. GL ES
// requires that format == internalformat, but GL will fail in this case. // requires that format == internalformat, but GL will fail in this case.
@ -3616,7 +3616,7 @@ WebGLContext::TexImage2D_base(GLenum target, GLint level, GLenum internalformat,
// format -> internalformat // format -> internalformat
// GL_RGB GL_SRGB_EXT // GL_RGB GL_SRGB_EXT
// GL_RGBA GL_SRGB_ALPHA_EXT // GL_RGBA GL_SRGB_ALPHA_EXT
if (!gl->IsGLES2()) { if (!gl->IsGLES()) {
switch (internalformat) { switch (internalformat) {
case LOCAL_GL_SRGB_EXT: case LOCAL_GL_SRGB_EXT:
format = LOCAL_GL_RGB; format = LOCAL_GL_RGB;

Просмотреть файл

@ -1631,7 +1631,7 @@ WebGLContext::InitAndValidateGL()
MakeContextCurrent(); MakeContextCurrent();
// on desktop OpenGL, we always keep vertex attrib 0 array enabled // on desktop OpenGL, we always keep vertex attrib 0 array enabled
if (!gl->IsGLES2()) { if (!gl->IsGLES()) {
gl->fEnableVertexAttribArray(0); gl->fEnableVertexAttribArray(0);
} }
@ -1729,7 +1729,7 @@ WebGLContext::InitAndValidateGL()
// Always 1 for GLES2 // Always 1 for GLES2
mMaxFramebufferColorAttachments = 1; mMaxFramebufferColorAttachments = 1;
if (!gl->IsGLES2()) { if (!gl->IsGLES()) {
// gl_PointSize is always available in ES2 GLSL, but has to be // gl_PointSize is always available in ES2 GLSL, but has to be
// specifically enabled on desktop GLSL. // specifically enabled on desktop GLSL.
gl->fEnable(LOCAL_GL_VERTEX_PROGRAM_POINT_SIZE); gl->fEnable(LOCAL_GL_VERTEX_PROGRAM_POINT_SIZE);

Просмотреть файл

@ -35,7 +35,7 @@ WebGLContext::VertexAttrib1f(GLuint index, GLfloat x0)
mVertexAttrib0Vector[1] = 0; mVertexAttrib0Vector[1] = 0;
mVertexAttrib0Vector[2] = 0; mVertexAttrib0Vector[2] = 0;
mVertexAttrib0Vector[3] = 1; mVertexAttrib0Vector[3] = 1;
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib1f(index, x0); gl->fVertexAttrib1f(index, x0);
} }
} }
@ -55,7 +55,7 @@ WebGLContext::VertexAttrib2f(GLuint index, GLfloat x0, GLfloat x1)
mVertexAttrib0Vector[1] = x1; mVertexAttrib0Vector[1] = x1;
mVertexAttrib0Vector[2] = 0; mVertexAttrib0Vector[2] = 0;
mVertexAttrib0Vector[3] = 1; mVertexAttrib0Vector[3] = 1;
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib2f(index, x0, x1); gl->fVertexAttrib2f(index, x0, x1);
} }
} }
@ -75,7 +75,7 @@ WebGLContext::VertexAttrib3f(GLuint index, GLfloat x0, GLfloat x1, GLfloat x2)
mVertexAttrib0Vector[1] = x1; mVertexAttrib0Vector[1] = x1;
mVertexAttrib0Vector[2] = x2; mVertexAttrib0Vector[2] = x2;
mVertexAttrib0Vector[3] = 1; mVertexAttrib0Vector[3] = 1;
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib3f(index, x0, x1, x2); gl->fVertexAttrib3f(index, x0, x1, x2);
} }
} }
@ -96,7 +96,7 @@ WebGLContext::VertexAttrib4f(GLuint index, GLfloat x0, GLfloat x1,
mVertexAttrib0Vector[1] = x1; mVertexAttrib0Vector[1] = x1;
mVertexAttrib0Vector[2] = x2; mVertexAttrib0Vector[2] = x2;
mVertexAttrib0Vector[3] = x3; mVertexAttrib0Vector[3] = x3;
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib4f(index, x0, x1, x2, x3); gl->fVertexAttrib4f(index, x0, x1, x2, x3);
} }
} }
@ -117,7 +117,7 @@ WebGLContext::VertexAttrib1fv_base(GLuint idx, uint32_t arrayLength,
mVertexAttrib0Vector[1] = GLfloat(0); mVertexAttrib0Vector[1] = GLfloat(0);
mVertexAttrib0Vector[2] = GLfloat(0); mVertexAttrib0Vector[2] = GLfloat(0);
mVertexAttrib0Vector[3] = GLfloat(1); mVertexAttrib0Vector[3] = GLfloat(1);
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib1fv(idx, ptr); gl->fVertexAttrib1fv(idx, ptr);
} }
} }
@ -137,7 +137,7 @@ WebGLContext::VertexAttrib2fv_base(GLuint idx, uint32_t arrayLength,
mVertexAttrib0Vector[1] = ptr[1]; mVertexAttrib0Vector[1] = ptr[1];
mVertexAttrib0Vector[2] = GLfloat(0); mVertexAttrib0Vector[2] = GLfloat(0);
mVertexAttrib0Vector[3] = GLfloat(1); mVertexAttrib0Vector[3] = GLfloat(1);
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib2fv(idx, ptr); gl->fVertexAttrib2fv(idx, ptr);
} }
} }
@ -157,7 +157,7 @@ WebGLContext::VertexAttrib3fv_base(GLuint idx, uint32_t arrayLength,
mVertexAttrib0Vector[1] = ptr[1]; mVertexAttrib0Vector[1] = ptr[1];
mVertexAttrib0Vector[2] = ptr[2]; mVertexAttrib0Vector[2] = ptr[2];
mVertexAttrib0Vector[3] = GLfloat(1); mVertexAttrib0Vector[3] = GLfloat(1);
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib3fv(idx, ptr); gl->fVertexAttrib3fv(idx, ptr);
} }
} }
@ -177,7 +177,7 @@ WebGLContext::VertexAttrib4fv_base(GLuint idx, uint32_t arrayLength,
mVertexAttrib0Vector[1] = ptr[1]; mVertexAttrib0Vector[1] = ptr[1];
mVertexAttrib0Vector[2] = ptr[2]; mVertexAttrib0Vector[2] = ptr[2];
mVertexAttrib0Vector[3] = ptr[3]; mVertexAttrib0Vector[3] = ptr[3];
if (gl->IsGLES2()) if (gl->IsGLES())
gl->fVertexAttrib4fv(idx, ptr); gl->fVertexAttrib4fv(idx, ptr);
} }
} }
@ -211,7 +211,7 @@ WebGLContext::DisableVertexAttribArray(GLuint index)
MakeContextCurrent(); MakeContextCurrent();
InvalidateBufferFetching(); InvalidateBufferFetching();
if (index || gl->IsGLES2()) if (index || gl->IsGLES())
gl->fDisableVertexAttribArray(index); gl->fDisableVertexAttribArray(index);
MOZ_ASSERT(mBoundVertexArray->HasAttrib(index)); // should have been validated earlier MOZ_ASSERT(mBoundVertexArray->HasAttrib(index)); // should have been validated earlier

Просмотреть файл

@ -890,7 +890,7 @@ FinalizeDrawAndReadBuffers(GLContext* aGL, bool aColorBufferDefined)
// //
// Note that this test is not performed if OpenGL 4.2 or ARB_ES2_compatibility is // Note that this test is not performed if OpenGL 4.2 or ARB_ES2_compatibility is
// available. // available.
if (aGL->IsGLES2() || if (aGL->IsGLES() ||
aGL->IsSupported(GLFeature::ES2_compatibility) || aGL->IsSupported(GLFeature::ES2_compatibility) ||
aGL->IsAtLeast(ContextProfile::OpenGL, 420)) aGL->IsAtLeast(ContextProfile::OpenGL, 420))
{ {

Просмотреть файл

@ -16,7 +16,7 @@ using namespace mozilla::gl;
static GLenum static GLenum
DepthStencilDepthFormat(GLContext* gl) { DepthStencilDepthFormat(GLContext* gl) {
// We might not be able to get 24-bit, so let's pretend! // We might not be able to get 24-bit, so let's pretend!
if (gl->IsGLES2() && !gl->IsExtensionSupported(gl::GLContext::OES_depth24)) if (gl->IsGLES() && !gl->IsExtensionSupported(gl::GLContext::OES_depth24))
return LOCAL_GL_DEPTH_COMPONENT16; return LOCAL_GL_DEPTH_COMPONENT16;
return LOCAL_GL_DEPTH_COMPONENT24; return LOCAL_GL_DEPTH_COMPONENT24;

Просмотреть файл

@ -125,7 +125,7 @@ WebGLTexture::Bind(GLenum aTarget) {
// thanks to the WebKit people for finding this out: GL_TEXTURE_WRAP_R is not // thanks to the WebKit people for finding this out: GL_TEXTURE_WRAP_R is not
// present in GLES 2, but is present in GL and it seems as if for cube maps // present in GLES 2, but is present in GL and it seems as if for cube maps
// we need to set it to GL_CLAMP_TO_EDGE to get the expected GLES behavior. // we need to set it to GL_CLAMP_TO_EDGE to get the expected GLES behavior.
if (mTarget == LOCAL_GL_TEXTURE_CUBE_MAP && !mContext->gl->IsGLES2()) if (mTarget == LOCAL_GL_TEXTURE_CUBE_MAP && !mContext->gl->IsGLES())
mContext->gl->fTexParameteri(mTarget, LOCAL_GL_TEXTURE_WRAP_R, LOCAL_GL_CLAMP_TO_EDGE); mContext->gl->fTexParameteri(mTarget, LOCAL_GL_TEXTURE_WRAP_R, LOCAL_GL_CLAMP_TO_EDGE);
} }

Просмотреть файл

@ -484,7 +484,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
// Load OpenGL ES 2.0 symbols, or desktop if we aren't using ES 2. // Load OpenGL ES 2.0 symbols, or desktop if we aren't using ES 2.
if (mInitialized) { if (mInitialized) {
if (IsGLES2()) { if (IsGLES()) {
SymLoadStruct symbols_ES2[] = { SymLoadStruct symbols_ES2[] = {
{ (PRFuncPtr*) &mSymbols.fGetShaderPrecisionFormat, { "GetShaderPrecisionFormat", nullptr } }, { (PRFuncPtr*) &mSymbols.fGetShaderPrecisionFormat, { "GetShaderPrecisionFormat", nullptr } },
{ (PRFuncPtr*) &mSymbols.fClearDepthf, { "ClearDepthf", nullptr } }, { (PRFuncPtr*) &mSymbols.fClearDepthf, { "ClearDepthf", nullptr } },
@ -1338,7 +1338,7 @@ GLContext::ChooseGLFormats(const SurfaceCaps& caps) const
// If we're on ES2 hardware and we have an explicit request for 16 bits of color or less // If we're on ES2 hardware and we have an explicit request for 16 bits of color or less
// OR we don't support full 8-bit color, return a 4444 or 565 format. // OR we don't support full 8-bit color, return a 4444 or 565 format.
bool bpp16 = caps.bpp16; bool bpp16 = caps.bpp16;
if (IsGLES2()) { if (IsGLES()) {
if (!IsExtensionSupported(OES_rgb8_rgba8)) if (!IsExtensionSupported(OES_rgb8_rgba8))
bpp16 = true; bpp16 = true;
} else { } else {
@ -1348,7 +1348,7 @@ GLContext::ChooseGLFormats(const SurfaceCaps& caps) const
} }
if (bpp16) { if (bpp16) {
MOZ_ASSERT(IsGLES2()); MOZ_ASSERT(IsGLES());
if (caps.alpha) { if (caps.alpha) {
formats.color_texInternalFormat = LOCAL_GL_RGBA; formats.color_texInternalFormat = LOCAL_GL_RGBA;
formats.color_texFormat = LOCAL_GL_RGBA; formats.color_texFormat = LOCAL_GL_RGBA;
@ -1364,11 +1364,11 @@ GLContext::ChooseGLFormats(const SurfaceCaps& caps) const
formats.color_texType = LOCAL_GL_UNSIGNED_BYTE; formats.color_texType = LOCAL_GL_UNSIGNED_BYTE;
if (caps.alpha) { if (caps.alpha) {
formats.color_texInternalFormat = IsGLES2() ? LOCAL_GL_RGBA : LOCAL_GL_RGBA8; formats.color_texInternalFormat = IsGLES() ? LOCAL_GL_RGBA : LOCAL_GL_RGBA8;
formats.color_texFormat = LOCAL_GL_RGBA; formats.color_texFormat = LOCAL_GL_RGBA;
formats.color_rbFormat = LOCAL_GL_RGBA8; formats.color_rbFormat = LOCAL_GL_RGBA8;
} else { } else {
formats.color_texInternalFormat = IsGLES2() ? LOCAL_GL_RGB : LOCAL_GL_RGB8; formats.color_texInternalFormat = IsGLES() ? LOCAL_GL_RGB : LOCAL_GL_RGB8;
formats.color_texFormat = LOCAL_GL_RGB; formats.color_texFormat = LOCAL_GL_RGB;
formats.color_rbFormat = LOCAL_GL_RGB8; formats.color_rbFormat = LOCAL_GL_RGB8;
} }
@ -1387,12 +1387,12 @@ GLContext::ChooseGLFormats(const SurfaceCaps& caps) const
// Be clear that these are 0 if unavailable. // Be clear that these are 0 if unavailable.
formats.depthStencil = 0; formats.depthStencil = 0;
if (!IsGLES2() || IsExtensionSupported(OES_packed_depth_stencil)) { if (!IsGLES() || IsExtensionSupported(OES_packed_depth_stencil)) {
formats.depthStencil = LOCAL_GL_DEPTH24_STENCIL8; formats.depthStencil = LOCAL_GL_DEPTH24_STENCIL8;
} }
formats.depth = 0; formats.depth = 0;
if (IsGLES2()) { if (IsGLES()) {
if (IsExtensionSupported(OES_depth24)) { if (IsExtensionSupported(OES_depth24)) {
formats.depth = LOCAL_GL_DEPTH_COMPONENT24; formats.depth = LOCAL_GL_DEPTH_COMPONENT24;
} else { } else {

Просмотреть файл

@ -1780,7 +1780,7 @@ public:
private: private:
void raw_fGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) { void raw_fGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
MOZ_ASSERT(IsGLES2()); MOZ_ASSERT(IsGLES());
BEFORE_GL_CALL; BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetShaderPrecisionFormat); ASSERT_SYMBOL_PRESENT(fGetShaderPrecisionFormat);
@ -1790,7 +1790,7 @@ private:
public: public:
void fGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) { void fGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
if (IsGLES2()) { if (IsGLES()) {
raw_fGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); raw_fGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
} else { } else {
// Fall back to automatic values because almost all desktop hardware supports the OpenGL standard precisions. // Fall back to automatic values because almost all desktop hardware supports the OpenGL standard precisions.
@ -1878,7 +1878,7 @@ public:
private: private:
void raw_fDepthRange(GLclampf a, GLclampf b) { void raw_fDepthRange(GLclampf a, GLclampf b) {
MOZ_ASSERT(!IsGLES2()); MOZ_ASSERT(!IsGLES());
BEFORE_GL_CALL; BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fDepthRange); ASSERT_SYMBOL_PRESENT(fDepthRange);
@ -1887,7 +1887,7 @@ private:
} }
void raw_fDepthRangef(GLclampf a, GLclampf b) { void raw_fDepthRangef(GLclampf a, GLclampf b) {
MOZ_ASSERT(IsGLES2()); MOZ_ASSERT(IsGLES());
BEFORE_GL_CALL; BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fDepthRangef); ASSERT_SYMBOL_PRESENT(fDepthRangef);
@ -1896,7 +1896,7 @@ private:
} }
void raw_fClearDepth(GLclampf v) { void raw_fClearDepth(GLclampf v) {
MOZ_ASSERT(!IsGLES2()); MOZ_ASSERT(!IsGLES());
BEFORE_GL_CALL; BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fClearDepth); ASSERT_SYMBOL_PRESENT(fClearDepth);
@ -1905,7 +1905,7 @@ private:
} }
void raw_fClearDepthf(GLclampf v) { void raw_fClearDepthf(GLclampf v) {
MOZ_ASSERT(IsGLES2()); MOZ_ASSERT(IsGLES());
BEFORE_GL_CALL; BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fClearDepthf); ASSERT_SYMBOL_PRESENT(fClearDepthf);
@ -1915,7 +1915,7 @@ private:
public: public:
void fDepthRange(GLclampf a, GLclampf b) { void fDepthRange(GLclampf a, GLclampf b) {
if (IsGLES2()) { if (IsGLES()) {
raw_fDepthRangef(a, b); raw_fDepthRangef(a, b);
} else { } else {
raw_fDepthRange(a, b); raw_fDepthRange(a, b);
@ -1923,7 +1923,7 @@ public:
} }
void fClearDepth(GLclampf v) { void fClearDepth(GLclampf v) {
if (IsGLES2()) { if (IsGLES()) {
raw_fClearDepthf(v); raw_fClearDepthf(v);
} else { } else {
raw_fClearDepth(v); raw_fClearDepth(v);

Просмотреть файл

@ -168,7 +168,7 @@ GetActualReadFormats(GLContext* gl,
} }
bool fallback = true; bool fallback = true;
if (gl->IsGLES2()) { if (gl->IsGLES()) {
GLenum auxFormat = 0; GLenum auxFormat = 0;
GLenum auxType = 0; GLenum auxType = 0;
@ -768,7 +768,7 @@ GLReadTexImageHelper::ReadTexImage(GLuint aTextureId,
mGL->fBindRenderbuffer(LOCAL_GL_RENDERBUFFER, rb); mGL->fBindRenderbuffer(LOCAL_GL_RENDERBUFFER, rb);
GLenum rbInternalFormat = GLenum rbInternalFormat =
mGL->IsGLES2() mGL->IsGLES()
? (mGL->IsExtensionSupported(GLContext::OES_rgb8_rgba8) ? LOCAL_GL_RGBA8 : LOCAL_GL_RGBA4) ? (mGL->IsExtensionSupported(GLContext::OES_rgb8_rgba8) ? LOCAL_GL_RGBA8 : LOCAL_GL_RGBA4)
: LOCAL_GL_RGBA; : LOCAL_GL_RGBA;
mGL->fRenderbufferStorage(LOCAL_GL_RENDERBUFFER, rbInternalFormat, aSize.width, aSize.height); mGL->fRenderbufferStorage(LOCAL_GL_RENDERBUFFER, rbInternalFormat, aSize.width, aSize.height);

Просмотреть файл

@ -225,7 +225,7 @@ TexSubImage2DHelper(GLContext *gl,
GLint pixelsize, GLenum format, GLint pixelsize, GLenum format,
GLenum type, const GLvoid* pixels) GLenum type, const GLvoid* pixels)
{ {
if (gl->IsGLES2()) { if (gl->IsGLES()) {
if (stride == width * pixelsize) { if (stride == width * pixelsize) {
gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, gl->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT,
std::min(GetAddressAlignment((ptrdiff_t)pixels), std::min(GetAddressAlignment((ptrdiff_t)pixels),
@ -278,7 +278,7 @@ TexImage2DHelper(GLContext *gl,
GLint pixelsize, GLint border, GLenum format, GLint pixelsize, GLint border, GLenum format,
GLenum type, const GLvoid *pixels) GLenum type, const GLvoid *pixels)
{ {
if (gl->IsGLES2()) { if (gl->IsGLES()) {
NS_ASSERTION(format == (GLenum)internalformat, NS_ASSERTION(format == (GLenum)internalformat,
"format and internalformat not the same for glTexImage2D on GLES2"); "format and internalformat not the same for glTexImage2D on GLES2");

Просмотреть файл

@ -322,7 +322,7 @@ const GLubyte* glGetString_mozilla(GrGLenum name)
// on the GL implementation and change them to match what GLContext actually exposes. // on the GL implementation and change them to match what GLContext actually exposes.
if (name == LOCAL_GL_VERSION) { if (name == LOCAL_GL_VERSION) {
if (sGLContext.get()->IsGLES2()) { if (sGLContext.get()->IsGLES()) {
return reinterpret_cast<const GLubyte*>("OpenGL ES 2.0"); return reinterpret_cast<const GLubyte*>("OpenGL ES 2.0");
} else { } else {
return reinterpret_cast<const GLubyte*>("2.0"); return reinterpret_cast<const GLubyte*>("2.0");
@ -336,7 +336,7 @@ const GLubyte* glGetString_mozilla(GrGLenum name)
if (!extensionsStringBuilt) { if (!extensionsStringBuilt) {
extensionsString[0] = '\0'; extensionsString[0] = '\0';
if (sGLContext.get()->IsGLES2()) { if (sGLContext.get()->IsGLES()) {
// OES is only applicable to GLES2 // OES is only applicable to GLES2
if (sGLContext.get()->IsExtensionSupported(GLContext::OES_packed_depth_stencil)) { if (sGLContext.get()->IsExtensionSupported(GLContext::OES_packed_depth_stencil)) {
strcat(extensionsString, "GL_OES_packed_depth_stencil "); strcat(extensionsString, "GL_OES_packed_depth_stencil ");
@ -384,7 +384,7 @@ const GLubyte* glGetString_mozilla(GrGLenum name)
return reinterpret_cast<const GLubyte*>(extensionsString); return reinterpret_cast<const GLubyte*>(extensionsString);
} else if (name == LOCAL_GL_SHADING_LANGUAGE_VERSION) { } else if (name == LOCAL_GL_SHADING_LANGUAGE_VERSION) {
if (sGLContext.get()->IsGLES2()) { if (sGLContext.get()->IsGLES()) {
return reinterpret_cast<const GLubyte*>("OpenGL ES GLSL ES 1.0"); return reinterpret_cast<const GLubyte*>("OpenGL ES GLSL ES 1.0");
} else { } else {
return reinterpret_cast<const GLubyte*>("1.10"); return reinterpret_cast<const GLubyte*>("1.10");
@ -770,7 +770,7 @@ static GrGLInterface* CreateGrGLInterfaceFromGLContext(GLContext* context)
context->MakeCurrent(); context->MakeCurrent();
// We support both desktop GL and GLES2 // We support both desktop GL and GLES2
if (context->IsGLES2()) { if (context->IsGLES()) {
i->fStandard = kGLES_GrGLStandard; i->fStandard = kGLES_GrGLStandard;
} else { } else {
i->fStandard = kGL_GrGLStandard; i->fStandard = kGL_GrGLStandard;

Просмотреть файл

@ -282,7 +282,7 @@ CompositorOGL::Initialize()
LOCAL_GL_NONE LOCAL_GL_NONE
}; };
if (!mGLContext->IsGLES2()) { if (!mGLContext->IsGLES()) {
// No TEXTURE_RECTANGLE_ARB available on ES2 // No TEXTURE_RECTANGLE_ARB available on ES2
textureTargets[1] = LOCAL_GL_TEXTURE_RECTANGLE_ARB; textureTargets[1] = LOCAL_GL_TEXTURE_RECTANGLE_ARB;
} }
@ -734,7 +734,7 @@ CompositorOGL::CreateFBOWithTexture(const IntRect& aRect, bool aCopyFromSource,
GetFrameBufferInternalFormat(gl(), aSourceFrameBuffer, mWidget); GetFrameBufferInternalFormat(gl(), aSourceFrameBuffer, mWidget);
bool isFormatCompatibleWithRGBA bool isFormatCompatibleWithRGBA
= gl()->IsGLES2() ? (format == LOCAL_GL_RGBA) = gl()->IsGLES() ? (format == LOCAL_GL_RGBA)
: true; : true;
if (isFormatCompatibleWithRGBA) { if (isFormatCompatibleWithRGBA) {
@ -1193,19 +1193,19 @@ CompositorOGL::EndFrame()
// Unbind all textures // Unbind all textures
mGLContext->fActiveTexture(LOCAL_GL_TEXTURE0); mGLContext->fActiveTexture(LOCAL_GL_TEXTURE0);
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, 0); mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, 0);
if (!mGLContext->IsGLES2()) { if (!mGLContext->IsGLES()) {
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0); mGLContext->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0);
} }
mGLContext->fActiveTexture(LOCAL_GL_TEXTURE1); mGLContext->fActiveTexture(LOCAL_GL_TEXTURE1);
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, 0); mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, 0);
if (!mGLContext->IsGLES2()) { if (!mGLContext->IsGLES()) {
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0); mGLContext->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0);
} }
mGLContext->fActiveTexture(LOCAL_GL_TEXTURE2); mGLContext->fActiveTexture(LOCAL_GL_TEXTURE2);
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, 0); mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, 0);
if (!mGLContext->IsGLES2()) { if (!mGLContext->IsGLES()) {
mGLContext->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0); mGLContext->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0);
} }
} }
@ -1320,7 +1320,7 @@ CompositorOGL::CopyToTarget(DrawTarget *aTarget, const gfx::Matrix& aTransform)
mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0); mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
if (!mGLContext->IsGLES2()) { if (!mGLContext->IsGLES()) {
// GLES2 promises that binding to any custom FBO will attach // GLES2 promises that binding to any custom FBO will attach
// to GL_COLOR_ATTACHMENT0 attachment point. // to GL_COLOR_ATTACHMENT0 attachment point.
mGLContext->fReadBuffer(LOCAL_GL_BACK); mGLContext->fReadBuffer(LOCAL_GL_BACK);