Revert of simplify clip inside a layer -- will be applied in restore (patchset #2 id:20001 of https://codereview.chromium.org/997763002/)
Reason for revert: slight rebaselines needed in layouttests http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/51755 Original issue's description: > simplify clip inside a layer -- will be applied in restore > > BUG=skia: > TBR= > NOTREECHECKS=True > > speculative land to measure performance > > Committed: https://skia.googlesource.com/skia/+/c275493d4247a2c5ae845d340c4297258f4684bc TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/997103002
This commit is contained in:
parent
c275493d42
commit
4412465089
@ -833,6 +833,7 @@ static bool bounds_affects_clip(SkCanvas::SaveFlags flags) {
|
||||
bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags,
|
||||
SkIRect* intersection, const SkImageFilter* imageFilter) {
|
||||
SkIRect clipBounds;
|
||||
SkRegion::Op op = SkRegion::kIntersect_Op;
|
||||
if (!this->getClipDeviceBounds(&clipBounds)) {
|
||||
return false;
|
||||
}
|
||||
@ -841,6 +842,8 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags,
|
||||
|
||||
if (imageFilter) {
|
||||
imageFilter->filterBounds(clipBounds, ctm, &clipBounds);
|
||||
// Filters may grow the bounds beyond the device bounds.
|
||||
op = SkRegion::kReplace_Op;
|
||||
}
|
||||
SkIRect ir;
|
||||
if (bounds) {
|
||||
@ -860,10 +863,9 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags,
|
||||
}
|
||||
|
||||
if (bounds_affects_clip(flags)) {
|
||||
// Simplify the current clips since they will be applied properly during restore()
|
||||
fClipStack->clipDevRect(ir, SkRegion::kReplace_Op);
|
||||
fClipStack->clipDevRect(ir, op);
|
||||
// early exit if the clip is now empty
|
||||
if (!fMCRec->fRasterClip.op(ir, SkRegion::kReplace_Op)) {
|
||||
if (!fMCRec->fRasterClip.op(ir, op)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user