Chromium Code Reviews| Index: skia/ext/bitmap_platform_device_android.cc |
| =================================================================== |
| --- skia/ext/bitmap_platform_device_android.cc (revision 160846) |
| +++ skia/ext/bitmap_platform_device_android.cc (working copy) |
| @@ -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,25 @@ |
| SkASSERT(false); |
| } |
| +// Port of PlatformBitmap to android |
| + |
| +PlatformBitmap::~PlatformBitmap() {} |
| + |
| +bool PlatformBitmap::Allocate(int width, int height, bool isOpaque) { |
|
brettw
2012/10/09 20:40:12
is_opaque. Same for other ports.
|
| + bitmap_.setConfig(SkBitmap::kARGB_8888_Config, width, height); |
| + if (!bitmap_.allocPixels()) |
| + return false; |
| + |
| + bitmap_.setIsOpaque(isOpaque); |
| + return true; |
| +} |
| + |
| +PlatformSurface PlatformBitmap::LockSurface() { |
| + return bitmap_.getPixels(); |
| +} |
| + |
| +void PlatformBitmap::UnlockSurface() { |
| + // nothing to do for our "surface", as it is just our pixel address. |
| +} |
| + |
| } // namespace skia |