blob: b887d828d49061db0a7d2e12a0817a06efbf423c [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#ifndef DMUtil_DEFINED
2#define DMUtil_DEFINED
3
commit-bot@chromium.org66bb3d12013-10-16 19:13:38 +00004#include "SkBitmap.h"
mtklein@google.comd36522d2013-10-16 13:02:15 +00005#include "SkString.h"
6#include "gm_expectations.h"
7
8// Small free functions used in more than one place in DM.
9
10namespace DM {
11
commit-bot@chromium.org192cbf62013-10-21 18:40:25 +000012// UnderJoin("a", "b") -> "a_b"
13SkString UnderJoin(const char* a, const char* b);
mtklein@google.comd36522d2013-10-16 13:02:15 +000014
commit-bot@chromium.orgc1362422013-10-30 20:45:28 +000015// Draw gm to picture. Passes recordFlags to SkPicture::beginRecording().
16void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags = 0);
commit-bot@chromium.org192cbf62013-10-21 18:40:25 +000017
18// Prepare bitmap to have gm draw into it with this config.
19void SetupBitmap(const SkBitmap::Config config, skiagm::GM* gm, SkBitmap* bitmap);
20
21// Draw picture to bitmap.
22void DrawPicture(SkPicture* picture, SkBitmap* bitmap);
23
24// Are these identical bitmaps?
25bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b);
mtklein@google.comd36522d2013-10-16 13:02:15 +000026
27} // namespace DM
28
29#endif // DMUtil_DEFINED