本文整理汇总了C++中SkRasterClip::isBW方法的典型用法代码示例。如果您正苦于以下问题:C++ SkRasterClip::isBW方法的具体用法?C++ SkRasterClip::isBW怎么用?C++ SkRasterClip::isBW使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkRasterClip
的用法示例。
在下文中一共展示了SkRasterClip::isBW方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPath
bool SkRasterClip::setPath(const SkPath& path, const SkRasterClip& clip,
bool doAA) {
if (clip.isBW()) {
return this->setPath(path, clip.bwRgn(), doAA);
} else {
SkRegion tmp;
tmp.setRect(clip.getBounds());
if (!this->setPath(path, clip, doAA)) {
return false;
}
return this->op(clip, SkRegion::kIntersect_Op);
}
}
示例2: op
bool SkRasterClip::op(const SkRasterClip& clip, SkRegion::Op op) {
AUTO_RASTERCLIP_VALIDATE(*this);
clip.validate();
if (this->isBW() && clip.isBW()) {
return fBW.op(clip.fBW, op);
} else {
SkAAClip tmp;
const SkAAClip* other;
if (this->isBW()) {
this->convertToAA();
}
if (clip.isBW()) {
tmp.setRegion(clip.bwRgn());
other = &tmp;
} else {
other = &clip.aaRgn();
}
return fAA.op(*other, op);
}
}
示例3: FillXRect
void SkScan::FillXRect(const SkXRect& xr, const SkRasterClip& clip,
SkBlitter* blitter) {
if (clip.isEmpty() || xr.isEmpty()) {
return;
}
if (clip.isBW()) {
FillXRect(xr, &clip.bwRgn(), blitter);
return;
}
SkAAClipBlitterWrapper wrapper(clip, blitter);
FillXRect(xr, &wrapper.getRgn(), wrapper.getBlitter());
}
示例4: FillTriangle
void SkScan::FillTriangle(const SkPoint pts[], const SkRasterClip& clip,
SkBlitter* blitter) {
if (clip.isEmpty()) {
return;
}
SkRect r;
r.set(pts, 3);
// If r is too large (larger than can easily fit in SkFixed) then we need perform geometric
// clipping. This is a bit of work, so we just call the general FillPath() to handle it.
// Use FixedMax/2 as the limit so we can subtract two edges and still store that in Fixed.
const SkScalar limit = SK_MaxS16 >> 1;
if (!SkRect::MakeLTRB(-limit, -limit, limit, limit).contains(r)) {
SkPath path;
path.addPoly(pts, 3, false);
FillPath(path, clip, blitter);
return;
}
SkIRect ir = conservative_round_to_int(r);
if (ir.isEmpty() || !SkIRect::Intersects(ir, clip.getBounds())) {
return;
}
SkAAClipBlitterWrapper wrap;
const SkRegion* clipRgn;
if (clip.isBW()) {
clipRgn = &clip.bwRgn();
} else {
wrap.init(clip, blitter);
clipRgn = &wrap.getRgn();
blitter = wrap.getBlitter();
}
SkScanClipper clipper(blitter, clipRgn, ir);
blitter = clipper.getBlitter();
if (blitter) {
sk_fill_triangle(pts, clipper.getClipRect(), blitter, ir);
}
}