2013-10-16 13:02:15 +00:00
|
|
|
#ifndef DMUtil_DEFINED
|
|
|
|
#define DMUtil_DEFINED
|
|
|
|
|
2013-10-16 19:13:38 +00:00
|
|
|
#include "SkBitmap.h"
|
2013-10-16 13:02:15 +00:00
|
|
|
#include "SkString.h"
|
|
|
|
#include "gm_expectations.h"
|
|
|
|
|
|
|
|
// Small free functions used in more than one place in DM.
|
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
2013-10-21 18:40:25 +00:00
|
|
|
// UnderJoin("a", "b") -> "a_b"
|
|
|
|
SkString UnderJoin(const char* a, const char* b);
|
2013-10-16 13:02:15 +00:00
|
|
|
|
2013-10-21 18:40:25 +00:00
|
|
|
// Png("a") -> "a.png"
|
|
|
|
SkString Png(SkString s);
|
2013-10-16 13:02:15 +00:00
|
|
|
|
2013-10-30 20:45:28 +00:00
|
|
|
// Draw gm to picture. Passes recordFlags to SkPicture::beginRecording().
|
|
|
|
void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags = 0);
|
2013-10-21 18:40:25 +00:00
|
|
|
|
|
|
|
// Prepare bitmap to have gm draw into it with this config.
|
|
|
|
void SetupBitmap(const SkBitmap::Config config, skiagm::GM* gm, SkBitmap* bitmap);
|
|
|
|
|
|
|
|
// Draw picture to bitmap.
|
|
|
|
void DrawPicture(SkPicture* picture, SkBitmap* bitmap);
|
|
|
|
|
|
|
|
// Are these identical bitmaps?
|
|
|
|
bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b);
|
2013-10-16 13:02:15 +00:00
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
|
|
|
#endif // DMUtil_DEFINED
|