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

Unified Diff: tools/sk_tool_utils.h

Issue 873333004: s/sk_tools::DrawCheckerboard/sk_tool_utils::draw_checkerboard/ (Closed) Base URL: https://skia.googlesource.com/skia.git@master
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 | « tools/Checkerboard.cpp ('k') | tools/sk_tool_utils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sk_tool_utils.h
diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h
index e9bda5f982a12d7de6d7fd3c2e5a92602155c46d..faf57f3ba4015f3dc8db1973af072c16205095a5 100644
--- a/tools/sk_tool_utils.h
+++ b/tools/sk_tool_utils.h
@@ -8,12 +8,14 @@
#ifndef sk_tool_utils_DEFINED
#define sk_tool_utils_DEFINED
+#include "SkColor.h"
#include "SkImageInfo.h"
#include "SkTypeface.h"
class SkBitmap;
class SkCanvas;
class SkPaint;
+class SkShader;
class SkTestFont;
namespace sk_tool_utils {
@@ -38,6 +40,21 @@ namespace sk_tool_utils {
SkTypeface* create_font(const char* name, SkTypeface::Style );
SkTypeface* resource_font(const char* name, SkTypeface::Style );
+ /** Returns a newly created CheckerboardShader. */
+ SkShader* create_checkerboard_shader(SkColor c1, SkColor c2, int size);
+
+ /** Draw a checkerboard pattern in the current canvas, restricted to
+ the current clip. */
+ void draw_checkerboard(SkCanvas* canvas,
+ SkColor color1,
+ SkColor color2,
+ int size);
+
+ /** A default checkerboard. */
+ inline void draw_checkerboard(SkCanvas* canvas) {
+ sk_tool_utils::draw_checkerboard(canvas, 0xFF999999, 0xFF666666, 8);
+ }
+
} // namespace sk_tool_utils
#endif // sk_tool_utils_DEFINED
« no previous file with comments | « tools/Checkerboard.cpp ('k') | tools/sk_tool_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698