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

Unified Diff: src/core/SkScaledImageCache.cpp

Issue 129423002: add SkBitmap::installPixelRef() (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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
Index: src/core/SkScaledImageCache.cpp
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp
index fc3148bdd8807a31f0660c7f45b36e78bdcd1f41..c8a793d03ef00ffaaca2c5cc91d46cc71bdb3564 100644
--- a/src/core/SkScaledImageCache.cpp
+++ b/src/core/SkScaledImageCache.cpp
@@ -293,14 +293,10 @@ bool SkScaledImageCacheDiscardableAllocator::allocPixelRef(SkBitmap* bitmap,
return false;
}
- SkImageInfo info = {
- bitmap->width(),
- bitmap->height(),
- kPMColor_SkColorType,
- bitmap->alphaType()
- };
-
- bitmap->setPixelRef(SkNEW_ARGS(SkOneShotDiscardablePixelRef,
+ SkImageInfo info = SkImageInfo::MakePM(bitmap->width(), bitmap->height(),
+ bitmap->alphaType());
+
+ bitmap->installPixelRef(SkNEW_ARGS(SkOneShotDiscardablePixelRef,
(info, dm, bitmap->rowBytes())))->unref();
bitmap->lockPixels();
return bitmap->readyToDraw();

Powered by Google App Engine
This is Rietveld 408576698