本文整理汇总了C++中gfx::IntRect::Intersect方法的典型用法代码示例。如果您正苦于以下问题:C++ IntRect::Intersect方法的具体用法?C++ IntRect::Intersect怎么用?C++ IntRect::Intersect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gfx::IntRect
的用法示例。
在下文中一共展示了IntRect::Intersect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: offset
bool
BasicContainerLayer::ChildrenPartitionVisibleRegion(const gfx::IntRect& aInRect)
{
Matrix transform;
if (!GetEffectiveTransform().CanDraw2D(&transform) ||
ThebesMatrix(transform).HasNonIntegerTranslation())
return false;
nsIntPoint offset(int32_t(transform._31), int32_t(transform._32));
gfx::IntRect rect = aInRect.Intersect(GetEffectiveVisibleRegion().GetBounds() + offset);
nsIntRegion covered;
for (Layer* l = mFirstChild; l; l = l->GetNextSibling()) {
if (ToData(l)->IsHidden())
continue;
Matrix childTransform;
if (!l->GetEffectiveTransform().CanDraw2D(&childTransform) ||
ThebesMatrix(childTransform).HasNonIntegerTranslation() ||
l->GetEffectiveOpacity() != 1.0)
return false;
nsIntRegion childRegion = l->GetEffectiveVisibleRegion();
childRegion.MoveBy(int32_t(childTransform._31), int32_t(childTransform._32));
childRegion.And(childRegion, rect);
if (l->GetClipRect()) {
childRegion.And(childRegion, ParentLayerIntRect::ToUntyped(*l->GetClipRect()) + offset);
}
nsIntRegion intersection;
intersection.And(covered, childRegion);
if (!intersection.IsEmpty())
return false;
covered.Or(covered, childRegion);
}
return covered.Contains(rect);
}