| OLD | NEW |
| 1 #ifndef DMUtil_DEFINED | 1 #ifndef DMUtil_DEFINED |
| 2 #define DMUtil_DEFINED | 2 #define DMUtil_DEFINED |
| 3 | 3 |
| 4 #include "SkBenchmark.h" | 4 #include "SkBenchmark.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 // Draw gm to picture. Passes recordFlags to SkPictureRecorder::beginRecording(
). | 18 // Draw gm to picture. Passes recordFlags to SkPictureRecorder::beginRecording(
). |
| 19 SkPicture* RecordPicture(skiagm::GM* gm, | 19 SkPicture* RecordPicture(skiagm::GM* gm, |
| 20 uint32_t recordFlags = 0, | 20 uint32_t recordFlags = 0, |
| 21 SkBBHFactory* factory = NULL); | 21 SkBBHFactory* factory = NULL); |
| 22 | 22 |
| 23 // Prepare bitmap to have gm or bench draw into it with this config. | 23 // Prepare bitmap to have gm, bench or picture draw into it with this config. |
| 24 // TODO(mtklein): make SkBenchmark::getSize()/GM::getISize() const. | 24 // TODO(mtklein): make SkBenchmark::getSize()/GM::getISize() const. |
| 25 void SetupBitmap(const SkColorType, skiagm::GM* gm, SkBitmap* bitmap); | 25 void SetupBitmap(SkColorType, skiagm::GM* gm, SkBitmap* bitmap); |
| 26 void SetupBitmap(const SkColorType, SkBenchmark* bench, SkBitmap* bitmap); | 26 void SetupBitmap(SkColorType, SkBenchmark* bench, SkBitmap* bitmap); |
| 27 void SetupBitmap(SkColorType, const SkPicture& picture, SkBitmap* bitmap); |
| 27 | 28 |
| 28 // Draw picture to bitmap. | 29 // Draw picture to bitmap. |
| 29 void DrawPicture(SkPicture* picture, SkBitmap* bitmap); | 30 void DrawPicture(SkPicture* picture, SkBitmap* bitmap); |
| 30 | 31 |
| 31 // Are these identical bitmaps? | 32 // Are these identical bitmaps? |
| 32 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b); | 33 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b); |
| 33 | 34 |
| 34 } // namespace DM | 35 } // namespace DM |
| 35 | 36 |
| 36 #endif // DMUtil_DEFINED | 37 #endif // DMUtil_DEFINED |
| OLD | NEW |