diff options
author | herb <herb@google.com> | 2016-06-10 13:01:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-10 13:01:27 -0700 |
commit | 7df9e4a87d84415391c167ea54cd389d4b423c2d (patch) | |
tree | 15314082e379437acef1acace3ae222cba6fb14f /src/core/SkSpriteBlitter.h | |
parent | a233620f9ce9d94272619ecf94962319faec693a (diff) |
Make SkBlitter hierarchy explicit about what needs to be implemented.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2053823002
Review-Url: https://codereview.chromium.org/2053823002
Diffstat (limited to 'src/core/SkSpriteBlitter.h')
-rw-r--r-- | src/core/SkSpriteBlitter.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/SkSpriteBlitter.h b/src/core/SkSpriteBlitter.h index 62c50c8b35..3a62860867 100644 --- a/src/core/SkSpriteBlitter.h +++ b/src/core/SkSpriteBlitter.h @@ -15,18 +15,23 @@ class SkPaint; +// SkSpriteBlitter specializes SkBlitter in a way to move large rectangles of pixels around. +// Because of this use, the main primitive shifts from blitH style things to the more efficient +// blitRect. class SkSpriteBlitter : public SkBlitter { public: SkSpriteBlitter(const SkPixmap& source); virtual void setup(const SkPixmap& dst, int left, int top, const SkPaint&); -#ifdef SK_DEBUG + // blitH, blitAntiH, blitV and blitMask should not be called on an SkSpriteBlitter. void blitH(int x, int y, int width) override; void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override; void blitV(int x, int y, int height, SkAlpha alpha) override; void blitMask(const SkMask&, const SkIRect& clip) override; -#endif + + // A SkSpriteBlitter must implement blitRect. + void blitRect(int x, int y, int width, int height) override = 0; static SkSpriteBlitter* ChooseD16(const SkPixmap& source, const SkPaint&, SkTBlitterAllocator*); static SkSpriteBlitter* ChooseL32(const SkPixmap& source, const SkPaint&, SkTBlitterAllocator*); @@ -38,6 +43,9 @@ protected: const SkPixmap fSource; int fLeft, fTop; const SkPaint* fPaint; + +private: + typedef SkBlitter INHERITED; }; #endif |