diff options
author | 2018-06-05 09:55:17 -0400 | |
---|---|---|
committer | 2018-06-05 14:31:58 +0000 | |
commit | 1b7cd334f8d6de2e31396eb0d2a8ad3a99c1d221 (patch) | |
tree | 472757758bbe36020f61cd9b42aa15ad0e69efad /src | |
parent | 77169c8fd6d8b035fb113fdf6b85def0617b94a4 (diff) |
handle degenerate call to blitAntiRect
Bug: skia:8043
Change-Id: Ief3653a748a1e82bd5ca9df3dd7743797e0160e8
Reviewed-on: https://skia-review.googlesource.com/132086
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkAAClip.cpp | 15 | ||||
-rw-r--r-- | src/core/SkBlitter.cpp | 6 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp index b22b8ebebb..78c73931fe 100644 --- a/src/core/SkAAClip.cpp +++ b/src/core/SkAAClip.cpp @@ -1065,13 +1065,16 @@ public: this->addRun(x + width, y, rightAlpha, 1); } - // we assume the rect must be all we'll see for these scanlines - // so we ensure our row goes all the way to our right - this->flushRowH(fCurrRow); + // if we never called addRun, we might not have a fCurrRow yet + if (fCurrRow) { + // we assume the rect must be all we'll see for these scanlines + // so we ensure our row goes all the way to our right + this->flushRowH(fCurrRow); - y -= fBounds.fTop; - SkASSERT(y == fCurrRow->fY); - fCurrRow->fY = y + height - 1; + y -= fBounds.fTop; + SkASSERT(y == fCurrRow->fY); + fCurrRow->fY = y + height - 1; + } } bool finish(SkAAClip* target) { diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index 5cf8147019..9c72302876 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -1205,8 +1205,10 @@ void SkRectClipCheckBlitter::blitAntiRect(int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha) { bool skipLeft = !leftAlpha; bool skipRight = !rightAlpha; - SkASSERT(fClipRect.contains(SkIRect::MakeXYWH(x + skipLeft, y, - width + 2 - skipRight - skipLeft, height))); +#ifdef SK_DEBUG + SkIRect r = SkIRect::MakeXYWH(x + skipLeft, y, width + 2 - skipRight - skipLeft, height); + SkASSERT(r.isEmpty() || fClipRect.contains(r)); +#endif fBlitter->blitAntiRect(x, y, width, height, leftAlpha, rightAlpha); } |