| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "sk_canvas.h" | 8 #include "sk_canvas.h" |
| 9 #include "sk_paint.h" | 9 #include "sk_paint.h" |
| 10 #include "sk_surface.h" | 10 #include "sk_surface.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 sk_paint_t* paint = sk_paint_new(); | 25 sk_paint_t* paint = sk_paint_new(); |
| 26 | 26 |
| 27 sk_canvas_t* canvas = sk_surface_get_canvas(surface); | 27 sk_canvas_t* canvas = sk_surface_get_canvas(surface); |
| 28 sk_canvas_draw_paint(canvas, paint); | 28 sk_canvas_draw_paint(canvas, paint); |
| 29 REPORTER_ASSERT(reporter, 0xFF000000 == pixel[0]); | 29 REPORTER_ASSERT(reporter, 0xFF000000 == pixel[0]); |
| 30 | 30 |
| 31 sk_paint_set_color(paint, sk_color_set_argb(0xFF, 0xFF, 0xFF, 0xFF)); | 31 sk_paint_set_color(paint, sk_color_set_argb(0xFF, 0xFF, 0xFF, 0xFF)); |
| 32 sk_canvas_draw_paint(canvas, paint); | 32 sk_canvas_draw_paint(canvas, paint); |
| 33 REPORTER_ASSERT(reporter, 0xFFFFFFFF == pixel[0]); | 33 REPORTER_ASSERT(reporter, 0xFFFFFFFF == pixel[0]); |
| 34 | 34 |
| 35 sk_paint_set_xfermode_mode(paint, SRC_SK_XFERMODE_MODE); |
| 36 sk_paint_set_color(paint, sk_color_set_argb(0x80, 0x80, 0x80, 0x80)); |
| 37 sk_canvas_draw_paint(canvas, paint); |
| 38 REPORTER_ASSERT(reporter, 0x80404040 == pixel[0]); |
| 39 |
| 35 sk_paint_delete(paint); | 40 sk_paint_delete(paint); |
| 36 sk_surface_unref(surface); | 41 sk_surface_unref(surface); |
| 37 } | 42 } |
| 38 | 43 |
| 39 DEF_TEST(C_API, reporter) { | 44 DEF_TEST(C_API, reporter) { |
| 40 test_c(reporter); | 45 test_c(reporter); |
| 41 } | 46 } |
| OLD | NEW |