本文整理汇总了C++中GrClip::getPathFill方法的典型用法代码示例。如果您正苦于以下问题:C++ GrClip::getPathFill方法的具体用法?C++ GrClip::getPathFill怎么用?C++ GrClip::getPathFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrClip
的用法示例。
在下文中一共展示了GrClip::getPathFill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawClipShape
bool GrClipMaskManager::drawClipShape(GrGpu* gpu,
GrTexture* target,
const GrClip& clipIn,
int index) {
GrDrawState* drawState = gpu->drawState();
GrAssert(NULL != drawState);
drawState->setRenderTarget(target->asRenderTarget());
if (kRect_ClipType == clipIn.getElementType(index)) {
if (clipIn.getDoAA(index)) {
// convert the rect to a path for AA
SkPath temp;
temp.addRect(clipIn.getRect(index));
return this->drawPath(gpu, temp,
kEvenOdd_PathFill, clipIn.getDoAA(index));
} else {
gpu->drawSimpleRect(clipIn.getRect(index), NULL, 0);
}
} else {
return this->drawPath(gpu,
clipIn.getPath(index),
clipIn.getPathFill(index),
clipIn.getDoAA(index));
}
return true;
}
示例2: useSWOnlyPath
/*
* This method traverses the clip stack to see if the GrSoftwarePathRenderer
* will be used on any element. If so, it returns true to indicate that the
* entire clip should be rendered in SW and then uploaded en masse to the gpu.
*/
bool GrClipMaskManager::useSWOnlyPath(GrGpu* gpu, const GrClip& clipIn) {
if (!clipIn.requiresAA()) {
// The stencil buffer can handle this case
return false;
}
// TODO: generalize this test so that when
// a clip gets complex enough it can just be done in SW regardless
// of whether it would invoke the GrSoftwarePathRenderer.
bool useSW = false;
for (int i = 0; i < clipIn.getElementCount(); ++i) {
if (SkRegion::kReplace_Op == clipIn.getOp(i)) {
// Everything before a replace op can be ignored so start
// afresh w.r.t. determining if any element uses the SW path
useSW = false;
}
if (!clipIn.getDoAA(i)) {
// non-anti-aliased rects and paths can always be drawn either
// directly or by the GrDefaultPathRenderer
continue;
}
if (kRect_ClipType == clipIn.getElementType(i)) {
// Antialiased rects are converted to paths and then drawn with
// kEvenOdd_PathFill.
if (!GrAAConvexPathRenderer::staticCanDrawPath(
true, // always convex
kEvenOdd_PathFill,
gpu,
true)) { // anti-aliased
// if the GrAAConvexPathRenderer can't render this rect (due
// to lack of derivative support in the shaders) then
// the GrSoftwarePathRenderer will be used
useSW = true;
}
continue;
}
// only paths need to be considered in the rest of the loop body
if (GrAAHairLinePathRenderer::staticCanDrawPath(clipIn.getPath(i),
clipIn.getPathFill(i),
gpu,
clipIn.getDoAA(i))) {
// the hair line path renderer can handle this one
continue;
}
if (GrAAConvexPathRenderer::staticCanDrawPath(
clipIn.getPath(i).isConvex(),
clipIn.getPathFill(i),
gpu,
clipIn.getDoAA(i))) {
// the convex path renderer can handle this one
continue;
}
// otherwise the GrSoftwarePathRenderer is going to be invoked
useSW = true;
}
return useSW;
}