skia2/dm/DMQuiltTask.h
mtklein 7cdc1ee115 Add always-threaded SkRecord quilt tests.
Now that we're drawing tiles threaded like implside painting, remove the checks
that those lock counts are balanced.  They're just not right for anyone anymore.

SkBitmaps themselves are not threadsafe (even const ones), so shallow copy them
on playback of an SkRecord.  (The underlying SkPixelRefs are threadsafe.)

Simplify quilt drawing by using SkBitmap::extractSubset.  No need for locking.

Bump up to 256x256 tiles.  16x16 tiles just murders performance (way too much
contention).  This has the nice side effect of letting us enable a bunch more
GMs for quilt mode; they drew wrong with small tiles but exactly right with large.

BUG=171776
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/371023005
2014-07-07 10:41:04 -07:00

41 lines
1012 B
C++

#ifndef DMQuiltTask_DEFINED
#define DMQuiltTask_DEFINED
#include "DMTask.h"
#include "SkBitmap.h"
#include "SkString.h"
#include "SkTemplates.h"
#include "gm.h"
// Records a GM through an SkPicture, draws it in tiles, and compares against the reference bitmap.
namespace DM {
class QuiltTask : public CpuTask {
public:
enum Mode {
kNormal_Mode,
kSkRecord_Mode,
};
QuiltTask(const Task& parent, // QuiltTask must be a child task. Pass its parent here.
skiagm::GM*, // GM to run through a picture. Takes ownership.
SkBitmap reference, // Bitmap to compare picture replay results to.
Mode mode);
virtual void draw() SK_OVERRIDE;
virtual bool shouldSkip() const SK_OVERRIDE;
virtual SkString name() const SK_OVERRIDE { return fName; }
private:
const Mode fMode;
const SkString fName;
SkAutoTDelete<skiagm::GM> fGM;
const SkBitmap fReference;
};
} // namespace DM
#endif // DMReplayTask_DEFINED