Skip left/right if alpha = 0 in SkRectClipCheckBlitter::blitAntiRect
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4684
Change-Id: I8c5e5f460dba76f9d74718f7ea104cb1f3cea993
Reviewed-on: https://skia-review.googlesource.com/4684
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index e5c935b..b814325 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -1052,7 +1052,10 @@
void SkRectClipCheckBlitter::blitAntiRect(int x, int y, int width, int height,
SkAlpha leftAlpha, SkAlpha rightAlpha) {
- SkASSERT(fClipRect.contains(SkIRect::MakeXYWH(x, y, width + 2, height)));
+ bool skipLeft = !leftAlpha;
+ bool skipRight = !rightAlpha;
+ SkASSERT(fClipRect.contains(SkIRect::MakeXYWH(x + skipLeft, y,
+ width + 2 - skipRight - skipLeft, height)));
fBlitter->blitAntiRect(x, y, width, height, leftAlpha, rightAlpha);
}