diff options
author | junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-30 21:20:50 +0000 |
---|---|---|
committer | junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-30 21:20:50 +0000 |
commit | fd6591478e8b18ada225e3231328d96fa6471688 (patch) | |
tree | 3b90f6ad3d7f61c703f8b75621831aa8af95652f | |
parent | a89a22b515e29ea31fffc2bd6cc458e37954b5c0 (diff) | |
download | src-fd6591478e8b18ada225e3231328d96fa6471688.tar.gz |
merge skia r11007 to branch m30_1599
BUG=crbug.com/278940
TBR=kareng@google.com
Review URL: https://codereview.chromium.org/23531023
git-svn-id: http://skia.googlecode.com/svn/branches/chrome/m30_1599/src@11048 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gpu/gl/GrGpuGL.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gpu/gl/GrGpuGL.cpp b/gpu/gl/GrGpuGL.cpp index 5845d7a6..8d500e36 100644 --- a/gpu/gl/GrGpuGL.cpp +++ b/gpu/gl/GrGpuGL.cpp @@ -950,12 +950,7 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc, } 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) { return return_null_texture(); } @@ -963,6 +958,13 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc, this->setScratchTextureUnit(); 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 // 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). |