Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: skia/ext/bitmap_platform_device_android.cc

Issue 11031055: Introduce PlatformBitmap, which is a minimal helper class that wraps an SkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/render_widget_host.h ('k') | skia/ext/bitmap_platform_device_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_android.cc
===================================================================
--- skia/ext/bitmap_platform_device_android.cc (revision 161107)
+++ 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,18 @@
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
« no previous file with comments | « content/public/browser/render_widget_host.h ('k') | skia/ext/bitmap_platform_device_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698