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

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

Issue 2638333007: Add compositor element id for scroll nodes in SPv2. (Closed)
Patch Set: Sync to head. Created 3 years, 11 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a21f433b1aa4105a57fe8c3104bdbdd011cd6ca8..84f73800fe78b00d47e3f8099e826ebc6d7267fb 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -86,6 +86,12 @@ static bool updateScrollTranslation(
return true;
}
+static CompositorElementId createDomNodeBasedCompositorElementId(
+ const LayoutObject& object) {
+ return createCompositorElementId(DOMNodeIds::idForNode(object.node()),
+ CompositorSubElementId::Primary);
+}
+
// True if a new property was created or a main thread scrolling reason changed
// (which can affect descendants), false if an existing one was updated.
static bool updateScroll(
@@ -98,17 +104,21 @@ static bool updateScroll(
bool userScrollableVertical,
MainThreadScrollingReasons mainThreadScrollingReasons) {
DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled());
+
+ CompositorElementId compositorElementId =
+ createDomNodeBasedCompositorElementId(*frameView.layoutView());
if (auto* existingScroll = frameView.scroll()) {
auto existingReasons = existingScroll->mainThreadScrollingReasons();
existingScroll->update(std::move(parent), std::move(scrollOffset), clip,
bounds, userScrollableHorizontal,
- userScrollableVertical, mainThreadScrollingReasons);
+ userScrollableVertical, mainThreadScrollingReasons,
+ compositorElementId);
return existingReasons != mainThreadScrollingReasons;
}
frameView.setScroll(ScrollPaintPropertyNode::create(
std::move(parent), std::move(scrollOffset), clip, bounds,
userScrollableHorizontal, userScrollableVertical,
- mainThreadScrollingReasons));
+ mainThreadScrollingReasons, compositorElementId));
return true;
}
@@ -349,12 +359,6 @@ static FloatPoint3D transformOrigin(const LayoutBox& box) {
style.transformOriginZ());
}
-static CompositorElementId createDomNodeBasedCompositorElementId(
- const LayoutObject& object) {
- return createCompositorElementId(DOMNodeIds::idForNode(object.node()),
- CompositorSubElementId::Primary);
-}
-
void PaintPropertyTreeBuilder::updateTransform(
const LayoutObject& object,
PaintPropertyTreeBuilderContext& context) {
@@ -794,10 +798,13 @@ void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(
context.forceSubtreeUpdate = true;
}
+ CompositorElementId compositorElementId =
+ createDomNodeBasedCompositorElementId(object);
+
context.forceSubtreeUpdate |= properties.updateScroll(
context.current.scroll, properties.scrollTranslation(), scrollClip,
scrollBounds, userScrollableHorizontal, userScrollableVertical,
- reasons);
+ reasons, compositorElementId);
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698