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 #ifndef sk_tool_utils_DEFINED | 8 #ifndef sk_tool_utils_DEFINED |
9 #define sk_tool_utils_DEFINED | 9 #define sk_tool_utils_DEFINED |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); | 37 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); |
38 | 38 |
39 // private to sk_tool_utils | 39 // private to sk_tool_utils |
40 SkTypeface* create_font(const char* name, SkTypeface::Style ); | 40 SkTypeface* create_font(const char* name, SkTypeface::Style ); |
41 SkTypeface* resource_font(const char* name, SkTypeface::Style ); | 41 SkTypeface* resource_font(const char* name, SkTypeface::Style ); |
42 | 42 |
43 /** Returns a newly created CheckerboardShader. */ | 43 /** Returns a newly created CheckerboardShader. */ |
44 SkShader* create_checkerboard_shader(SkColor c1, SkColor c2, int size); | 44 SkShader* create_checkerboard_shader(SkColor c1, SkColor c2, int size); |
45 | 45 |
46 /** Draw a checkerboard pattern in the current canvas, restricted to | 46 /** Draw a checkerboard pattern in the current canvas, restricted to |
47 the current clip. */ | 47 the current clip, using SkXfermode::kSrc_Mode. */ |
48 void draw_checkerboard(SkCanvas* canvas, | 48 void draw_checkerboard(SkCanvas* canvas, |
49 SkColor color1, | 49 SkColor color1, |
50 SkColor color2, | 50 SkColor color2, |
51 int size); | 51 int size); |
52 | 52 |
53 /** A default checkerboard. */ | 53 /** A default checkerboard. */ |
54 inline void draw_checkerboard(SkCanvas* canvas) { | 54 inline void draw_checkerboard(SkCanvas* canvas) { |
55 sk_tool_utils::draw_checkerboard(canvas, 0xFF999999, 0xFF666666, 8); | 55 sk_tool_utils::draw_checkerboard(canvas, 0xFF999999, 0xFF666666, 8); |
56 } | 56 } |
57 | 57 |
58 } // namespace sk_tool_utils | 58 } // namespace sk_tool_utils |
59 | 59 |
60 #endif // sk_tool_utils_DEFINED | 60 #endif // sk_tool_utils_DEFINED |
OLD | NEW |