本文整理汇总了C++中LayoutView::getMutableForPainting方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutView::getMutableForPainting方法的具体用法?C++ LayoutView::getMutableForPainting怎么用?C++ LayoutView::getMutableForPainting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutView
的用法示例。
在下文中一共展示了LayoutView::getMutableForPainting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildTreeNodes
void PaintPropertyTreeBuilder::buildTreeNodes(
FrameView& frameView,
PaintPropertyTreeBuilderContext& context) {
if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
LayoutView* layoutView = frameView.layoutView();
if (!layoutView)
return;
TransformationMatrix frameTranslate;
frameTranslate.translate(frameView.x() + layoutView->location().x() +
context.current.paintOffset.x(),
frameView.y() + layoutView->location().y() +
context.current.paintOffset.y());
context.current.transform =
layoutView->getMutableForPainting()
.ensurePaintProperties()
.updatePaintOffsetTranslation(context.current.transform,
frameTranslate, FloatPoint3D());
context.current.paintOffset = LayoutPoint();
context.current.renderingContextID = 0;
context.current.shouldFlattenInheritedTransform = true;
context.absolutePosition = context.current;
context.containerForAbsolutePosition =
nullptr; // This will get set in updateOutOfFlowContext().
context.fixedPosition = context.current;
return;
}
TransformationMatrix frameTranslate;
frameTranslate.translate(frameView.x() + context.current.paintOffset.x(),
frameView.y() + context.current.paintOffset.y());
context.current.transform = updateFrameViewPreTranslation(
frameView, context.current.transform, frameTranslate, FloatPoint3D());
FloatRoundedRect contentClip(
IntRect(IntPoint(), frameView.visibleContentSize()));
context.current.clip = updateFrameViewContentClip(
frameView, context.current.clip, frameView.preTranslation(), contentClip);
// Record the fixed properties before any scrolling occurs.
const auto* fixedTransformNode = context.current.transform;
auto* fixedScrollNode = context.current.scroll;
ScrollOffset scrollOffset = frameView.scrollOffset();
if (frameView.isScrollable() || !scrollOffset.isZero()) {
TransformationMatrix frameScroll;
frameScroll.translate(-scrollOffset.width(), -scrollOffset.height());
context.current.transform = updateFrameViewScrollTranslation(
frameView, frameView.preTranslation(), frameScroll, FloatPoint3D());
IntSize scrollClip = frameView.visibleContentSize();
IntSize scrollBounds = frameView.contentsSize();
bool userScrollableHorizontal =
frameView.userInputScrollable(HorizontalScrollbar);
bool userScrollableVertical =
frameView.userInputScrollable(VerticalScrollbar);
context.current.scroll = updateFrameViewScroll(
frameView, context.current.scroll, frameView.scrollTranslation(),
scrollClip, scrollBounds, userScrollableHorizontal,
userScrollableVertical);
} else {
// Ensure pre-existing properties are cleared when there is no scrolling.
frameView.setScrollTranslation(nullptr);
frameView.setScroll(nullptr);
}
// Initialize the context for current, absolute and fixed position cases.
// They are the same, except that scroll translation does not apply to
// fixed position descendants.
context.current.paintOffset = LayoutPoint();
context.current.renderingContextID = 0;
context.current.shouldFlattenInheritedTransform = true;
context.absolutePosition = context.current;
context.containerForAbsolutePosition = nullptr;
context.fixedPosition = context.current;
context.fixedPosition.transform = fixedTransformNode;
context.fixedPosition.scroll = fixedScrollNode;
std::unique_ptr<PropertyTreeState> contentsState(
new PropertyTreeState(context.current.transform, context.current.clip,
context.currentEffect, context.current.scroll));
frameView.setTotalPropertyTreeStateForContents(std::move(contentsState));
}