Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Unified Diff: src/lazy/SkCachingPixelRef.cpp

Issue 646213003: Add `SkIRect bounds()` convenience method to SkImageInfo and SkBitmap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: reed nits Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkCachingPixelRef.cpp
diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp
index 1459567e0b4a3e3c1dae4c94cc49c0bb12846869..5ab96562ec8184f9adb1671ea36ec1db54e31829 100644
--- a/src/lazy/SkCachingPixelRef.cpp
+++ b/src/lazy/SkCachingPixelRef.cpp
@@ -45,9 +45,8 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) {
}
const SkImageInfo& info = this->info();
- if (!SkBitmapCache::Find(this->getGenerationID(),
- SkIRect::MakeWH(info.width(), info.height()),
- &fLockedBitmap)) {
+ if (!SkBitmapCache::Find(
+ this->getGenerationID(), info.bounds(), &fLockedBitmap)) {
// Cache has been purged, must re-decode.
if (!fLockedBitmap.tryAllocPixels(info, fRowBytes)) {
fErrorInDecoding = true;
@@ -58,9 +57,8 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) {
return false;
}
fLockedBitmap.setImmutable();
- SkBitmapCache::Add(this->getGenerationID(),
- SkIRect::MakeWH(info.width(), info.height()),
- fLockedBitmap);
+ SkBitmapCache::Add(
+ this->getGenerationID(), info.bounds(), fLockedBitmap);
}
// Now bitmap should contain a concrete PixelRef of the decoded image.
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698