mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 1 | #ifndef DMUtil_DEFINED |
| 2 | #define DMUtil_DEFINED |
| 3 | |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 4 | #include "SkBenchmark.h" |
commit-bot@chromium.org | 66bb3d1 | 2013-10-16 19:13:38 +0000 | [diff] [blame] | 5 | #include "SkBitmap.h" |
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 6 | #include "SkString.h" |
| 7 | #include "gm_expectations.h" |
| 8 | |
commit-bot@chromium.org | 5fb2ce3 | 2014-04-17 23:35:06 +0000 | [diff] [blame] | 9 | class SkBBHFactory; |
robertphillips@google.com | 84b18c7 | 2014-04-13 19:09:42 +0000 | [diff] [blame] | 10 | |
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 11 | // Small free functions used in more than one place in DM. |
| 12 | |
| 13 | namespace DM { |
| 14 | |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 15 | // UnderJoin("a", "b") -> "a_b" |
| 16 | SkString UnderJoin(const char* a, const char* b); |
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 17 | |
robertphillips@google.com | 84b18c7 | 2014-04-13 19:09:42 +0000 | [diff] [blame] | 18 | // Draw gm to picture. Passes recordFlags to SkPictureRecorder::beginRecording(). |
skia.committer@gmail.com | 5199701 | 2014-04-14 03:04:57 +0000 | [diff] [blame] | 19 | SkPicture* RecordPicture(skiagm::GM* gm, |
| 20 | uint32_t recordFlags = 0, |
commit-bot@chromium.org | 5fb2ce3 | 2014-04-17 23:35:06 +0000 | [diff] [blame] | 21 | SkBBHFactory* factory = NULL); |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 22 | |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 23 | // Prepare bitmap to have gm or bench draw into it with this config. |
| 24 | // TODO(mtklein): make SkBenchmark::getSize()/GM::getISize() const. |
commit-bot@chromium.org | 15a1405 | 2014-02-16 00:59:25 +0000 | [diff] [blame] | 25 | void SetupBitmap(const SkColorType, skiagm::GM* gm, SkBitmap* bitmap); |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 26 | void SetupBitmap(const SkColorType, SkBenchmark* bench, SkBitmap* bitmap); |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 27 | |
| 28 | // Draw picture to bitmap. |
| 29 | void DrawPicture(SkPicture* picture, SkBitmap* bitmap); |
| 30 | |
| 31 | // Are these identical bitmaps? |
| 32 | bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b); |
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 33 | |
| 34 | } // namespace DM |
| 35 | |
| 36 | #endif // DMUtil_DEFINED |