| OLD | NEW |
| 1 #ifndef DMUtil_DEFINED | 1 #ifndef DMUtil_DEFINED |
| 2 #define DMUtil_DEFINED | 2 #define DMUtil_DEFINED |
| 3 | 3 |
| 4 #include "Benchmark.h" | 4 #include "Benchmark.h" |
| 5 #include "SkBitmap.h" | 5 #include "SkBitmap.h" |
| 6 #include "SkString.h" | 6 #include "SkString.h" |
| 7 #include "gm_expectations.h" | 7 #include "gm_expectations.h" |
| 8 | 8 |
| 9 class SkBBHFactory; | 9 class SkBBHFactory; |
| 10 | 10 |
| 11 // Small free functions used in more than one place in DM. | 11 // Small free functions used in more than one place in DM. |
| 12 | 12 |
| 13 namespace DM { | 13 namespace DM { |
| 14 | 14 |
| 15 // UnderJoin("a", "b") -> "a_b" | 15 // UnderJoin("a", "b") -> "a_b" |
| 16 SkString UnderJoin(const char* a, const char* b); | 16 SkString UnderJoin(const char* a, const char* b); |
| 17 | 17 |
| 18 // "foo_bar.skp" -> "foo-bar_skp" | 18 // "foo_bar.skp" -> "foo-bar_skp" |
| 19 SkString FileToTaskName(SkString); | 19 SkString FileToTaskName(SkString); |
| 20 | 20 |
| 21 // Draw gm to picture. Passes recordFlags to SkPictureRecorder::beginRecording(
). | 21 // Draw gm to picture. If skr is true, uses EXPERIMENTAL_beginRecording(). |
| 22 SkPicture* RecordPicture(skiagm::GM* gm, | 22 SkPicture* RecordPicture(skiagm::GM* gm, |
| 23 uint32_t recordFlags = 0, | 23 SkBBHFactory* factory = NULL, |
| 24 SkBBHFactory* factory = NULL); | 24 bool skr = false); |
| 25 | 25 |
| 26 // Allocate an empty bitmap with this size and depth. | 26 // Allocate an empty bitmap with this size and depth. |
| 27 void AllocatePixels(SkColorType, int w, int h, SkBitmap* bitmap); | 27 void AllocatePixels(SkColorType, int w, int h, SkBitmap* bitmap); |
| 28 // Allocate an empty bitmap the same size and depth as reference. | 28 // Allocate an empty bitmap the same size and depth as reference. |
| 29 void AllocatePixels(const SkBitmap& reference, SkBitmap* bitmap); | 29 void AllocatePixels(const SkBitmap& reference, SkBitmap* bitmap); |
| 30 | 30 |
| 31 // Draw picture to bitmap. | 31 // Draw picture to bitmap. |
| 32 void DrawPicture(SkPicture* picture, SkBitmap* bitmap); | 32 void DrawPicture(const SkPicture& picture, SkBitmap* bitmap); |
| 33 | 33 |
| 34 // What is the maximum component difference in these bitmaps? | 34 // What is the maximum component difference in these bitmaps? |
| 35 unsigned MaxComponentDifference(const SkBitmap& a, const SkBitmap& b); | 35 unsigned MaxComponentDifference(const SkBitmap& a, const SkBitmap& b); |
| 36 | 36 |
| 37 // Are these identical bitmaps? | 37 // Are these identical bitmaps? |
| 38 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b); | 38 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b); |
| 39 | 39 |
| 40 } // namespace DM | 40 } // namespace DM |
| 41 | 41 |
| 42 #endif // DMUtil_DEFINED | 42 #endif // DMUtil_DEFINED |
| OLD | NEW |