Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index d57cbac4230af8e8b904b433a8bd96f110d68152..7eb833c880ac5fd91bc7aa5b88abdd38ed58fa6a 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); |
} |
} |