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:
parent
40e25b2e34
commit
d922c33a8e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user