Bug 1012407 - Part 9: Use CLAMP instead of GL_REPEAT to draw quads (r=Bas)

This commit is contained in:
Andreas Gal 2014-05-28 14:07:15 -04:00
Родитель 47abe4ef63
Коммит bd6b6ee02e
1 изменённых файлов: 3 добавлений и 14 удалений

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

@ -116,18 +116,6 @@ FlagsToGLFlags(TextureFlags aFlags)
return static_cast<gl::TextureImage::Flags>(result);
}
static GLenum
WrapMode(gl::GLContext *aGl, TextureFlags aFlags)
{
if ((aFlags & TextureFlags::ALLOW_REPEAT) &&
(aGl->IsExtensionSupported(GLContext::ARB_texture_non_power_of_two) ||
aGl->IsExtensionSupported(GLContext::OES_texture_npot) ||
aGl->IsExtensionSupported(GLContext::IMG_texture_npot))) {
return LOCAL_GL_REPEAT;
}
return LOCAL_GL_CLAMP_TO_EDGE;
}
CompositableDataGonkOGL::CompositableDataGonkOGL()
: mTexture(0)
, mBoundEGLImage(EGL_NO_IMAGE)
@ -262,7 +250,7 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
// texture image.
mTexImage = CreateBasicTextureImage(mGL, size,
gfx::ContentForFormat(aSurface->GetFormat()),
WrapMode(mGL, mFlags),
LOCAL_GL_CLAMP_TO_EDGE,
FlagsToGLFlags(mFlags),
SurfaceFormatToImageFormat(aSurface->GetFormat()));
} else {
@ -273,6 +261,7 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
mTexImage = CreateTextureImage(mGL,
size,
gfx::ContentForFormat(aSurface->GetFormat()),
LOCAL_GL_CLAMP_TO_EDGE,
WrapMode(mGL, mFlags),
FlagsToGLFlags(mFlags),
SurfaceFormatToImageFormat(aSurface->GetFormat()));
@ -298,7 +287,7 @@ TextureImageTextureSourceOGL::EnsureBuffer(const nsIntSize& aSize,
mTexImage = CreateTextureImage(mGL,
aSize.ToIntSize(),
aContentType,
WrapMode(mGL, mFlags),
LOCAL_GL_CLAMP_TO_EDGE,
FlagsToGLFlags(mFlags));
}
mTexImage->Resize(aSize.ToIntSize());