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

Unified Diff: src/c/sk_surface.cpp

Issue 1261953006: C API: remove dead code, simplify boilerplate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « include/c/sk_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/c/sk_surface.cpp
diff --git a/src/c/sk_surface.cpp b/src/c/sk_surface.cpp
index 5b6210d19dfeba771ee93118d43552709983cd73..1e676ffe7c1a7020abe19ae4cf011a0f192cde42 100644
--- a/src/c/sk_surface.cpp
+++ b/src/c/sk_surface.cpp
@@ -625,50 +625,3 @@ const void* sk_data_get_data(const sk_data_t* cdata) {
}
///////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////
-
-void sk_test_capi(SkCanvas* canvas) {
- sk_imageinfo_t cinfo;
- cinfo.width = 100;
- cinfo.height = 100;
- cinfo.colorType = (sk_colortype_t)kN32_SkColorType;
- cinfo.alphaType = (sk_alphatype_t)kPremul_SkAlphaType;
-
- sk_surfaceprops_t surfaceprops;
- surfaceprops.pixelGeometry = UNKNOWN_SK_PIXELGEOMETRY;
-
- sk_surface_t* csurface = sk_surface_new_raster(&cinfo, &surfaceprops);
- sk_canvas_t* ccanvas = sk_surface_get_canvas(csurface);
-
- sk_paint_t* cpaint = sk_paint_new();
- sk_paint_set_antialias(cpaint, true);
- sk_paint_set_color(cpaint, 0xFFFF0000);
-
- sk_rect_t cr = { 5, 5, 95, 95 };
- sk_canvas_draw_oval(ccanvas, &cr, cpaint);
-
- cr.left += 25;
- cr.top += 25;
- cr.right -= 25;
- cr.bottom -= 25;
- sk_paint_set_color(cpaint, 0xFF00FF00);
- sk_canvas_draw_rect(ccanvas, &cr, cpaint);
-
- sk_path_t* cpath = sk_path_new();
- sk_path_move_to(cpath, 50, 50);
- sk_path_line_to(cpath, 100, 100);
- sk_path_line_to(cpath, 50, 100);
- sk_path_close(cpath);
-
- sk_canvas_draw_path(ccanvas, cpath, cpaint);
-
- sk_image_t* cimage = sk_surface_new_image_snapshot(csurface);
-
- // HERE WE CROSS THE C..C++ boundary
- canvas->drawImage((const SkImage*)cimage, 20, 20, NULL);
-
- sk_path_delete(cpath);
- sk_paint_delete(cpaint);
- sk_image_unref(cimage);
- sk_surface_unref(csurface);
-}
« no previous file with comments | « include/c/sk_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698