本文整理汇总了C++中GrDrawState::setEdgeAAData方法的典型用法代码示例。如果您正苦于以下问题:C++ GrDrawState::setEdgeAAData方法的具体用法?C++ GrDrawState::setEdgeAAData怎么用?C++ GrDrawState::setEdgeAAData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrDrawState
的用法示例。
在下文中一共展示了GrDrawState::setEdgeAAData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onDrawPath
//.........这里部分代码省略.........
if (drawState->getViewInverse(&vmi)) {
vmi.mapRect(&bounds);
}
*vert++ = GrPoint::Make(bounds.fLeft, bounds.fTop);
*vert++ = GrPoint::Make(bounds.fLeft, bounds.fBottom);
*vert++ = GrPoint::Make(bounds.fRight, bounds.fBottom);
*vert++ = GrPoint::Make(bounds.fRight, bounds.fTop);
subpathVertCount[subpath++] = 4;
}
GrAssert(subpath == subpathCnt);
GrAssert((vert - base) <= maxPts);
size_t count = vert - base;
if (count < 3) {
return true;
}
if (subpathCnt == 1 && !inverted && path.isConvex()) {
if (antiAlias) {
GrEdgeArray edges;
GrMatrix inverse, matrix = drawState->getViewMatrix();
drawState->getViewInverse(&inverse);
count = computeEdgesAndIntersect(matrix, inverse, base, count, &edges, 0.0f);
size_t maxEdges = target->getMaxEdges();
if (count == 0) {
return true;
}
if (count <= maxEdges) {
// All edges fit; upload all edges and draw all verts as a fan
target->setVertexSourceToArray(layout, base, count);
drawState->setEdgeAAData(&edges[0], count);
target->drawNonIndexed(kTriangleFan_PrimitiveType, 0, count);
} else {
// Upload "maxEdges" edges and verts at a time, and draw as
// separate fans
for (size_t i = 0; i < count - 2; i += maxEdges - 2) {
edges[i] = edges[0];
base[i] = base[0];
int size = GR_CT_MIN(count - i, maxEdges);
target->setVertexSourceToArray(layout, &base[i], size);
drawState->setEdgeAAData(&edges[i], size);
target->drawNonIndexed(kTriangleFan_PrimitiveType, 0, size);
}
}
drawState->setEdgeAAData(NULL, 0);
} else {
target->setVertexSourceToArray(layout, base, count);
target->drawNonIndexed(kTriangleFan_PrimitiveType, 0, count);
}
return true;
}
if (antiAlias) {
// Run the tesselator once to get the boundaries.
GrBoundaryTess btess(count, fill_type_to_glu_winding_rule(fill));
btess.addVertices(base, subpathVertCount, subpathCnt);
GrMatrix inverse, matrix = drawState->getViewMatrix();
if (!drawState->getViewInverse(&inverse)) {
return false;
}
if (btess.vertices().count() > USHRT_MAX) {