Index: tools/Checkerboard.h |
diff --git a/tools/Checkerboard.h b/tools/Checkerboard.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..eccbcd041972e850fa95188cb5cb8a31038f0b2b |
--- /dev/null |
+++ b/tools/Checkerboard.h |
@@ -0,0 +1,31 @@ |
+/* |
+ * Copyright 2015 Google Inc. |
tfarina
2015/01/07 20:15:48
Shouldn't this be Skia Authors rather than Google
|
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+#ifndef Checkerboard_DEFINED |
+#define Checkerboard_DEFINED |
+ |
+#include "SkColor.h" |
+ |
+class SkCanvas; |
+class SkShader; |
+ |
+namespace sk_tools { |
+ |
+/** Returns a newly created CheckerboardShader. */ |
+SkShader* CreateCheckerboardShader(SkColor c1, SkColor c2, int size); |
+ |
+/** Draw a checkerboard pattern in the current canvas, restricted to |
+ the current clip. */ |
+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() ?
|
+ |
+/** A default checkerboard. */ |
+inline void Checkerboard(SkCanvas* canvas) { |
+ Checkerboard(canvas, 0xFF999999, 0xFF666666, 8); |
+} |
+ |
+} // namespace sk_tools |
+ |
+#endif // Checkerboard_DEFINED |