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

Unified Diff: src/core/SkBitmapProvider.cpp

Issue 1463373002: scaling API on SkPixmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/SkBitmapProvider.h ('k') | src/core/SkImageCacherator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProvider.cpp
diff --git a/src/core/SkBitmapProvider.cpp b/src/core/SkBitmapProvider.cpp
index cae744bcf04c0227f6bd9b23248c13c6b677b04b..9cf2e9ae6be32f7106567ab1596b494880a3f524 100644
--- a/src/core/SkBitmapProvider.cpp
+++ b/src/core/SkBitmapProvider.cpp
@@ -52,6 +52,14 @@ SkImageInfo SkBitmapProvider::info() const {
}
}
+bool SkBitmapProvider::isVolatile() const {
+ if (fImage) {
+ return false; // add flag to images?
+ } else {
+ return fBitmap.isVolatile();
+ }
+}
+
SkBitmapCacheDesc SkBitmapProvider::makeCacheDesc(int w, int h) const {
return fImage ? SkBitmapCacheDesc::Make(fImage, w, h) : SkBitmapCacheDesc::Make(fBitmap, w, h);
}
@@ -70,7 +78,7 @@ void SkBitmapProvider::notifyAddedToCache() const {
bool SkBitmapProvider::asBitmap(SkBitmap* bm) const {
if (fImage) {
- return as_IB(fImage)->getROPixels(bm);
+ return as_IB(fImage)->getROPixels(bm, SkImage::kAllow_CachingHint);
} else {
*bm = fBitmap;
return true;
« no previous file with comments | « src/core/SkBitmapProvider.h ('k') | src/core/SkImageCacherator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698