| 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 SkPictureFactory; |
| 10 |
| 9 // Small free functions used in more than one place in DM. | 11 // Small free functions used in more than one place in DM. |
| 10 | 12 |
| 11 namespace DM { | 13 namespace DM { |
| 12 | 14 |
| 13 // UnderJoin("a", "b") -> "a_b" | 15 // UnderJoin("a", "b") -> "a_b" |
| 14 SkString UnderJoin(const char* a, const char* b); | 16 SkString UnderJoin(const char* a, const char* b); |
| 15 | 17 |
| 16 // Draw gm to picture. Passes recordFlags to SkPicture::beginRecording(). | 18 // Draw gm to picture. Passes recordFlags to SkPictureRecorder::beginRecording(
). |
| 17 void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags = 0)
; | 19 SkPicture* RecordPicture(skiagm::GM* gm, |
| 20 uint32_t recordFlags = 0, |
| 21 SkPictureFactory* factory = NULL); |
| 18 | 22 |
| 19 // Prepare bitmap to have gm or bench draw into it with this config. | 23 // Prepare bitmap to have gm or bench draw into it with this config. |
| 20 // TODO(mtklein): make SkBenchmark::getSize()/GM::getISize() const. | 24 // TODO(mtklein): make SkBenchmark::getSize()/GM::getISize() const. |
| 21 void SetupBitmap(const SkColorType, skiagm::GM* gm, SkBitmap* bitmap); | 25 void SetupBitmap(const SkColorType, skiagm::GM* gm, SkBitmap* bitmap); |
| 22 void SetupBitmap(const SkColorType, SkBenchmark* bench, SkBitmap* bitmap); | 26 void SetupBitmap(const SkColorType, SkBenchmark* bench, SkBitmap* bitmap); |
| 23 | 27 |
| 24 // Draw picture to bitmap. | 28 // Draw picture to bitmap. |
| 25 void DrawPicture(SkPicture* picture, SkBitmap* bitmap); | 29 void DrawPicture(SkPicture* picture, SkBitmap* bitmap); |
| 26 | 30 |
| 27 // Are these identical bitmaps? | 31 // Are these identical bitmaps? |
| 28 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b); | 32 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b); |
| 29 | 33 |
| 30 } // namespace DM | 34 } // namespace DM |
| 31 | 35 |
| 32 #endif // DMUtil_DEFINED | 36 #endif // DMUtil_DEFINED |
| OLD | NEW |