From 3ebd2760dd34da6f5af23e9c7cb1b6a61e9cea9d Mon Sep 17 00:00:00 2001 From: brianosman Date: Tue, 29 Mar 2016 11:27:20 -0700 Subject: [PATCH] Dirty mipmaps whenever we upload new contents for a texture. 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index d3c4ec363e..43df735355 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -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; }