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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2782343002: Store local border box property cache outside ObjectPaintProperties (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 bool PaintLayer::sticksToViewport() const { 330 bool PaintLayer::sticksToViewport() const {
331 if (layoutObject().style()->position() != EPosition::kFixed && 331 if (layoutObject().style()->position() != EPosition::kFixed &&
332 layoutObject().style()->position() != EPosition::kSticky) 332 layoutObject().style()->position() != EPosition::kSticky)
333 return false; 333 return false;
334 334
335 // TODO(pdr): This approach of calculating the nearest scroll node is O(n). 335 // TODO(pdr): This approach of calculating the nearest scroll node is O(n).
336 // An option for improving this is to cache the nearest scroll node in 336 // An option for improving this is to cache the nearest scroll node in
337 // the local border box properties. 337 // the local border box properties.
338 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 338 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
339 const auto* viewProperties = layoutObject().view()->paintProperties(); 339 const auto* viewBorderBoxProperties =
340 layoutObject().view()->localBorderBoxProperties();
340 const ScrollPaintPropertyNode* ancestorTargetScrollNode; 341 const ScrollPaintPropertyNode* ancestorTargetScrollNode;
341 if (layoutObject().style()->position() == EPosition::kFixed) { 342 if (layoutObject().style()->position() == EPosition::kFixed) {
342 ancestorTargetScrollNode = viewProperties->localBorderBoxProperties() 343 ancestorTargetScrollNode =
343 ->transform() 344 viewBorderBoxProperties->transform()->findEnclosingScrollNode();
344 ->findEnclosingScrollNode();
345 } else { 345 } else {
346 ancestorTargetScrollNode = viewProperties->contentsProperties() 346 ancestorTargetScrollNode = layoutObject()
347 .view()
348 ->contentsProperties()
347 ->transform() 349 ->transform()
348 ->findEnclosingScrollNode(); 350 ->findEnclosingScrollNode();
349 } 351 }
350 352
351 const auto* properties = layoutObject().paintProperties(); 353 const auto* transform =
352 const auto* transform = properties->localBorderBoxProperties()->transform(); 354 layoutObject().localBorderBoxProperties()->transform();
353 return transform->findEnclosingScrollNode() == ancestorTargetScrollNode; 355 return transform->findEnclosingScrollNode() == ancestorTargetScrollNode;
354 } 356 }
355 357
356 return (layoutObject().style()->position() == EPosition::kFixed && 358 return (layoutObject().style()->position() == EPosition::kFixed &&
357 layoutObject().containerForFixedPosition() == 359 layoutObject().containerForFixedPosition() ==
358 layoutObject().view()) || 360 layoutObject().view()) ||
359 (layoutObject().style()->position() == EPosition::kSticky && 361 (layoutObject().style()->position() == EPosition::kSticky &&
360 (!ancestorScrollingLayer() || ancestorScrollingLayer() == root())); 362 (!ancestorScrollingLayer() || ancestorScrollingLayer() == root()));
361 } 363 }
362 364
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after
3250 } 3252 }
3251 3253
3252 void showLayerTree(const blink::LayoutObject* layoutObject) { 3254 void showLayerTree(const blink::LayoutObject* layoutObject) {
3253 if (!layoutObject) { 3255 if (!layoutObject) {
3254 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3256 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3255 return; 3257 return;
3256 } 3258 }
3257 showLayerTree(layoutObject->enclosingLayer()); 3259 showLayerTree(layoutObject->enclosingLayer());
3258 } 3260 }
3259 #endif 3261 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698