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

Unified Diff: src/core/SkPictureShader.cpp

Issue 1287263005: change asABitmap to isABitmap on shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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/SkPictureShader.cpp
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index e04e248756ea90e4d4a27ed003fbbf8f2acaa9b6..f8c2ab09f8e4c37eec252ffe56180d8bf96f6602 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -83,12 +83,14 @@ struct BitmapShaderRec : public SkResourceCache::Rec {
result->reset(SkRef(rec.fShader.get()));
SkBitmap tile;
- rec.fShader.get()->asABitmap(&tile, NULL, NULL);
- // FIXME: this doesn't protect the pixels from being discarded as soon as we unlock.
- // Should be handled via a pixel ref generator instead
- // (https://code.google.com/p/skia/issues/detail?id=3220).
- SkAutoLockPixels alp(tile, true);
- return tile.getPixels() != NULL;
+ if (rec.fShader.get()->isABitmap(&tile, NULL, NULL)) {
+ // FIXME: this doesn't protect the pixels from being discarded as soon as we unlock.
+ // Should be handled via a pixel ref generator instead
+ // (https://code.google.com/p/skia/issues/detail?id=3220).
+ SkAutoLockPixels alp(tile, true);
+ return tile.getPixels() != NULL;
+ }
+ return false;
}
};

Powered by Google App Engine
This is Rietveld 408576698