Bug 848023 - Use the same adjusted max texture size everywhere. r=bjacob

This commit is contained in:
Milan Sreckovic 2013-03-05 13:56:27 -05:00
parent d8ca91d555
commit 9cff8595a2
5 changed files with 8 additions and 8 deletions

View File

@ -1015,6 +1015,7 @@ public:
const char *extension);
GLint GetMaxTextureImageSize() { return mMaxTextureImageSize; }
GLint GetMaxTextureSize() { MOZ_ASSERT(mMaxTextureSize>0); return mMaxTextureSize; }
void SetFlipped(bool aFlipped) { mFlipped = aFlipped; }
// this should just be a std::bitset, but that ended up breaking

View File

@ -203,7 +203,7 @@ TiledTextureImage::TiledTextureImage(GLContext* aGL,
if (!(aFlags & TextureImage::ForceSingleTile) && mGL->WantsSmallTiles()) {
mTileSize = 256;
} else {
mGL->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, (GLint*) &mTileSize);
mTileSize = mGL->GetMaxTextureSize();
}
if (aSize.width != 0 && aSize.height != 0) {
Resize(aSize);

View File

@ -169,8 +169,7 @@ CanvasLayerOGL::Initialize(const Data& aData)
// Check the maximum texture size supported by GL. glTexImage2D supports
// images of up to 2 + GL_MAX_TEXTURE_SIZE
GLint texSize;
gl()->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, &texSize);
GLint texSize = gl()->GetMaxTextureSize();
if (mBounds.width > (2 + texSize) || mBounds.height > (2 + texSize)) {
mDelayedUpdates = true;
MakeTextureIfNeeded(gl(), mUploadTexture);

View File

@ -200,8 +200,7 @@ ContainerRender(Container* aContainer,
// of just clamping the framebuffer's size to the max supported size.
// This gives us a lower resolution rendering of the intermediate surface (children layers).
// See bug 827170 for a discussion.
GLint maxTexSize;
aContainer->gl()->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, &maxTexSize);
GLint maxTexSize = aContainer->gl()->GetMaxTextureSize();
framebufferRect.width = std::min(framebufferRect.width, maxTexSize);
framebufferRect.height = std::min(framebufferRect.height, maxTexSize);

View File

@ -63,10 +63,11 @@ LayerManagerOGL::Initialize(bool force)
int32_t
LayerManagerOGL::GetMaxTextureSize() const
{
int32_t maxSize;
// TODO: It seems wrong that this call should have a side effect
// of making mGLContext current, but to be safe, leave it in
// and sort it out in another bug.
mGLContext->MakeCurrent();
mGLContext->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, &maxSize);
return maxSize;
return (int32_t) mGLContext->GetMaxTextureSize();
}
void