本文整理汇总了C++中SkSTArray::back方法的典型用法代码示例。如果您正苦于以下问题:C++ SkSTArray::back方法的具体用法?C++ SkSTArray::back怎么用?C++ SkSTArray::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkSTArray
的用法示例。
在下文中一共展示了SkSTArray::back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_analytic_clip_processor
static bool get_analytic_clip_processor(const GrReducedClip::ElementList& elements,
bool abortIfAA,
SkVector& clipToRTOffset,
const SkRect* drawBounds,
sk_sp<GrFragmentProcessor>* resultFP) {
SkRect boundsInClipSpace;
if (drawBounds) {
boundsInClipSpace = *drawBounds;
boundsInClipSpace.offset(-clipToRTOffset.fX, -clipToRTOffset.fY);
}
SkASSERT(elements.count() <= kMaxAnalyticElements);
SkSTArray<kMaxAnalyticElements, sk_sp<GrFragmentProcessor>> fps;
GrReducedClip::ElementList::Iter iter(elements);
while (iter.get()) {
SkRegion::Op op = iter.get()->getOp();
bool invert;
bool skip = false;
switch (op) {
case SkRegion::kReplace_Op:
SkASSERT(iter.get() == elements.head());
// Fallthrough, handled same as intersect.
case SkRegion::kIntersect_Op:
invert = false;
if (drawBounds && iter.get()->contains(boundsInClipSpace)) {
skip = true;
}
break;
case SkRegion::kDifference_Op:
invert = true;
// We don't currently have a cheap test for whether a rect is fully outside an
// element's primitive, so don't attempt to set skip.
break;
default:
return false;
}
if (!skip) {
GrPrimitiveEdgeType edgeType;
if (iter.get()->isAA()) {
if (abortIfAA) {
return false;
}
edgeType =
invert ? kInverseFillAA_GrProcessorEdgeType : kFillAA_GrProcessorEdgeType;
} else {
edgeType =
invert ? kInverseFillBW_GrProcessorEdgeType : kFillBW_GrProcessorEdgeType;
}
switch (iter.get()->getType()) {
case SkClipStack::Element::kPath_Type:
fps.emplace_back(GrConvexPolyEffect::Make(edgeType, iter.get()->getPath(),
&clipToRTOffset));
break;
case SkClipStack::Element::kRRect_Type: {
SkRRect rrect = iter.get()->getRRect();
rrect.offset(clipToRTOffset.fX, clipToRTOffset.fY);
fps.emplace_back(GrRRectEffect::Make(edgeType, rrect));
break;
}
case SkClipStack::Element::kRect_Type: {
SkRect rect = iter.get()->getRect();
rect.offset(clipToRTOffset.fX, clipToRTOffset.fY);
fps.emplace_back(GrConvexPolyEffect::Make(edgeType, rect));
break;
}
default:
break;
}
if (!fps.back()) {
return false;
}
}
iter.next();
}
*resultFP = nullptr;
if (fps.count()) {
*resultFP = GrFragmentProcessor::RunInSeries(fps.begin(), fps.count());
}
return true;
}