| Index: src/core/SkBitmapDevice.cpp
|
| diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
|
| index 0570fd9afdec7cf2890aae728f9c28fcac192aaa..9f6a256b79b5b0ec2bd636064a0206fed3ae0610 100644
|
| --- a/src/core/SkBitmapDevice.cpp
|
| +++ b/src/core/SkBitmapDevice.cpp
|
| @@ -24,10 +24,9 @@ SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties&
|
| , fBitmap(bitmap) {
|
| }
|
|
|
| -void SkBitmapDevice::init(SkBitmap::Config config, int width, int height, bool isOpaque) {
|
| +SkBitmapDevice::SkBitmapDevice(SkBitmap::Config config, int width, int height, bool isOpaque) {
|
| fBitmap.setConfig(config, width, height, 0, isOpaque ?
|
| kOpaque_SkAlphaType : kPremul_SkAlphaType);
|
| -
|
| if (SkBitmap::kNo_Config != config) {
|
| if (!fBitmap.allocPixels()) {
|
| // indicate failure by zeroing our bitmap
|
| @@ -39,15 +38,19 @@ void SkBitmapDevice::init(SkBitmap::Config config, int width, int height, bool i
|
| }
|
| }
|
|
|
| -SkBitmapDevice::SkBitmapDevice(SkBitmap::Config config, int width, int height, bool isOpaque) {
|
| - this->init(config, width, height, isOpaque);
|
| -}
|
| -
|
| SkBitmapDevice::SkBitmapDevice(SkBitmap::Config config, int width, int height, bool isOpaque,
|
| const SkDeviceProperties& deviceProperties)
|
| : SkBaseDevice(deviceProperties)
|
| {
|
| - this->init(config, width, height, isOpaque);
|
| + if (SkBitmap::kNo_Config != config) {
|
| + if (!fBitmap.allocPixels()) {
|
| + // indicate failure by zeroing our bitmap
|
| + fBitmap.setConfig(config, 0, 0, 0, isOpaque ?
|
| + kOpaque_SkAlphaType : kPremul_SkAlphaType);
|
| + } else if (!isOpaque) {
|
| + fBitmap.eraseColor(SK_ColorTRANSPARENT);
|
| + }
|
| + }
|
| }
|
|
|
| SkBitmapDevice::~SkBitmapDevice() {
|
|
|