Index: src/image/SkImage_Codec.cpp |
diff --git a/src/image/SkImage_Codec.cpp b/src/image/SkImage_Codec.cpp |
index 3d815ce7f437409156b94c009a26e733ca77a270..8377655e27f68a06e113b466db90f6f7d5e40267 100644 |
--- a/src/image/SkImage_Codec.cpp |
+++ b/src/image/SkImage_Codec.cpp |
@@ -21,6 +21,8 @@ public: |
virtual void onDraw(SkCanvas*, SkScalar, SkScalar, const SkPaint*) SK_OVERRIDE; |
virtual void onDrawRectToRect(SkCanvas*, const SkRect*, const SkRect&, const SkPaint*) SK_OVERRIDE; |
+ virtual bool isOpaque() const SK_OVERRIDE; |
+ |
private: |
SkData* fEncodedData; |
SkBitmap fBitmap; |
@@ -73,3 +75,12 @@ SkImage* SkImage::NewEncodedData(SkData* data) { |
return SkNEW_ARGS(SkImage_Codec, (data, bitmap.width(), bitmap.height())); |
} |
+ |
+ |
+bool SkImage_Codec::isOpaque() const { |
+ if (!fBitmap.pixelRef()) { |
+ return SkImage::isOpaque(); |
reed1
2014/07/18 20:50:02
This will return false, even if the bitmap is opaq
Rémi Piotaix
2014/07/18 21:12:50
Yep.
I made this method const so SkImageDecoder::D
scroggo
2014/07/18 21:39:14
It does seem to me that fBitmap is logically mutab
|
+ } |
+ |
+ return fBitmap.isOpaque(); |
+} |