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 "Test.h" |
| 9 |
8 #include "sk_canvas.h" | 10 #include "sk_canvas.h" |
9 #include "sk_paint.h" | 11 #include "sk_paint.h" |
10 #include "sk_surface.h" | 12 #include "sk_surface.h" |
11 #include "sk_shader.h" | 13 #include "sk_shader.h" |
12 | 14 |
13 #include "Test.h" | |
14 | |
15 | |
16 static void shader_test(skiatest::Reporter* reporter) { | 15 static void shader_test(skiatest::Reporter* reporter) { |
17 sk_imageinfo_t info = | 16 sk_imageinfo_t info = |
18 {64, 64, sk_colortype_get_default_8888(), PREMUL_SK_ALPHATYPE}; | 17 {64, 64, sk_colortype_get_default_8888(), PREMUL_SK_ALPHATYPE}; |
19 sk_surface_t* surface = sk_surface_new_raster(&info, nullptr); | 18 sk_surface_t* surface = sk_surface_new_raster(&info, nullptr); |
20 sk_canvas_t* canvas = sk_surface_get_canvas(surface); | 19 sk_canvas_t* canvas = sk_surface_get_canvas(surface); |
21 sk_paint_t* paint = sk_paint_new(); | 20 sk_paint_t* paint = sk_paint_new(); |
22 | 21 |
23 sk_shader_tilemode_t tilemode = CLAMP_SK_SHADER_TILEMODE; | 22 sk_shader_tilemode_t tilemode = CLAMP_SK_SHADER_TILEMODE; |
24 sk_point_t point = {0.0f, 0.0f}; | 23 sk_point_t point = {0.0f, 0.0f}; |
25 sk_point_t point2 = {30.0f, 40.0f}; | 24 sk_point_t point2 = {30.0f, 40.0f}; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 REPORTER_ASSERT(reporter, 0x80404040 == pixel[0]); | 79 REPORTER_ASSERT(reporter, 0x80404040 == pixel[0]); |
81 | 80 |
82 sk_paint_delete(paint); | 81 sk_paint_delete(paint); |
83 sk_surface_unref(surface); | 82 sk_surface_unref(surface); |
84 } | 83 } |
85 | 84 |
86 DEF_TEST(C_API, reporter) { | 85 DEF_TEST(C_API, reporter) { |
87 test_c(reporter); | 86 test_c(reporter); |
88 shader_test(reporter); | 87 shader_test(reporter); |
89 } | 88 } |
OLD | NEW |