зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1016437 - Make TextureImageTextureSourceOGL::Update refuse uploading textures that exceed the maximum texture size if bigimage is disallowed. r=bjacob
This commit is contained in:
Родитель
136d73bcdc
Коммит
22992cbfea
|
@ -251,9 +251,15 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
|
|||
(mTexImage->GetSize() != size && !aSrcOffset) ||
|
||||
mTexImage->GetContentType() != gfx::ContentForFormat(aSurface->GetFormat())) {
|
||||
if (mFlags & TextureFlags::DISALLOW_BIGIMAGE) {
|
||||
GLint maxTextureSize;
|
||||
mGL->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, &maxTextureSize);
|
||||
if (size.width > maxTextureSize || size.height > maxTextureSize) {
|
||||
NS_WARNING("Texture exceeds maximum texture size, refusing upload");
|
||||
return false;
|
||||
}
|
||||
// Explicitly use CreateBasicTextureImage instead of CreateTextureImage,
|
||||
// because CreateTextureImage may still create a tiled texture image
|
||||
// if the maximum texture size is exceeded.
|
||||
// because CreateTextureImage might still choose to create a tiled
|
||||
// texture image.
|
||||
mTexImage = CreateBasicTextureImage(mGL, size,
|
||||
gfx::ContentForFormat(aSurface->GetFormat()),
|
||||
WrapMode(mGL, mFlags),
|
||||
|
|
Загрузка…
Ссылка в новой задаче