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

Unified Diff: dm/DMUtil.h

Issue 853883004: Revert of Sketch DM refactor. (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 | « dm/DMTestTask.cpp ('k') | dm/DMUtil.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMUtil.h
diff --git a/dm/DMUtil.h b/dm/DMUtil.h
new file mode 100644
index 0000000000000000000000000000000000000000..dfb7f920223ccc029fa39dbb73e74e646ec60ab7
--- /dev/null
+++ b/dm/DMUtil.h
@@ -0,0 +1,43 @@
+#ifndef DMUtil_DEFINED
+#define DMUtil_DEFINED
+
+#include "SkBitmap.h"
+#include "SkCanvas.h"
+#include "SkString.h"
+#include "gm.h"
+
+class SkBBHFactory;
+
+// Small free functions used in more than one place in DM.
+
+namespace DM {
+
+// UnderJoin("a", "b") -> "a_b"
+SkString UnderJoin(const char* a, const char* b);
+
+// "foo_bar.skp" -> "foo-bar_skp"
+SkString FileToTaskName(SkString);
+
+// Draw gm to picture.
+SkPicture* RecordPicture(skiagm::GM* gm, SkBBHFactory* factory = NULL);
+
+// Allocate an empty bitmap with this size and depth.
+void AllocatePixels(SkColorType, int w, int h, SkBitmap* bitmap);
+// Allocate an empty bitmap the same size and depth as reference.
+void AllocatePixels(const SkBitmap& reference, SkBitmap* bitmap);
+
+// Draw picture to bitmap.
+void DrawPicture(const SkPicture& picture, SkBitmap* bitmap);
+
+// What is the maximum component difference in these bitmaps?
+unsigned MaxComponentDifference(const SkBitmap& a, const SkBitmap& b);
+
+// Are these identical bitmaps?
+bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b);
+
+// Hook to modify canvas using global flag values (e.g. --matrix).
+void CanvasPreflight(SkCanvas*);
+
+} // namespace DM
+
+#endif // DMUtil_DEFINED
« no previous file with comments | « dm/DMTestTask.cpp ('k') | dm/DMUtil.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698