aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index d8f383a196..9af3acc474 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1642,6 +1642,11 @@ GrTexture* GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc,
return return_null_texture();
}
+ bool wasMipMapDataProvided = false;
+ if (texels.count() > 1) {
+ wasMipMapDataProvided = true;
+ }
+
GrGLTexture* tex;
if (renderTarget) {
// unbind the texture from the texture unit before binding it to the frame buffer
@@ -1652,12 +1657,9 @@ GrTexture* GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc,
GL_CALL(DeleteTextures(1, &idDesc.fInfo.fID));
return return_null_texture();
}
- tex = new GrGLTextureRenderTarget(this, budgeted, desc, idDesc, rtIDDesc);
+ tex = new GrGLTextureRenderTarget(this, budgeted, desc, idDesc, rtIDDesc,
+ wasMipMapDataProvided);
} else {
- bool wasMipMapDataProvided = false;
- if (texels.count() > 1) {
- wasMipMapDataProvided = true;
- }
tex = new GrGLTexture(this, budgeted, desc, idDesc, wasMipMapDataProvided);
}
tex->setCachedTexParams(initialTexParams, this->getResetTimestamp());