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

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: rename to sk_tools::DrawCheckerboard 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..b81e43616f684218da107d825f869abc132facf9
--- /dev/null
+++ b/tools/Checkerboard.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * 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 DrawCheckerboard(SkCanvas* canvas,
+ SkColor color1,
+ SkColor color2,
+ int size);
+
+/** A default checkerboard. */
+inline void DrawCheckerboard(SkCanvas* canvas) {
+ sk_tools::DrawCheckerboard(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