OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 #ifndef Checkerboard_DEFINED |
| 8 #define Checkerboard_DEFINED |
| 9 |
| 10 #include "SkColor.h" |
| 11 |
| 12 class SkCanvas; |
| 13 class SkShader; |
| 14 |
| 15 namespace sk_tools { |
| 16 |
| 17 /** Returns a newly created CheckerboardShader. */ |
| 18 SkShader* CreateCheckerboardShader(SkColor c1, SkColor c2, int size); |
| 19 |
| 20 /** Draw a checkerboard pattern in the current canvas, restricted to |
| 21 the current clip. */ |
| 22 void DrawCheckerboard(SkCanvas* canvas, |
| 23 SkColor color1, |
| 24 SkColor color2, |
| 25 int size); |
| 26 |
| 27 /** A default checkerboard. */ |
| 28 inline void DrawCheckerboard(SkCanvas* canvas) { |
| 29 sk_tools::DrawCheckerboard(canvas, 0xFF999999, 0xFF666666, 8); |
| 30 } |
| 31 |
| 32 } // namespace sk_tools |
| 33 |
| 34 #endif // Checkerboard_DEFINED |
OLD | NEW |