aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-04 09:02:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-04 09:02:23 -0700
commit73e714eb766617ce06757829a3c0b345c7963faa (patch)
tree4d826441ea39268ef6a558f5a27abdf23d197a71 /src
parentbd769d0f1c8cf6ccbb2738dfad1624a4c828e4eb (diff)
cleanup rasterclip helper
R=robertphillips@google.com TBR=robertphilips Author: reed@google.com Review URL: https://codereview.chromium.org/540983002
Diffstat (limited to 'src')
-rw-r--r--src/core/SkCanvas.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 3d2fc8c498..2cc86e73e8 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1299,8 +1299,8 @@ void SkCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edg
}
}
-static void clip_path_helper(const SkCanvas* canvas, SkRasterClip* currClip,
- const SkPath& devPath, SkRegion::Op op, bool doAA) {
+static void rasterclip_path(SkRasterClip* rc, const SkCanvas* canvas, const SkPath& devPath,
+ SkRegion::Op op, bool doAA) {
// base is used to limit the size (and therefore memory allocation) of the
// region that results from scan converting devPath.
SkRegion base;
@@ -1309,27 +1309,27 @@ static void clip_path_helper(const SkCanvas* canvas, SkRasterClip* currClip,
// since we are intersect, we can do better (tighter) with currRgn's
// bounds, than just using the device. However, if currRgn is complex,
// our region blitter may hork, so we do that case in two steps.
- if (currClip->isRect()) {
- // FIXME: we should also be able to do this when currClip->isBW(),
+ if (rc->isRect()) {
+ // FIXME: we should also be able to do this when rc->isBW(),
// but relaxing the test above triggers GM asserts in
// SkRgnBuilder::blitH(). We need to investigate what's going on.
- currClip->setPath(devPath, currClip->bwRgn(), doAA);
+ rc->setPath(devPath, rc->bwRgn(), doAA);
} else {
- base.setRect(currClip->getBounds());
+ base.setRect(rc->getBounds());
SkRasterClip clip;
clip.setPath(devPath, base, doAA);
- currClip->op(clip, op);
+ rc->op(clip, op);
}
} else {
const SkISize size = canvas->getBaseLayerSize();
base.setRect(0, 0, size.width(), size.height());
if (SkRegion::kReplace_Op == op) {
- currClip->setPath(devPath, base, doAA);
+ rc->setPath(devPath, base, doAA);
} else {
SkRasterClip clip;
clip.setPath(devPath, base, doAA);
- currClip->op(clip, op);
+ rc->op(clip, op);
}
}
}
@@ -1359,7 +1359,7 @@ void SkCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle
SkPath devPath;
devPath.addRRect(transformedRRect);
- clip_path_helper(this, &fMCRec->fRasterClip, devPath, op, kSoft_ClipEdgeStyle == edgeStyle);
+ rasterclip_path(&fMCRec->fRasterClip, this, devPath, op, kSoft_ClipEdgeStyle == edgeStyle);
return;
}
@@ -1448,7 +1448,7 @@ void SkCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edg
op = SkRegion::kReplace_Op;
}
- clip_path_helper(this, &fMCRec->fRasterClip, devPath, op, edgeStyle);
+ rasterclip_path(&fMCRec->fRasterClip, this, devPath, op, edgeStyle);
}
void SkCanvas::updateClipConservativelyUsingBounds(const SkRect& bounds, SkRegion::Op op,
@@ -1571,7 +1571,7 @@ void SkCanvas::validateClip() const {
default: {
SkPath path;
element->asPath(&path);
- clip_path_helper(this, &tmpClip, path, element->getOp(), element->isAA());
+ rasterclip_path(&tmpClip, this, path, element->getOp(), element->isAA());
break;
}
}