Reland "Add back missing unique key checks when creating CachedBitmap/Image Proxies"

This reverts commit 4f57eb8002.

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 b78dd5d01e.
> 
> 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>
This commit is contained in:
Greg Daniel 2018-03-14 19:09:36 +00:00 committed by Skia Commit-Bot
parent 67c47f2329
commit a421112ac4

View File

@ -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());
}
}
}