Moving out of order call to TexParameteri in GrGpuGL::onCreateTexture

BUG=crbug.com/278940
R=robertphillips@google.com

Review URL: https://codereview.chromium.org/23514014

git-svn-id: http://skia.googlecode.com/svn/trunk@11007 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
junov@chromium.org 2013-08-29 16:22:09 +00:00
parent c33d6218f0
commit 8b6b1c9208

View File

@ -956,12 +956,7 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc,
} }
GL_CALL(GenTextures(1, &glTexDesc.fTextureID)); GL_CALL(GenTextures(1, &glTexDesc.fTextureID));
if (renderTarget && this->glCaps().textureUsageSupport()) {
// provides a hint about how this texture will be used
GL_CALL(TexParameteri(GR_GL_TEXTURE_2D,
GR_GL_TEXTURE_USAGE,
GR_GL_FRAMEBUFFER_ATTACHMENT));
}
if (!glTexDesc.fTextureID) { if (!glTexDesc.fTextureID) {
return return_null_texture(); return return_null_texture();
} }
@ -969,6 +964,13 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc,
this->setScratchTextureUnit(); this->setScratchTextureUnit();
GL_CALL(BindTexture(GR_GL_TEXTURE_2D, glTexDesc.fTextureID)); GL_CALL(BindTexture(GR_GL_TEXTURE_2D, glTexDesc.fTextureID));
if (renderTarget && this->glCaps().textureUsageSupport()) {
// provides a hint about how this texture will be used
GL_CALL(TexParameteri(GR_GL_TEXTURE_2D,
GR_GL_TEXTURE_USAGE,
GR_GL_FRAMEBUFFER_ATTACHMENT));
}
// Some drivers like to know filter/wrap before seeing glTexImage2D. Some // Some drivers like to know filter/wrap before seeing glTexImage2D. Some
// drivers have a bug where an FBO won't be complete if it includes a // drivers have a bug where an FBO won't be complete if it includes a
// texture that is not mipmap complete (considering the filter in use). // texture that is not mipmap complete (considering the filter in use).