本文整理汇总了C++中GrPrimitiveProcessor::localMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ GrPrimitiveProcessor::localMatrix方法的具体用法?C++ GrPrimitiveProcessor::localMatrix怎么用?C++ GrPrimitiveProcessor::localMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrPrimitiveProcessor
的用法示例。
在下文中一共展示了GrPrimitiveProcessor::localMatrix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTransformData
void GrGLNormalPathProcessor::setTransformData(
const GrPrimitiveProcessor& primProc,
int index,
const SkTArray<const GrCoordTransform*, true>& coordTransforms,
GrGLPathRendering* glpr,
GrGLuint programID) {
SkSTArray<2, Transform, true>& transforms = fInstalledTransforms[index];
int numTransforms = transforms.count();
for (int t = 0; t < numTransforms; ++t) {
SkASSERT(transforms[t].fHandle.isValid());
const SkMatrix& transform = GetTransformMatrix(primProc.localMatrix(),
*coordTransforms[t]);
if (transforms[t].fCurrentValue.cheapEqualTo(transform)) {
continue;
}
transforms[t].fCurrentValue = transform;
const SeparableVaryingInfo& fragmentInput =
fSeparableVaryingInfos[transforms[t].fHandle.handle()];
SkASSERT(transforms[t].fType == kVec2f_GrSLType ||
transforms[t].fType == kVec3f_GrSLType);
unsigned components = transforms[t].fType == kVec2f_GrSLType ? 2 : 3;
glpr->setProgramPathFragmentInputTransform(programID,
fragmentInput.fLocation,
GR_GL_OBJECT_LINEAR,
components,
transform);
}
}
示例2: SkASSERT
void
GrGLGeometryProcessor::setTransformData(const GrPrimitiveProcessor& primProc,
const GrGLProgramDataManager& pdman,
int index,
const SkTArray<const GrCoordTransform*, true>& transforms) {
SkSTArray<2, Transform, true>& procTransforms = fInstalledTransforms[index];
int numTransforms = transforms.count();
for (int t = 0; t < numTransforms; ++t) {
SkASSERT(procTransforms[t].fHandle.isValid());
const SkMatrix& transform = GetTransformMatrix(primProc.localMatrix(), *transforms[t]);
if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) {
pdman.setSkMatrix(procTransforms[t].fHandle.convertToUniformHandle(), transform);
procTransforms[t].fCurrentValue = transform;
}
}
}