Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 Google Inc. | |
|
tfarina
2015/01/07 20:15:48
Shouldn't this be Skia Authors rather than Google
| |
| 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 Checkerboard(SkCanvas* canvas, SkColor color1, SkColor color2, int size); | |
|
bsalomon
2015/01/26 18:56:31
lgtm, but maybe rename this function to be a bit m
hal.canary
2015/01/26 19:01:00
DrawWithCheckerboard() ?
| |
| 23 | |
| 24 /** A default checkerboard. */ | |
| 25 inline void Checkerboard(SkCanvas* canvas) { | |
| 26 Checkerboard(canvas, 0xFF999999, 0xFF666666, 8); | |
| 27 } | |
| 28 | |
| 29 } // namespace sk_tools | |
| 30 | |
| 31 #endif // Checkerboard_DEFINED | |
| OLD | NEW |