diff options
author | Romain Guy <romainguy@google.com> | 2010-08-19 14:46:14 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-08-19 15:00:09 -0700 |
commit | e7e6c37f77fd7f4c0b96f1fce939dd51af37495d (patch) | |
tree | e44c22c41aa508dac1b7e75675ea3abf37c92aeb /src/images | |
parent | ae3c9823f39f96243d0f69d90363dc43e1540c09 (diff) | |
download | external_skia-e7e6c37f77fd7f4c0b96f1fce939dd51af37495d.zip external_skia-e7e6c37f77fd7f4c0b96f1fce939dd51af37495d.tar.gz external_skia-e7e6c37f77fd7f4c0b96f1fce939dd51af37495d.tar.bz2 |
DO NOT MERGE. Add an API to correctly copy the isOpaque flage of an ImageRef to Bitmap.
Change-Id: I64904bf4d77a0d84f92d31024f48a2e3e0514f73
Diffstat (limited to 'src/images')
-rw-r--r-- | src/images/SkImageRef.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/images/SkImageRef.cpp b/src/images/SkImageRef.cpp index 60e01c6..1a85a1d 100644 --- a/src/images/SkImageRef.cpp +++ b/src/images/SkImageRef.cpp @@ -57,6 +57,16 @@ bool SkImageRef::getInfo(SkBitmap* bitmap) { return true; } +bool SkImageRef::isOpaque(SkBitmap* bitmap) { + if (bitmap && bitmap->pixelRef() == this) { + bitmap->lockPixels(); + bitmap->setIsOpaque(fBitmap.isOpaque()); + bitmap->unlockPixels(); + return true; + } + return false; +} + SkImageDecoderFactory* SkImageRef::setDecoderFactory( SkImageDecoderFactory* fact) { SkRefCnt_SafeAssign(fFactory, fact); |