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

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

Issue 2538273002: Use a create-or-update pattern for faster local border box property updates (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/ObjectPaintProperties.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintPropertyTreeBuilder.h" 5 #include "core/paint/PaintPropertyTreeBuilder.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 PaintPropertyTreeBuilderContext& context) { 458 PaintPropertyTreeBuilderContext& context) {
459 if (!object.needsPaintPropertyUpdate()) 459 if (!object.needsPaintPropertyUpdate())
460 return; 460 return;
461 461
462 // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since 462 // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since
463 // we don't need them at the moment. 463 // we don't need them at the moment.
464 if (!object.isBox() && !object.hasLayer()) { 464 if (!object.isBox() && !object.hasLayer()) {
465 if (auto* properties = object.getMutableForPainting().paintProperties()) 465 if (auto* properties = object.getMutableForPainting().paintProperties())
466 properties->clearLocalBorderBoxProperties(); 466 properties->clearLocalBorderBoxProperties();
467 } else { 467 } else {
468 std::unique_ptr<ObjectPaintProperties::PropertyTreeStateWithOffset> 468 auto& properties = object.getMutableForPainting().ensurePaintProperties();
469 borderBoxContext = 469 properties.updateLocalBorderBoxProperties(
470 wrapUnique(new ObjectPaintProperties::PropertyTreeStateWithOffset( 470 context.current.paintOffset, context.current.transform,
471 context.current.paintOffset, 471 context.current.clip, context.currentEffect, context.current.scroll);
472 PropertyTreeState(context.current.transform,
473 context.current.clip, context.currentEffect,
474 context.current.scroll)));
475 object.getMutableForPainting()
476 .ensurePaintProperties()
477 .setLocalBorderBoxProperties(std::move(borderBoxContext));
478 } 472 }
479 } 473 }
480 474
481 // TODO(trchen): Remove this once we bake the paint offset into frameRect. 475 // TODO(trchen): Remove this once we bake the paint offset into frameRect.
482 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset( 476 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(
483 const LayoutObject& object, 477 const LayoutObject& object,
484 const PaintPropertyTreeBuilderContext& context) { 478 const PaintPropertyTreeBuilderContext& context) {
485 if (!object.needsPaintPropertyUpdate()) 479 if (!object.needsPaintPropertyUpdate())
486 return; 480 return;
487 481
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 #endif 894 #endif
901 895
902 updateOverflowClip(object, context); 896 updateOverflowClip(object, context);
903 updatePerspective(object, context); 897 updatePerspective(object, context);
904 updateSvgLocalToBorderBoxTransform(object, context); 898 updateSvgLocalToBorderBoxTransform(object, context);
905 updateScrollAndScrollTranslation(object, context); 899 updateScrollAndScrollTranslation(object, context);
906 updateOutOfFlowContext(object, context); 900 updateOutOfFlowContext(object, context);
907 } 901 }
908 902
909 } // namespace blink 903 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ObjectPaintProperties.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698