Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| index 67837699cc16e9e0f1c8b8dc50b902ffb5d6c427..7f8c8a493a34444a992fea8f9659bb4378033ff4 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| @@ -102,33 +102,19 @@ void updateFrameViewScroll( |
| } |
| } |
| -void PaintPropertyTreeBuilder::updatePropertiesAndContext( |
| +void PaintPropertyTreeBuilder::updateFramePropertiesAndContext( |
| 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()); |
| - layoutView->getMutableForPainting() |
| - .ensurePaintProperties() |
| - .updatePaintOffsetTranslation(context.current.transform, frameTranslate, |
| - FloatPoint3D()); |
| - |
| - const auto* properties = layoutView->paintProperties(); |
| - DCHECK(properties && properties->paintOffsetTranslation()); |
| - context.current.transform = properties->paintOffsetTranslation(); |
| - context.current.paintOffset = LayoutPoint(); |
| + // With RootLayerScrolling, the LayoutView (a LayoutObject) properties are |
| + // updated like other objects (see updatePropertiesAndContextForSelf and |
| + // updatePropertiesAndContextForChildren) instead of having LayoutView- |
| + // specific property updates here. |
| + context.current.paintOffset.moveBy(frameView.location()); |
| context.current.renderingContextID = 0; |
| context.current.shouldFlattenInheritedTransform = true; |
| context.absolutePosition = context.current; |
| - context.containerForAbsolutePosition = |
| - nullptr; // This will get set in updateOutOfFlowContext(). |
| + context.containerForAbsolutePosition = nullptr; |
| context.fixedPosition = context.current; |
| return; |
| } |
| @@ -197,12 +183,32 @@ void PaintPropertyTreeBuilder::updatePropertiesAndContext( |
| frameView.setTotalPropertyTreeStateForContents(std::move(contentsState)); |
| } |
| +void PaintPropertyTreeBuilder::updateLayoutViewPaintOffsetTranslation( |
| + const LayoutView& view, |
| + PaintPropertyTreeBuilderContext& context) { |
| + DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled()); |
| + TransformationMatrix translate; |
| + translate.translate(context.current.paintOffset.x(), |
| + context.current.paintOffset.y()); |
| + view.getMutableForPainting() |
| + .ensurePaintProperties() |
| + .updatePaintOffsetTranslation(context.current.transform, translate, |
| + FloatPoint3D()); |
| + |
| + const auto* properties = view.paintProperties(); |
| + DCHECK(properties && properties->paintOffsetTranslation()); |
| + context.current.transform = context.absolutePosition.transform = |
| + context.fixedPosition.transform = properties->paintOffsetTranslation(); |
| + context.current.paintOffset = context.absolutePosition.paintOffset = |
| + context.fixedPosition.paintOffset = LayoutPoint(); |
| +} |
| + |
| void PaintPropertyTreeBuilder::updatePaintOffsetTranslation( |
| const LayoutObject& object, |
| PaintPropertyTreeBuilderContext& context) { |
| - // LayoutView's paint offset is updated in the FrameView property update. |
| - if (object.isLayoutView()) { |
| - DCHECK(context.current.paintOffset == LayoutPoint()); |
| + if (RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
| + object.isLayoutView()) { |
|
trchen
2016/11/01 23:36:25
Is the special case still needed?
It looks like t
|
| + updateLayoutViewPaintOffsetTranslation(toLayoutView(object), context); |
| return; |
| } |