blob: faa4e39737fe8af007e28da726a519577ac52247 [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#ifndef DMUtil_DEFINED
2#define DMUtil_DEFINED
3
commit-bot@chromium.org38aeb0f2014-02-26 23:01:57 +00004#include "SkBenchmark.h"
commit-bot@chromium.org66bb3d12013-10-16 19:13:38 +00005#include "SkBitmap.h"
mtklein@google.comd36522d2013-10-16 13:02:15 +00006#include "SkString.h"
7#include "gm_expectations.h"
8
9// Small free functions used in more than one place in DM.
10
11namespace DM {
12
commit-bot@chromium.org192cbf62013-10-21 18:40:25 +000013// UnderJoin("a", "b") -> "a_b"
14SkString UnderJoin(const char* a, const char* b);
mtklein@google.comd36522d2013-10-16 13:02:15 +000015
commit-bot@chromium.orgc1362422013-10-30 20:45:28 +000016// Draw gm to picture. Passes recordFlags to SkPicture::beginRecording().
17void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags = 0);
commit-bot@chromium.org192cbf62013-10-21 18:40:25 +000018
commit-bot@chromium.org38aeb0f2014-02-26 23:01:57 +000019// Prepare bitmap to have gm or bench draw into it with this config.
20// TODO(mtklein): make SkBenchmark::getSize()/GM::getISize() const.
commit-bot@chromium.org15a14052014-02-16 00:59:25 +000021void SetupBitmap(const SkColorType, skiagm::GM* gm, SkBitmap* bitmap);
commit-bot@chromium.org38aeb0f2014-02-26 23:01:57 +000022void SetupBitmap(const SkColorType, SkBenchmark* bench, SkBitmap* bitmap);
commit-bot@chromium.org192cbf62013-10-21 18:40:25 +000023
24// Draw picture to bitmap.
25void DrawPicture(SkPicture* picture, SkBitmap* bitmap);
26
27// Are these identical bitmaps?
28bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b);
mtklein@google.comd36522d2013-10-16 13:02:15 +000029
30} // namespace DM
31
32#endif // DMUtil_DEFINED