aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGr.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-03-14 19:09:36 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-14 19:09:39 +0000
commita421112ac4a9836b2dc910a55d3139de12a1654b (patch)
treee8bc278232d30dce8f8d6d7b21e3fd3af4cef8b8 /src/gpu/SkGr.cpp
parent67c47f23290f3f947f35deb1145883d57d2c8c61 (diff)
Reland "Add back missing unique key checks when creating CachedBitmap/Image Proxies"
This reverts commit 4f57eb8002a0488cfbf08717b25af93fae37a39a. Reason for revert: Doesn't look to be cause of chrome roll failures Original change's description: > Revert "Add back missing unique key checks when creating CachedBitmap/Image Proxies" > > This reverts commit b78dd5d01eb16ae3cb9104ce8c0fa7e861431259. > > Reason for revert: possibly breaking chrome roll > > Original change's description: > > Add back missing unique key checks when creating CachedBitmap/Image Proxies > > > > Its possible that this could fix perf regression in Chrome. > > > > Bug: 811452 > > Change-Id: I2d4f7827092b361469586580f0c7c843ab2d5cec > > Reviewed-on: https://skia-review.googlesource.com/114280 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com > > Change-Id: I71646befd07bf28442ac3b9225c021cd141bf398 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 811452 > Reviewed-on: https://skia-review.googlesource.com/114422 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I957d66123bce150387a1ce6a80bcfc06c82d5fa1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 811452 Reviewed-on: https://skia-review.googlesource.com/114426 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/SkGr.cpp')
-rw-r--r--src/gpu/SkGr.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 4701483af5..195d036374 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -178,9 +178,11 @@ static void create_unique_key_for_image(const SkImage* image, GrUniqueKey* resul
}
if (const SkBitmap* bm = as_IB(image)->onPeekBitmap()) {
- SkIPoint origin = bm->pixelRefOrigin();
- SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, bm->width(), bm->height());
- GrMakeKeyFromImageID(result, bm->getGenerationID(), subset);
+ if (!bm->isVolatile()) {
+ SkIPoint origin = bm->pixelRefOrigin();
+ SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, bm->width(), bm->height());
+ GrMakeKeyFromImageID(result, bm->getGenerationID(), subset);
+ }
return;
}
@@ -199,10 +201,13 @@ sk_sp<GrTextureProxy> GrMakeCachedImageProxy(GrProxyProvider* proxyProvider,
proxy = proxyProvider->findOrCreateProxyByUniqueKey(originalKey, kTopLeft_GrSurfaceOrigin);
}
if (!proxy) {
- proxy = proxyProvider->createTextureProxy(std::move(srcImage), kNone_GrSurfaceFlags, 1,
+ proxy = proxyProvider->createTextureProxy(srcImage, kNone_GrSurfaceFlags, 1,
SkBudgeted::kYes, fit);
if (proxy && originalKey.isValid()) {
proxyProvider->assignUniqueKeyToProxy(originalKey, proxy.get());
+ if (const SkBitmap* bm = as_IB(srcImage.get())->onPeekBitmap()) {
+ GrInstallBitmapUniqueKeyInvalidator(originalKey, bm->pixelRef());
+ }
}
}