Dirty mipmaps whenever we upload new contents for a texture.
authorbrianosman <brianosman@google.com>
Tue, 29 Mar 2016 18:27:20 +0000 (11:27 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 29 Mar 2016 18:27:20 +0000 (11:27 -0700)
Found a bug where we rendered with two identically sized textures. On
the first frame, everything worked. On subsequent frames, we would get
the other texture from the cache, causing us to inherit the mips from
the wrong texture.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1836143003

Review URL: https://codereview.chromium.org/1836143003

src/gpu/gl/GrGLGpu.cpp

index d3c4ec3..43df735 100644 (file)
@@ -840,6 +840,11 @@ bool GrGLGpu::onWritePixels(GrSurface* surface,
                                       left, top, width, height, config, texels);
     }
 
+    if (success) {
+        SkIRect rect = SkIRect::MakeXYWH(left, top, width, height);
+        this->didWriteToSurface(surface, &rect);
+    }
+
     return success;
 }
 
@@ -876,7 +881,8 @@ bool GrGLGpu::onTransferPixels(GrSurface* surface,
     success = this->uploadTexData(glTex->desc(), glTex->target(), kTransfer_UploadType,
                                   left, top, width, height, config, texels);
     if (success) {
-        glTex->texturePriv().dirtyMipMaps(true);
+        SkIRect rect = SkIRect::MakeXYWH(left, top, width, height);
+        this->didWriteToSurface(surface, &rect);
         return true;
     }