Home | History | Annotate | Download | only in dm
      1 #ifndef DMUtil_DEFINED
      2 #define DMUtil_DEFINED
      3 
      4 #include "SkBitmap.h"
      5 #include "SkString.h"
      6 #include "gm_expectations.h"
      7 
      8 // Small free functions used in more than one place in DM.
      9 
     10 namespace DM {
     11 
     12 // UnderJoin("a", "b") -> "a_b"
     13 SkString UnderJoin(const char* a, const char* b);
     14 
     15 // Draw gm to picture.  Passes recordFlags to SkPicture::beginRecording().
     16 void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags = 0);
     17 
     18 // Prepare bitmap to have gm draw into it with this config.
     19 void SetupBitmap(const SkBitmap::Config config, skiagm::GM* gm, SkBitmap* bitmap);
     20 
     21 // Draw picture to bitmap.
     22 void DrawPicture(SkPicture* picture, SkBitmap* bitmap);
     23 
     24 // Are these identical bitmaps?
     25 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b);
     26 
     27 }  // namespace DM
     28 
     29 #endif  // DMUtil_DEFINED
     30