aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-21 14:00:07 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-21 14:00:07 +0000
commit383a697692cf46951fd451f6f4c3d03634a6a1cb (patch)
treea1dac6fe4fa0e4d34d032e70ff85503843ad39b8 /src/lazy
parentc2eae4795478ab134a2315b1a9ff2c5de1d049e4 (diff)
store SkAlphaType inside SkBitmap, on road to support unpremul
BUG= R=bsalomon@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/25275004 git-svn-id: http://skia.googlecode.com/svn/trunk@11877 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/lazy')
-rw-r--r--src/lazy/SkBitmapFactory.cpp7
-rw-r--r--src/lazy/SkLazyPixelRef.cpp9
2 files changed, 6 insertions, 10 deletions
diff --git a/src/lazy/SkBitmapFactory.cpp b/src/lazy/SkBitmapFactory.cpp
index 0ff4ee2d17..5464851402 100644
--- a/src/lazy/SkBitmapFactory.cpp
+++ b/src/lazy/SkBitmapFactory.cpp
@@ -53,16 +53,13 @@ bool SkBitmapFactory::installPixelRef(SkData* data, SkBitmap* dst) {
return false;
}
- bool isOpaque = false;
- SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
+ SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
Target target;
// FIMXE: There will be a problem if this rowbytes is calculated differently from
// in SkLazyPixelRef.
target.fRowBytes = SkImageMinRowBytes(info);
-
- dst->setConfig(config, info.fWidth, info.fHeight, target.fRowBytes);
- dst->setIsOpaque(isOpaque);
+ dst->setConfig(config, info.fWidth, info.fHeight, target.fRowBytes, info.fAlphaType);
// fImageCache and fCacheSelector are mutually exclusive.
SkASSERT(NULL == fImageCache || NULL == fCacheSelector);
diff --git a/src/lazy/SkLazyPixelRef.cpp b/src/lazy/SkLazyPixelRef.cpp
index 9e023c4a7c..22d4b112f1 100644
--- a/src/lazy/SkLazyPixelRef.cpp
+++ b/src/lazy/SkLazyPixelRef.cpp
@@ -150,15 +150,14 @@ SkData* SkLazyPixelRef::onRefEncodedData() {
static bool init_from_info(SkBitmap* bm, const SkImage::Info& info,
size_t rowBytes) {
- bool isOpaque;
- SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
+ SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
if (SkBitmap::kNo_Config == config) {
return false;
}
- bm->setConfig(config, info.fWidth, info.fHeight, rowBytes);
- bm->setIsOpaque(isOpaque);
- return bm->allocPixels();
+ return bm->setConfig(config, info.fWidth, info.fHeight, rowBytes, info.fAlphaType)
+ &&
+ bm->allocPixels();
}
bool SkLazyPixelRef::onImplementsDecodeInto() {