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

Unified Diff: src/core/SkCanvas.cpp

Issue 876923003: [SkSVGDevice] Initial clipping support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: win build warning Created 5 years, 10 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 | « include/core/SkClipStack.h ('k') | src/core/SkClipStack.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 5b37e08b305aa0b68e1b03de25fc816d94a04a57..56cfb8d652ad1e43867e7304c820f809d654d5eb 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1446,30 +1446,11 @@ void SkCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edg
fClipStack.clipDevPath(devPath, op, kSoft_ClipEdgeStyle == edgeStyle);
if (fAllowSimplifyClip) {
- devPath.reset();
- devPath.setFillType(SkPath::kInverseEvenOdd_FillType);
- const SkClipStack* clipStack = getClipStack();
- SkClipStack::Iter iter(*clipStack, SkClipStack::Iter::kBottom_IterStart);
- const SkClipStack::Element* element;
- while ((element = iter.next())) {
- SkClipStack::Element::Type type = element->getType();
- SkPath operand;
- if (type != SkClipStack::Element::kEmpty_Type) {
- element->asPath(&operand);
- }
- SkRegion::Op elementOp = element->getOp();
- if (elementOp == SkRegion::kReplace_Op) {
- devPath = operand;
- } else {
- Op(devPath, operand, (SkPathOp) elementOp, &devPath);
- }
- // if the prev and curr clips disagree about aa -vs- not, favor the aa request.
- // perhaps we need an API change to avoid this sort of mixed-signals about
- // clipping.
- if (element->isAA()) {
- edgeStyle = kSoft_ClipEdgeStyle;
- }
+ bool clipIsAA = getClipStack()->asPath(&devPath);
+ if (clipIsAA) {
+ edgeStyle = kSoft_ClipEdgeStyle;
}
+
op = SkRegion::kReplace_Op;
}
« no previous file with comments | « include/core/SkClipStack.h ('k') | src/core/SkClipStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698