本文整理汇总了C++中TextureMapperLayer::computeOverlapRegions方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureMapperLayer::computeOverlapRegions方法的具体用法?C++ TextureMapperLayer::computeOverlapRegions怎么用?C++ TextureMapperLayer::computeOverlapRegions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureMapperLayer
的用法示例。
在下文中一共展示了TextureMapperLayer::computeOverlapRegions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeOverlapRegions
void TextureMapperLayer::computeOverlapRegions(Region& overlapRegion, Region& nonOverlapRegion, ResolveSelfOverlapMode mode)
{
if (!m_state.visible || !m_state.contentsVisible)
return;
FloatRect boundingRect;
if (m_backingStore || m_state.masksToBounds || m_state.maskLayer || hasFilters())
boundingRect = layerRect();
else if (m_contentsLayer || m_state.solidColor.alpha())
boundingRect = m_state.contentsRect;
#if ENABLE(CSS_FILTERS)
if (m_currentFilters.hasOutsets()) {
FilterOutsets outsets = m_currentFilters.outsets();
IntRect unfilteredTargetRect(boundingRect);
boundingRect.move(std::max(0, -outsets.left()), std::max(0, -outsets.top()));
boundingRect.expand(outsets.left() + outsets.right(), outsets.top() + outsets.bottom());
boundingRect.unite(unfilteredTargetRect);
}
#endif
TransformationMatrix replicaMatrix;
if (m_state.replicaLayer) {
replicaMatrix = replicaTransform();
boundingRect.unite(replicaMatrix.mapRect(boundingRect));
}
boundingRect = m_currentTransform.combined().mapRect(boundingRect);
// Count all masks and filters as overlap layers.
if (hasFilters() || m_state.maskLayer || (m_state.replicaLayer && m_state.replicaLayer->m_state.maskLayer)) {
Region newOverlapRegion(enclosingIntRect(boundingRect));
nonOverlapRegion.subtract(newOverlapRegion);
overlapRegion.unite(newOverlapRegion);
return;
}
Region newOverlapRegion;
Region newNonOverlapRegion(enclosingIntRect(boundingRect));
if (!m_state.masksToBounds) {
for (size_t i = 0; i < m_children.size(); ++i) {
TextureMapperLayer* child = m_children[i];
child->computeOverlapRegions(newOverlapRegion, newNonOverlapRegion, ResolveSelfOverlapIfNeeded);
}
}
if (m_state.replicaLayer) {
newOverlapRegion.unite(replicaMatrix.mapRect(newOverlapRegion.bounds()));
Region replicaRegion(replicaMatrix.mapRect(newNonOverlapRegion.bounds()));
resolveOverlaps(replicaRegion, newOverlapRegion, newNonOverlapRegion);
}
if ((mode != ResolveSelfOverlapAlways) && shouldBlend()) {
newNonOverlapRegion.unite(newOverlapRegion);
newOverlapRegion = Region();
}
overlapRegion.unite(newOverlapRegion);
resolveOverlaps(newNonOverlapRegion, overlapRegion, nonOverlapRegion);
}