diff options
Diffstat (limited to 'skia/ext/bitmap_platform_device_android.cc')
-rw-r--r-- | skia/ext/bitmap_platform_device_android.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/skia/ext/bitmap_platform_device_android.cc b/skia/ext/bitmap_platform_device_android.cc index f49b6a8..6a71fb2 100644 --- a/skia/ext/bitmap_platform_device_android.cc +++ b/skia/ext/bitmap_platform_device_android.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "skia/ext/bitmap_platform_device_android.h" +#include "skia/ext/platform_canvas.h" namespace skia { @@ -71,4 +72,18 @@ void BitmapPlatformDevice::DrawToNativeContext( SkASSERT(false); } +// Port of PlatformBitmap to android + +PlatformBitmap::~PlatformBitmap() {} + +bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) { + bitmap_.setConfig(SkBitmap::kARGB_8888_Config, width, height); + if (!bitmap_.allocPixels()) + return false; + + bitmap_.setIsOpaque(is_opaque); + surface_ = bitmap_.getPixels(); + return true; +} + } // namespace skia |