bool SkRasterClip::op(const SkRect& r, SkRegion::Op op, bool doAA) { if (doAA) { // check that the rect really needs aa if (is_integral(r.fLeft) && is_integral(r.fTop) && is_integral(r.fRight) && is_integral(r.fBottom)) { doAA = false; } } if (fIsBW && !doAA) { SkIRect ir; r.round(&ir); return fBW.op(ir, op); } else { if (fIsBW) { this->convertToAA(); } return fAA.op(r, op, doAA); } }
static add_op(stream, node, is_ass, argsz) { auto op = node[0]; /* Pointer plus integer needs scaling. We canonicalised this during * parsing so the pointer is always the first arg which is in node[3]. */ if ( is_pointer( node[3][2] ) && is_integral( node[4][2] ) ) scale_elt( stream, type_size( node[3][2][3] ), 1 ); if ( op == '-' || op == '-=' ) pop_sub(stream, is_ass, argsz); else pop_add(stream, is_ass, argsz); /* Pointer minus pointer needs scaling down. */ if ( is_pointer( node[3][2] ) && is_pointer( node[4][2] ) ) scale_elt( stream, type_size( node[3][2][3] ), -1 ); }
bool is_arithmetic( const type &type_ ) { return is_integral( type_ ) || is_floating_point( type_ ); }