Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: src/core/SkSpriteBlitter.h

Issue 2053823002: Make SkBlitter hierarchy explicit about what needs to be implemented. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRegion_path.cpp ('k') | tests/BlitMaskClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSpriteBlitter.h
diff --git a/src/core/SkSpriteBlitter.h b/src/core/SkSpriteBlitter.h
index 62c50c8b35c267f3e1461ff2468e77dd9d48bcf6..3a62860867901c4075a47e3e2d37104c254ae0da 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
« no previous file with comments | « src/core/SkRegion_path.cpp ('k') | tests/BlitMaskClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698