Chromium Code Reviews| Index: src/image/SkImage_Raster.cpp |
| diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp |
| index cd9b70f018bc6637192dbcca4a581af1b47ffc93..b3ff7a6f616a665e9f01993ce80d7037372929a1 100644 |
| --- a/src/image/SkImage_Raster.cpp |
| +++ b/src/image/SkImage_Raster.cpp |
| @@ -88,9 +88,9 @@ SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes) |
| bool isOpaque; |
| SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque); |
|
scroggo
2013/10/18 19:32:40
I think this function should be updated. Since bot
scroggo
2013/10/18 20:04:34
All classes of using SkImageInfoToBitmapInfo shoul
reed1
2013/10/18 21:37:34
Done.
|
| - fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes); |
| + fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes, isOpaque ? |
| + kOpaque_SkAlphaType : kPremul_SkAlphaType); |
| fBitmap.setPixelRef(SkNEW_ARGS(SkDataPixelRef, (data)))->unref(); |
| - fBitmap.setIsOpaque(isOpaque); |
| fBitmap.setImmutable(); |
| } |
| @@ -99,9 +99,9 @@ SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes |
| bool isOpaque; |
| SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque); |
| - fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes); |
| + fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes, isOpaque ? |
| + kOpaque_SkAlphaType : kPremul_SkAlphaType); |
| fBitmap.setPixelRef(pr); |
| - fBitmap.setIsOpaque(isOpaque); |
| } |
| SkImage_Raster::~SkImage_Raster() {} |