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

Unified Diff: skia/ext/platform_canvas_linux.cc

Issue 18678: Linux Skia: add an option to build a canvas from a provided memory buffer (Closed)
Patch Set: ... Created 11 years, 11 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 | « skia/ext/platform_canvas_linux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/platform_canvas_linux.cc
diff --git a/skia/ext/platform_canvas_linux.cc b/skia/ext/platform_canvas_linux.cc
index 5c14707701806d73249df57bf08b0a45b4605ba9..d436fd765c2784788d7fb64e0f811b72d4144774 100644
--- a/skia/ext/platform_canvas_linux.cc
+++ b/skia/ext/platform_canvas_linux.cc
@@ -8,6 +8,8 @@
#include "skia/ext/bitmap_platform_device_linux.h"
#include "SkTypes.h"
+#include <cairo/cairo.h>
+
namespace skia {
PlatformCanvasLinux::PlatformCanvasLinux() : SkCanvas() {
@@ -52,4 +54,9 @@ SkDevice* PlatformCanvasLinux::createPlatformDevice(int width,
return BitmapPlatformDeviceLinux::Create(width, height, is_opaque);
}
+// static
+size_t PlatformCanvasLinux::StrideForWidth(unsigned width) {
+ return cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
+}
+
} // namespace skia
« no previous file with comments | « skia/ext/platform_canvas_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698