diff options
Diffstat (limited to 'src/core/SkClipStack.cpp')
-rw-r--r-- | src/core/SkClipStack.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp index c7d5359760..bc8c5c5d62 100644 --- a/src/core/SkClipStack.cpp +++ b/src/core/SkClipStack.cpp @@ -734,6 +734,10 @@ void SkClipStack::clipRRect(const SkRRect& rrect, const SkMatrix& matrix, SkClip if (rrect.transform(matrix, &transformedRRect)) { Element element(fSaveCount, transformedRRect, op, doAA); this->pushElement(element); + if (this->hasClipRestriction(op)) { + Element element(fSaveCount, fClipRestrictionRect, kIntersect_SkClipOp, false); + this->pushElement(element); + } return; } SkPath path; @@ -747,6 +751,11 @@ void SkClipStack::clipRect(const SkRect& rect, const SkMatrix& matrix, SkClipOp if (matrix.rectStaysRect()) { SkRect devRect; matrix.mapRect(&devRect, rect); + if (this->hasClipRestriction(op)) { + if (!devRect.intersect(fClipRestrictionRect)) { + devRect.setEmpty(); + } + } Element element(fSaveCount, devRect, op, doAA); this->pushElement(element); return; @@ -761,9 +770,12 @@ void SkClipStack::clipPath(const SkPath& path, const SkMatrix& matrix, SkClipOp bool doAA) { SkPath devPath; path.transform(matrix, &devPath); - Element element(fSaveCount, devPath, op, doAA); this->pushElement(element); + if (this->hasClipRestriction(op)) { + Element element(fSaveCount, fClipRestrictionRect, kIntersect_SkClipOp, false); + this->pushElement(element); + } } void SkClipStack::clipEmpty() { |