Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: tools/Checkerboard.h

Issue 834303005: Factor out checkerboard function in gm and sampleapp into tools. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Another Patch Set Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleUnpremul.cpp ('k') | tools/Checkerboard.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « samplecode/SampleUnpremul.cpp ('k') | tools/Checkerboard.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698