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
This commit is contained in:
brianosman 2016-03-29 11:27:20 -07:00 committed by Commit bot
parent 6e26205cec
commit 3ebd2760dd

View 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;
}