本文整理汇总了C++中gfxMatrix::IsIdentity方法的典型用法代码示例。如果您正苦于以下问题:C++ gfxMatrix::IsIdentity方法的具体用法?C++ gfxMatrix::IsIdentity怎么用?C++ gfxMatrix::IsIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gfxMatrix
的用法示例。
在下文中一共展示了gfxMatrix::IsIdentity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
gfxMatrix
nsSVGGraphicElement::PrependLocalTransformsTo(const gfxMatrix &aMatrix,
TransformTypes aWhich) const
{
NS_ABORT_IF_FALSE(aWhich != eChildToUserSpace || aMatrix.IsIdentity(),
"Skipping eUserSpaceToParent transforms makes no sense");
gfxMatrix result(aMatrix);
if (aWhich == eChildToUserSpace) {
// We don't have anything to prepend.
// eChildToUserSpace is not the common case, which is why we return
// 'result' to benefit from NRVO rather than returning aMatrix before
// creating 'result'.
return result;
}
NS_ABORT_IF_FALSE(aWhich == eAllTransforms || aWhich == eUserSpaceToParent,
"Unknown TransformTypes");
// animateMotion's resulting transform is supposed to apply *on top of*
// any transformations from the |transform| attribute. So since we're
// PRE-multiplying, we need to apply the animateMotion transform *first*.
if (mAnimateMotionTransform) {
result.PreMultiply(*mAnimateMotionTransform);
}
if (mTransforms) {
result.PreMultiply(mTransforms->GetAnimValue().GetConsolidationMatrix());
}
return result;
}
示例2: gfxMatrix
/* virtual */ gfxMatrix
SVGUseElement::PrependLocalTransformsTo(const gfxMatrix &aMatrix,
TransformTypes aWhich) const
{
NS_ABORT_IF_FALSE(aWhich != eChildToUserSpace || aMatrix.IsIdentity(),
"Skipping eUserSpaceToParent transforms makes no sense");
// 'transform' attribute:
gfxMatrix fromUserSpace =
SVGUseElementBase::PrependLocalTransformsTo(aMatrix, aWhich);
if (aWhich == eUserSpaceToParent) {
return fromUserSpace;
}
// our 'x' and 'y' attributes:
float x, y;
const_cast<SVGUseElement*>(this)->GetAnimatedLengthValues(&x, &y, nullptr);
gfxMatrix toUserSpace = gfxMatrix().Translate(gfxPoint(x, y));
if (aWhich == eChildToUserSpace) {
return toUserSpace;
}
NS_ABORT_IF_FALSE(aWhich == eAllTransforms, "Unknown TransformTypes");
return toUserSpace * fromUserSpace;
}