Index: src/core/SkPictureShader.cpp |
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp |
index 198a2a9e497602b24e0ed7b5ed4a9f66c9899a19..fb05597db853d18b1497fe3c91e7e361606d03b2 100644 |
--- a/src/core/SkPictureShader.cpp |
+++ b/src/core/SkPictureShader.cpp |
@@ -77,7 +77,14 @@ struct BitmapShaderRec : public SkResourceCache::Rec { |
SkAutoTUnref<SkShader>* result = reinterpret_cast<SkAutoTUnref<SkShader>*>(contextShader); |
result->reset(SkRef(rec.fShader.get())); |
- return true; |
+ |
+ 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; |
} |
}; |