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

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

Issue 2565073002: Implement the algorithm to test merging and overlap in PaintArtifactCompositor. (Closed)
Patch Set: none 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
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"
11 #include "core/layout/LayoutView.h" 11 #include "core/layout/LayoutView.h"
12 #include "core/layout/compositing/CompositingReasonFinder.h"
12 #include "core/layout/svg/LayoutSVGRoot.h" 13 #include "core/layout/svg/LayoutSVGRoot.h"
13 #include "core/paint/FindPropertiesNeedingUpdate.h" 14 #include "core/paint/FindPropertiesNeedingUpdate.h"
14 #include "core/paint/ObjectPaintProperties.h" 15 #include "core/paint/ObjectPaintProperties.h"
15 #include "core/paint/PaintLayer.h" 16 #include "core/paint/PaintLayer.h"
16 #include "core/paint/SVGRootPainter.h" 17 #include "core/paint/SVGRootPainter.h"
17 #include "platform/transforms/TransformationMatrix.h" 18 #include "platform/transforms/TransformationMatrix.h"
18 #include "wtf/PtrUtil.h" 19 #include "wtf/PtrUtil.h"
19 #include <memory> 20 #include <memory>
20 21
21 namespace blink { 22 namespace blink {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // specific property updates here. 116 // specific property updates here.
116 context.current.paintOffset.moveBy(frameView.location()); 117 context.current.paintOffset.moveBy(frameView.location());
117 context.current.renderingContextID = 0; 118 context.current.renderingContextID = 0;
118 context.current.shouldFlattenInheritedTransform = true; 119 context.current.shouldFlattenInheritedTransform = true;
119 context.absolutePosition = context.current; 120 context.absolutePosition = context.current;
120 context.containerForAbsolutePosition = nullptr; 121 context.containerForAbsolutePosition = nullptr;
121 context.fixedPosition = context.current; 122 context.fixedPosition = context.current;
122 return; 123 return;
123 } 124 }
124 125
126 m_compositingReasonFinder.reset(
127 new CompositingReasonFinder(*frameView.layoutView()));
128
125 #if DCHECK_IS_ON() 129 #if DCHECK_IS_ON()
126 FindFrameViewPropertiesNeedingUpdateScope checkScope(&frameView, context); 130 FindFrameViewPropertiesNeedingUpdateScope checkScope(&frameView, context);
127 #endif 131 #endif
128 132
129 if (frameView.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { 133 if (frameView.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) {
130 TransformationMatrix frameTranslate; 134 TransformationMatrix frameTranslate;
131 frameTranslate.translate(frameView.x() + context.current.paintOffset.x(), 135 frameTranslate.translate(frameView.x() + context.current.paintOffset.x(),
132 frameView.y() + context.current.paintOffset.y()); 136 frameView.y() + context.current.paintOffset.y());
133 context.forceSubtreeUpdate |= updatePreTranslation( 137 context.forceSubtreeUpdate |= updatePreTranslation(
134 frameView, context.current.transform, frameTranslate, FloatPoint3D()); 138 frameView, context.current.transform, frameTranslate, FloatPoint3D());
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // If a node with transform-style: preserve-3d does not exist in an 335 // If a node with transform-style: preserve-3d does not exist in an
332 // existing rendering context, it establishes a new one. 336 // existing rendering context, it establishes a new one.
333 unsigned renderingContextID = context.current.renderingContextID; 337 unsigned renderingContextID = context.current.renderingContextID;
334 if (style.preserves3D() && !renderingContextID) 338 if (style.preserves3D() && !renderingContextID)
335 renderingContextID = PtrHash<const LayoutObject>::hash(&object); 339 renderingContextID = PtrHash<const LayoutObject>::hash(&object);
336 340
337 auto& properties = object.getMutableForPainting().ensurePaintProperties(); 341 auto& properties = object.getMutableForPainting().ensurePaintProperties();
338 context.forceSubtreeUpdate |= properties.updateTransform( 342 context.forceSubtreeUpdate |= properties.updateTransform(
339 context.current.transform, matrix, 343 context.current.transform, matrix,
340 transformOrigin(toLayoutBox(object)), 344 transformOrigin(toLayoutBox(object)),
341 context.current.shouldFlattenInheritedTransform, renderingContextID); 345 context.current.shouldFlattenInheritedTransform, renderingContextID,
346 m_compositingReasonFinder->directReasons(
347 toLayoutBoxModelObject(&object)->layer()) &
348 CompositingReason3DTransform);
342 } else { 349 } else {
343 if (auto* properties = object.getMutableForPainting().paintProperties()) 350 if (auto* properties = object.getMutableForPainting().paintProperties())
344 context.forceSubtreeUpdate |= properties->clearTransform(); 351 context.forceSubtreeUpdate |= properties->clearTransform();
345 } 352 }
346 } 353 }
347 354
348 const auto* properties = object.paintProperties(); 355 const auto* properties = object.paintProperties();
349 if (properties && properties->transform()) { 356 if (properties && properties->transform()) {
350 context.current.transform = properties->transform(); 357 context.current.transform = properties->transform();
351 if (object.styleRef().preserves3D()) { 358 if (object.styleRef().preserves3D()) {
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 #endif 914 #endif
908 915
909 updateOverflowClip(object, context); 916 updateOverflowClip(object, context);
910 updatePerspective(object, context); 917 updatePerspective(object, context);
911 updateSvgLocalToBorderBoxTransform(object, context); 918 updateSvgLocalToBorderBoxTransform(object, context);
912 updateScrollAndScrollTranslation(object, context); 919 updateScrollAndScrollTranslation(object, context);
913 updateOutOfFlowContext(object, context); 920 updateOutOfFlowContext(object, context);
914 } 921 }
915 922
916 } // namespace blink 923 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698