本文整理汇总了C++中SkSTArray::resize_back方法的典型用法代码示例。如果您正苦于以下问题:C++ SkSTArray::resize_back方法的具体用法?C++ SkSTArray::resize_back怎么用?C++ SkSTArray::resize_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkSTArray
的用法示例。
在下文中一共展示了SkSTArray::resize_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INHERITED
GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path) : INHERITED(gpu, kIsWrapped) {
#ifndef SK_SCALAR_IS_FLOAT
GrCrash("Assumes scalar is float.");
#endif
SkASSERT(!path.isEmpty());
GL_CALL_RET(fPathID, GenPaths(1));
SkSTArray<16, GrGLubyte, true> pathCommands;
SkSTArray<16, SkPoint, true> pathPoints;
int verbCnt = path.countVerbs();
int pointCnt = path.countPoints();
pathCommands.resize_back(verbCnt);
pathPoints.resize_back(pointCnt);
// TODO: Direct access to path points since we could pass them on directly.
path.getPoints(&pathPoints[0], pointCnt);
path.getVerbs(&pathCommands[0], verbCnt);
GR_DEBUGCODE(int numPts = 0);
for (int i = 0; i < verbCnt; ++i) {
SkPath::Verb v = static_cast<SkPath::Verb>(pathCommands[i]);
pathCommands[i] = verb_to_gl_path_cmd(v);
GR_DEBUGCODE(numPts += num_pts(v));
}
GrAssert(pathPoints.count() == numPts);
GL_CALL(PathCommands(fPathID,
verbCnt, &pathCommands[0],
2 * pointCnt, GR_GL_FLOAT, &pathPoints[0]));
fBounds = path.getBounds();
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_skia_src,代码行数:33,代码来源:GrGLPath.cpp