inline very common intersect+rect_rgn

Extracted from previous compound CL (with other changes).

This is the very common case for clips, and inlining this eliminates a series of function calls.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2116513002

TBR=mtklein

Review-Url: https://codereview.chromium.org/2116513002
This commit is contained in:
reed 2016-06-30 07:47:34 -07:00 committed by Commit bot
parent 40e25b2e34
commit d922c33a8e

View File

@ -255,7 +255,15 @@ public:
* specified rectangle: this = (this op rect).
* Return true if the resulting region is non-empty.
*/
bool op(const SkIRect& rect, Op op) { return this->op(*this, rect, op); }
bool op(const SkIRect& rect, Op op) {
if (this->isRect() && kIntersect_Op == op) {
if (!fBounds.intersect(rect)) {
return this->setEmpty();
}
return true;
}
return this->op(*this, rect, op);
}
/**
* Set this region to the result of applying the Op to this region and the