Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1933293002: Don't mark mipmaps dirty if uploading > 1 levels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698