aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@chromium.org>2016-04-29 09:50:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-29 09:50:25 -0700
commitfb5916486f562b45474fba86ed4bede15b83ef4a (patch)
treebfc1894ea28dd24121a54bcf1f19d7c3199a7f6b
parent69deca8d1e57daec540f8a7f10d9c660b640b9a9 (diff)
Don't mark mipmaps dirty if uploading > 1 levels
-rw-r--r--src/gpu/gl/GrGLGpu.cpp7
-rw-r--r--src/gpu/gl/GrGLGpu.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index d57cbac423..7eb833c880 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -882,7 +882,7 @@ bool GrGLGpu::onWritePixels(GrSurface* surface,
if (success) {
SkIRect rect = SkIRect::MakeXYWH(left, top, width, height);
- this->didWriteToSurface(surface, &rect);
+ this->didWriteToSurface(surface, &rect, texels.count());
}
return success;
@@ -2672,14 +2672,15 @@ void GrGLGpu::flushViewport(const GrGLIRect& viewport) {
}
}
-void GrGLGpu::didWriteToSurface(GrSurface* surface, const SkIRect* bounds) const {
+void GrGLGpu::didWriteToSurface(GrSurface* surface, const SkIRect* bounds, int mipLevels) const {
SkASSERT(surface);
// Mark any MIP chain and resolve buffer as dirty if and only if there is a non-empty bounds.
if (nullptr == bounds || !bounds->isEmpty()) {
if (GrRenderTarget* target = surface->asRenderTarget()) {
target->flagAsNeedingResolve(bounds);
}
- if (GrTexture* texture = surface->asTexture()) {
+ GrTexture* texture = surface->asTexture();
+ if (texture && 1 == mipLevels) {
texture->texturePriv().dirtyMipMaps(true);
}
}
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index b6bc7baee7..5f3a751fee 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -309,7 +309,7 @@ private:
// nullptr means whole target. Can be an empty rect.
void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds, bool disableSRGB = false);
// Handles cases where a surface will be updated without a call to flushRenderTarget
- void didWriteToSurface(GrSurface*, const SkIRect* bounds) const;
+ void didWriteToSurface(GrSurface*, const SkIRect* bounds, int mipLevels = 1) const;
// Need not be called if flushRenderTarget is used.
void flushViewport(const GrGLIRect&);