Try finding exact scratch texture in cache before approx, take 2

This is a reland of https://skia-review.googlesource.com/c/skia/+/42940
which was reverted since its parent CL had to be reverted. The parent
has since relanded.

Bug: skia:
Change-Id: Ibf4bf7ce0332e4faea9a6e95a40d1c1f07fb0e75
Reviewed-on: https://skia-review.googlesource.com/51244
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2017-09-26 16:37:12 -04:00 committed by Skia Commit-Bot
parent 8e0c2c9832
commit 6b60b6eefb

View File

@ -187,6 +187,10 @@ sk_sp<GrTexture> GrResourceProvider::createApproxTexture(const GrSurfaceDesc& de
return nullptr;
}
if (auto tex = this->refScratchTexture(desc, flags)) {
return tex;
}
SkTCopyOnFirstWrite<GrSurfaceDesc> copyDesc(desc);
// bin by pow2 with a reasonable min