Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2464823003: Refactor LayoutView paint offset updates out of FrameView update code (Closed)
Patch Set: Incorporate Tien-Ren's review ideas Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698