From d8ebb72e62f133d954c2d76bb17a228d9c1ba184 Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Wed, 26 Oct 2011 14:36:18 -0700 Subject: [PATCH] Bug 680082 - Add GetMaxTextureImageSize to correct size support for TiledTextureImage. r=matt.woodrow --HG-- extra : rebase_source : e121a8718fa68e602794957bae278d7351d7d585 --- gfx/layers/opengl/ThebesLayerOGL.cpp | 4 ++-- gfx/thebes/GLContext.cpp | 1 + gfx/thebes/GLContext.h | 2 ++ gfx/thebes/GLContextProviderEGL.cpp | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gfx/layers/opengl/ThebesLayerOGL.cpp b/gfx/layers/opengl/ThebesLayerOGL.cpp index 4ad745511f2..4ecbfbf20ed 100644 --- a/gfx/layers/opengl/ThebesLayerOGL.cpp +++ b/gfx/layers/opengl/ThebesLayerOGL.cpp @@ -506,8 +506,8 @@ BasicBufferOGL::BeginPaint(ContentType aContentType, if (result.mRegionToDraw.IsEmpty()) return result; - if (destBufferRect.width > gl()->GetMaxTextureSize() || - destBufferRect.height > gl()->GetMaxTextureSize()) { + if (destBufferRect.width > gl()->GetMaxTextureImageSize() || + destBufferRect.height > gl()->GetMaxTextureImageSize()) { return result; } diff --git a/gfx/thebes/GLContext.cpp b/gfx/thebes/GLContext.cpp index ece01b1c8bd..28230140c78 100644 --- a/gfx/thebes/GLContext.cpp +++ b/gfx/thebes/GLContext.cpp @@ -419,6 +419,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl) fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); fGetIntegerv(LOCAL_GL_MAX_RENDERBUFFER_SIZE, &mMaxRenderbufferSize); + mMaxTextureImageSize = mMaxTextureSize; UpdateActualFormat(); } diff --git a/gfx/thebes/GLContext.h b/gfx/thebes/GLContext.h index 7fc219aaa81..780a66815a1 100644 --- a/gfx/thebes/GLContext.h +++ b/gfx/thebes/GLContext.h @@ -1258,6 +1258,7 @@ public: const char *extension); GLint GetMaxTextureSize() { return mMaxTextureSize; } + GLint GetMaxTextureImageSize() { return mMaxTextureImageSize; } void SetFlipped(bool aFlipped) { mFlipped = aFlipped; } // this should just be a std::bitset, but that ended up breaking @@ -1397,6 +1398,7 @@ protected: nsTArray mScissorStack; GLint mMaxTextureSize; + GLint mMaxTextureImageSize; GLint mMaxRenderbufferSize; public: diff --git a/gfx/thebes/GLContextProviderEGL.cpp b/gfx/thebes/GLContextProviderEGL.cpp index 83320c99e86..b9c27b9365f 100644 --- a/gfx/thebes/GLContextProviderEGL.cpp +++ b/gfx/thebes/GLContextProviderEGL.cpp @@ -726,6 +726,9 @@ public: } bool ok = InitWithPrefix("gl", true); + + PR_STATIC_ASSERT(sizeof(GLint) >= sizeof(int32_t)); + mMaxTextureImageSize = PR_INT32_MAX; #if 0 if (ok) { EGLint v;