本文整理汇总了C++中GrDrawEffect::programHasExplicitLocalCoords方法的典型用法代码示例。如果您正苦于以下问题:C++ GrDrawEffect::programHasExplicitLocalCoords方法的具体用法?C++ GrDrawEffect::programHasExplicitLocalCoords怎么用?C++ GrDrawEffect::programHasExplicitLocalCoords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrDrawEffect
的用法示例。
在下文中一共展示了GrDrawEffect::programHasExplicitLocalCoords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenTransformKey
uint32_t GrGLProgramEffects::GenTransformKey(const GrDrawEffect& drawEffect) {
uint32_t totalKey = 0;
int numTransforms = drawEffect.effect()->numTransforms();
for (int t = 0; t < numTransforms; ++t) {
uint32_t key = 0;
const GrCoordTransform& coordTransform = drawEffect.effect()->coordTransform(t);
SkMatrix::TypeMask type0 = coordTransform.getMatrix().getType();
SkMatrix::TypeMask type1;
if (kLocal_GrCoordSet == coordTransform.sourceCoords()) {
type1 = drawEffect.getCoordChangeMatrix().getType();
} else {
if (drawEffect.programHasExplicitLocalCoords()) {
// We only make the key indicate that device coords are referenced when the local coords
// are not actually determined by positions. Otherwise the local coords var and position
// var are identical.
key |= kPositionCoords_Flag;
}
type1 = SkMatrix::kIdentity_Mask;
}
int combinedTypes = type0 | type1;
if (SkMatrix::kPerspective_Mask & combinedTypes) {
key |= kGeneral_MatrixType;
} else {
key |= kNoPersp_MatrixType;
}
key <<= kTransformKeyBits * t;
SkASSERT(0 == (totalKey & key)); // keys for each transform ought not to overlap
totalKey |= key;
}
return totalKey;
}