skia2/dm/DMUtil.h
commit-bot@chromium.org 5fb2ce38b3 Staged removal of SkPicture-derived classes
This CL removes the SkPicture-derived classes (with a flag to keeps clients working). In the process it also lightens the recording factory function so it is no longer ref counted).

The only interesting bits are in SkPicture* and Sk*Picture.*

R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/238273012

git-svn-id: http://skia.googlecode.com/svn/trunk@14251 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-17 23:35:06 +00:00

37 lines
1.0 KiB
C++

#ifndef DMUtil_DEFINED
#define DMUtil_DEFINED
#include "SkBenchmark.h"
#include "SkBitmap.h"
#include "SkString.h"
#include "gm_expectations.h"
class SkBBHFactory;
// Small free functions used in more than one place in DM.
namespace DM {
// UnderJoin("a", "b") -> "a_b"
SkString UnderJoin(const char* a, const char* b);
// Draw gm to picture. Passes recordFlags to SkPictureRecorder::beginRecording().
SkPicture* RecordPicture(skiagm::GM* gm,
uint32_t recordFlags = 0,
SkBBHFactory* factory = NULL);
// Prepare bitmap to have gm or bench draw into it with this config.
// TODO(mtklein): make SkBenchmark::getSize()/GM::getISize() const.
void SetupBitmap(const SkColorType, skiagm::GM* gm, SkBitmap* bitmap);
void SetupBitmap(const SkColorType, SkBenchmark* bench, SkBitmap* bitmap);
// Draw picture to bitmap.
void DrawPicture(SkPicture* picture, SkBitmap* bitmap);
// Are these identical bitmaps?
bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b);
} // namespace DM
#endif // DMUtil_DEFINED