Index: src/core/SkBlitter_Sprite.cpp |
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp |
index dc912b0f65a6b00942ff36678a0b7a5755b2e507..90e38f498ac8fba42e2e561ff30000a2c1b1b836 100644 |
--- a/src/core/SkBlitter_Sprite.cpp |
+++ b/src/core/SkBlitter_Sprite.cpp |
@@ -9,7 +9,8 @@ |
#include "SkSmallAllocator.h" |
#include "SkSpriteBlitter.h" |
-SkSpriteBlitter::SkSpriteBlitter(const SkPixmap& source) : fSource(source) {} |
+SkSpriteBlitter::SkSpriteBlitter(const SkPixmap& source) |
+ : fSource(source) {} |
void SkSpriteBlitter::setup(const SkPixmap& dst, int left, int top, const SkPaint& paint) { |
fDst = dst; |
@@ -18,24 +19,32 @@ void SkSpriteBlitter::setup(const SkPixmap& dst, int left, int top, const SkPain |
fPaint = &paint; |
} |
-#ifdef SK_DEBUG |
void SkSpriteBlitter::blitH(int x, int y, int width) { |
SkDEBUGFAIL("how did we get here?"); |
+ |
+ // Fallback to blitRect. |
+ this->blitRect(x, y, width, 1); |
} |
-void SkSpriteBlitter::blitAntiH(int x, int y, const SkAlpha antialias[], |
- const int16_t runs[]) { |
+void SkSpriteBlitter::blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) { |
SkDEBUGFAIL("how did we get here?"); |
+ |
+ // No fallback strategy. |
} |
void SkSpriteBlitter::blitV(int x, int y, int height, SkAlpha alpha) { |
SkDEBUGFAIL("how did we get here?"); |
+ |
+ // Fall back to superclass if the code gets here in release mode. |
+ INHERITED::blitV(x, y, height, alpha); |
} |
-void SkSpriteBlitter::blitMask(const SkMask&, const SkIRect& clip) { |
+void SkSpriteBlitter::blitMask(const SkMask& mask, const SkIRect& clip) { |
SkDEBUGFAIL("how did we get here?"); |
+ |
+ // Fall back to superclass if the code gets here in release mode. |
+ INHERITED::blitMask(mask, clip); |
} |
-#endif |
/////////////////////////////////////////////////////////////////////////////// |
@@ -44,7 +53,7 @@ void SkSpriteBlitter::blitMask(const SkMask&, const SkIRect& clip) { |
// 2. paint has no modifiers (i.e. alpha, colorfilter, etc.) |
// 3. xfermode needs no blending: e.g. kSrc_Mode or kSrcOver_Mode + opaque src |
// |
-class SkSpriteBlitter_Src_SrcOver : public SkSpriteBlitter { |
+class SkSpriteBlitter_Src_SrcOver final : public SkSpriteBlitter { |
public: |
static bool Supports(const SkPixmap& dst, const SkPixmap& src, const SkPaint& paint) { |
if (dst.colorType() != src.colorType()) { |
@@ -80,7 +89,8 @@ public: |
return SkXfermode::kSrcOver_Mode == mode; |
} |
- SkSpriteBlitter_Src_SrcOver(const SkPixmap& src) : INHERITED(src) {} |
+ SkSpriteBlitter_Src_SrcOver(const SkPixmap& src) |
+ : INHERITED(src) {} |
void setup(const SkPixmap& dst, int left, int top, const SkPaint& paint) override { |
SkASSERT(Supports(dst, fSource, paint)); |