[C API] Change the method signatures from & to * as this seems to cause issue in...
authorMatthew Leibowitz <mattleibow@live.com>
Fri, 5 Feb 2016 19:55:12 +0000 (21:55 +0200)
committerMatthew Leibowitz <mattleibow@live.com>
Fri, 5 Feb 2016 19:55:12 +0000 (21:55 +0200)
include/c/sk_canvas.h
include/c/sk_shader.h
src/c/sk_surface.cpp

index 87e34fe6e48e1a78e788a07a8e1480717969641d..d80f125a7d81e1cd7bf80d80c73bdd47375fc49d 100644 (file)
@@ -239,9 +239,9 @@ SK_API void sk_canvas_draw_pos_text (sk_canvas_t*, const char *text, size_t byte
 
 SK_API void sk_canvas_draw_text_on_path (sk_canvas_t*, const char *text, size_t byteLength, const sk_path_t*path, float hOffset, float vOffset, const sk_paint_t* paint);
 
-SK_API void sk_canvas_draw_bitmap(sk_canvas_t* ccanvas, const sk_bitmap_t& cbitmap, float x, float y, const sk_paint_t* cpaint);
+SK_API void sk_canvas_draw_bitmap(sk_canvas_t* ccanvas, const sk_bitmap_t* cbitmap, float x, float y, const sk_paint_t* cpaint);
 
-SK_API void sk_canvas_draw_bitmap_rect(sk_canvas_t* ccanvas, const sk_bitmap_t& cbitmap, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_paint_t* cpaint);
+SK_API void sk_canvas_draw_bitmap_rect(sk_canvas_t* ccanvas, const sk_bitmap_t* cbitmap, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_paint_t* cpaint);
 
 SK_C_PLUS_PLUS_END_GUARD
 
index b61e23ced17a971da4bc1033bd61577453b1abfc..26df162b3ee329878ce58bf98bdefee127f71615 100644 (file)
@@ -40,7 +40,7 @@ SK_API sk_shader_t* sk_shader_new_color(sk_color_t color);
     @param tmx  The tiling mode to use when sampling the bitmap in the x-direction.
     @param tmy  The tiling mode to use when sampling the bitmap in the y-direction.
 */
-SK_API sk_shader_t* sk_shader_new_bitmap(const sk_bitmap_t& src,
+SK_API sk_shader_t* sk_shader_new_bitmap(const sk_bitmap_t* src,
                                          sk_shader_tilemode_t tmx,
                                          sk_shader_tilemode_t tmy,
                                          const sk_matrix_t* localMatrix);
index 7a144ae35530d1e70737d2b890196f39f243cf4c..bedec73f9ee741ec083b13d08599a8aba8141a8b 100644 (file)
@@ -289,15 +289,15 @@ void sk_canvas_draw_text_on_path (sk_canvas_t* ccanvas, const char *text, size_t
     AsCanvas(ccanvas)->drawTextOnPathHV(text, byteLength, AsPath(*path), hOffset, vOffset, *AsPaint(cpaint));
 }
 
-void sk_canvas_draw_bitmap(sk_canvas_t* ccanvas, const sk_bitmap_t& cbitmap, float x, float y, const sk_paint_t* cpaint)
+void sk_canvas_draw_bitmap(sk_canvas_t* ccanvas, const sk_bitmap_t* cbitmap, float x, float y, const sk_paint_t* cpaint)
 {
-    AsCanvas(ccanvas)->drawBitmap(AsBitmap(cbitmap), x, y, AsPaint(cpaint));
+    AsCanvas(ccanvas)->drawBitmap(*AsBitmap(cbitmap), x, y, AsPaint(cpaint));
 }
 
-void sk_canvas_draw_bitmap_rect(sk_canvas_t* ccanvas, const sk_bitmap_t& cbitmap, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_paint_t* cpaint)
+void sk_canvas_draw_bitmap_rect(sk_canvas_t* ccanvas, const sk_bitmap_t* cbitmap, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_paint_t* cpaint)
 {
     SkCanvas* canvas = AsCanvas(ccanvas);
-    const SkBitmap& bitmap = AsBitmap(cbitmap);
+    const SkBitmap& bitmap = *AsBitmap(cbitmap);
     const SkRect& dst = AsRect(*cdstR);
     const SkPaint* paint = AsPaint(cpaint);
 
@@ -414,7 +414,7 @@ sk_shader_t* sk_shader_new_color(sk_color_t color) {
     return (sk_shader_t*) SkShader::CreateColorShader(color);
 }
 
-sk_shader_t* sk_shader_new_bitmap(const sk_bitmap_t& src,
+sk_shader_t* sk_shader_new_bitmap(const sk_bitmap_t* src,
                                   sk_shader_tilemode_t tmx,
                                   sk_shader_tilemode_t tmy,
                                   const sk_matrix_t* localMatrix) {
@@ -432,7 +432,7 @@ sk_shader_t* sk_shader_new_bitmap(const sk_bitmap_t& src,
     } else {
         matrix.setIdentity();
     }
-    SkShader* s = SkShader::CreateBitmapShader(AsBitmap(src), modex, modey, &matrix);
+    SkShader* s = SkShader::CreateBitmapShader(*AsBitmap(src), modex, modey, &matrix);
     return (sk_shader_t*)s;
 }