aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceProvider.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-09-26 16:37:12 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-27 17:30:18 +0000
commit6b60b6eefb9f52a9945cc400a65801c77779190d (patch)
treefe05399335d72f82f88abfafd4757b3ec74b234d /src/gpu/GrResourceProvider.cpp
parent8e0c2c98322f500cb4d8b66545b41a3e4fdcf0ed (diff)
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>
Diffstat (limited to 'src/gpu/GrResourceProvider.cpp')
-rw-r--r--src/gpu/GrResourceProvider.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index cb23e38bbc..d50bb01f86 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -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