本文整理汇总了C++中TransformState::flatten方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformState::flatten方法的具体用法?C++ TransformState::flatten怎么用?C++ TransformState::flatten使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformState
的用法示例。
在下文中一共展示了TransformState::flatten方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mapToContainer
void RenderGeometryMap::mapToContainer(TransformState& transformState, const RenderLayerModelObject* container) const
{
// If the mapping includes something like columns, we have to go via renderers.
if (hasNonUniformStep()) {
m_mapping.last().m_renderer->mapLocalToContainer(container, transformState, ApplyContainerFlip | m_mapCoordinatesFlags);
transformState.flatten();
return;
}
bool inFixed = false;
#if !ASSERT_DISABLED
bool foundContainer = !container || (m_mapping.size() && m_mapping[0].m_renderer == container);
#endif
for (int i = m_mapping.size() - 1; i >= 0; --i) {
const RenderGeometryMapStep& currentStep = m_mapping[i];
// If container is the RenderView (step 0) we want to apply its scroll offset.
if (i > 0 && currentStep.m_renderer == container) {
#if !ASSERT_DISABLED
foundContainer = true;
#endif
break;
}
// If this box has a transform, it acts as a fixed position container
// for fixed descendants, which prevents the propagation of 'fixed'
// unless the layer itself is also fixed position.
if (i && currentStep.m_hasTransform && !currentStep.m_isFixedPosition)
inFixed = false;
else if (currentStep.m_isFixedPosition)
inFixed = true;
if (!i) {
// The root gets special treatment for fixed position
if (inFixed)
transformState.move(currentStep.m_offset.width(), currentStep.m_offset.height());
// A null container indicates mapping through the RenderView, so including its transform (the page scale).
if (!container && currentStep.m_transform)
transformState.applyTransform(*currentStep.m_transform.get());
} else {
TransformState::TransformAccumulation accumulate = currentStep.m_accumulatingTransform ? TransformState::AccumulateTransform : TransformState::FlattenTransform;
if (currentStep.m_transform)
transformState.applyTransform(*currentStep.m_transform.get(), accumulate);
else
transformState.move(currentStep.m_offset.width(), currentStep.m_offset.height(), accumulate);
}
}
ASSERT(foundContainer);
transformState.flatten();
}
示例2: mapToContainer
void RenderGeometryMap::mapToContainer(TransformState& transformState,
const RenderBox* container) const {
// If the mapping includes something like columns, we have to go via
// renderers.
if (hasNonUniformStep()) {
m_mapping.last().m_renderer->mapLocalToContainer(
container, transformState, ApplyContainerFlip | m_mapCoordinatesFlags);
transformState.flatten();
return;
}
#if ENABLE(ASSERT)
bool foundContainer =
!container || (m_mapping.size() && m_mapping[0].m_renderer == container);
#endif
for (int i = m_mapping.size() - 1; i >= 0; --i) {
const RenderGeometryMapStep& currentStep = m_mapping[i];
// If container is the root RenderView (step 0) we want to apply its fixed
// position offset.
if (i > 0 && currentStep.m_renderer == container) {
#if ENABLE(ASSERT)
foundContainer = true;
#endif
break;
}
ASSERT(!i == isTopmostRenderView(currentStep.m_renderer));
if (!i) {
// A null container indicates mapping through the root RenderView, so
// including its transform (the page scale).
if (!container && currentStep.m_transform)
transformState.applyTransform(*currentStep.m_transform.get());
} else {
TransformState::TransformAccumulation accumulate =
currentStep.m_accumulatingTransform
? TransformState::AccumulateTransform
: TransformState::FlattenTransform;
if (currentStep.m_transform)
transformState.applyTransform(*currentStep.m_transform.get(),
accumulate);
else
transformState.move(currentStep.m_offset.width(),
currentStep.m_offset.height(), accumulate);
}
}
ASSERT(foundContainer);
transformState.flatten();
}
示例3: mapToAbsolute
void RenderGeometryMap::mapToAbsolute(TransformState& transformState) const
{
// If the mapping includes something like columns, we have to go via renderers.
if (hasNonUniformStep()) {
bool fixed = false;
m_mapping.last()->m_renderer->mapLocalToContainer(0, fixed, true, transformState, RenderObject::ApplyContainerFlip);
return;
}
bool inFixed = false;
for (int i = m_mapping.size() - 1; i >= 0; --i) {
const RenderGeometryMapStep* currStep = m_mapping[i].get();
// If this box has a transform, it acts as a fixed position container
// for fixed descendants, which prevents the propagation of 'fixed'
// unless the layer itself is also fixed position.
if (currStep->m_hasTransform && !currStep->m_isFixedPosition)
inFixed = false;
else if (currStep->m_isFixedPosition)
inFixed = true;
if (!i) {
if (currStep->m_transform)
transformState.applyTransform(*currStep->m_transform.get());
// The root gets special treatment for fixed position
if (inFixed)
transformState.move(currStep->m_offset.width(), currStep->m_offset.height());
} else {
TransformState::TransformAccumulation accumulate = currStep->m_accumulatingTransform ? TransformState::AccumulateTransform : TransformState::FlattenTransform;
if (currStep->m_transform)
transformState.applyTransform(*currStep->m_transform.get(), accumulate);
else
transformState.move(currStep->m_offset.width(), currStep->m_offset.height(), accumulate);
}
}
transformState.flatten();
}