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

Unified Diff: include/c/sk_surface.h

Issue 665203004: move c api into include (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « gyp/tests.gypi ('k') | src/c/sk_surface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/c/sk_surface.h
diff --git a/experimental/sk_surface.h b/include/c/sk_surface.h
similarity index 86%
rename from experimental/sk_surface.h
rename to include/c/sk_surface.h
index e170049a4bdef0e9a22e093eefb72b1e3f2de9ce..960c331d2d171a87dc01ac92339ca0ae6b1886fc 100644
--- a/experimental/sk_surface.h
+++ b/include/c/sk_surface.h
@@ -5,6 +5,9 @@
* found in the LICENSE file.
*/
+// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
+// DO NOT USE -- FOR INTERNAL TESTING ONLY
+
#ifndef sk_types_DEFINED
#define sk_types_DEFINED
@@ -31,10 +34,13 @@ typedef enum {
} sk_colortype_t;
typedef enum {
+ OPAQUE_SK_ALPHATYPE,
PREMUL_SK_ALPHATYPE,
UNPREMUL_SK_ALPHATYPE,
} sk_alphatype_t;
+sk_colortype_t sk_colortype_get_default_8888();
+
typedef struct {
int32_t width;
int32_t height;
@@ -83,6 +89,10 @@ void sk_canvas_draw_oval(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);
void sk_canvas_draw_path(sk_canvas_t*, const sk_path_t*, const sk_paint_t*);
void sk_canvas_draw_image(sk_canvas_t*, const sk_image_t*, float x, float y, const sk_paint_t*);
+/**
+ * Return a new image that has made a copy of the provided pixels, or NULL on failure.
+ * Balance with a call to sk_image_unref().
+ */
sk_image_t* sk_image_new_raster_copy(const sk_imageinfo_t*, const void* pixels, size_t rowBytes);
void sk_image_ref(const sk_image_t*);
void sk_image_unref(const sk_image_t*);
@@ -95,6 +105,11 @@ typedef struct sk_surface_t sk_surface_t;
sk_surface_t* sk_surface_new_raster(const sk_imageinfo_t*);
sk_surface_t* sk_surface_new_raster_direct(const sk_imageinfo_t*, void* pixels, size_t rowBytes);
void sk_surface_delete(sk_surface_t*);
+
+/**
+ * Return the canvas associated with this surface. Note: the canvas is owned by the surface,
+ * so the returned object is only valid while the owning surface is valid.
+ */
sk_canvas_t* sk_surface_get_canvas(sk_surface_t*);
sk_image_t* sk_surface_new_image_snapshot(sk_surface_t*);
« no previous file with comments | « gyp/tests.gypi ('k') | src/c/sk_surface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698