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

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

Issue 2890953002: [SPv1] Always set a CompositorElementId on main graphics layers; use PaintLayer id. (Closed)
Patch Set: none Created 3 years, 7 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
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 e61d98d7d9afa174a98d946ae9132cedf2e53e79..13f21dc1ef2318e2d34684d85a9e6bd55ce5bf08 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -72,12 +72,11 @@ static bool UpdateContentClip(
return true;
}
-static CompositorElementId CreateDomNodeBasedCompositorElementId(
+static CompositorElementId CreatePaintLayereBasedCompositorElementId(
const LayoutObject& object) {
- // TODO(wkorman): Centralize this implementation with similar across
- // animation, scrolling and compositing logic.
- return CompositorElementIdFromDOMNodeId(
- DOMNodeIds::IdForNode(object.GetNode()),
+ DCHECK(object.IsBoxModelObject() && object.HasLayer());
+ return CompositorElementIdFromPaintLayerId(
+ ToLayoutBoxModelObject(object).Layer()->UniqueId(),
CompositorElementIdNamespace::kPrimary);
}
@@ -97,7 +96,7 @@ static bool UpdateScrollTranslation(
WebLayerScrollClient* scroll_client) {
DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled());
CompositorElementId compositor_element_id =
- CreateDomNodeBasedCompositorElementId(*frame_view.GetLayoutView());
+ CreatePaintLayereBasedCompositorElementId(*frame_view.GetLayoutView());
if (auto* existing_scroll_translation = frame_view.ScrollTranslation()) {
auto existing_reasons = existing_scroll_translation->ScrollNode()
->GetMainThreadScrollingReasons();
@@ -1195,9 +1194,9 @@ void PaintPropertyTreeBuilder::UpdatePaintProperties(
if (needs_paint_properties && !had_paint_properties) {
ObjectPaintProperties& paint_properties =
object.GetMutableForPainting().EnsurePaintProperties();
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && object.HasLayer()) {
paint_properties.SetCompositorElementId(
- CreateDomNodeBasedCompositorElementId(object));
+ CreatePaintLayereBasedCompositorElementId(object));
}
} else if (!needs_paint_properties && had_paint_properties) {
object.GetMutableForPainting().ClearPaintProperties();
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/platform/graphics/CompositorElementId.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698