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

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

Issue 2036533002: Combine PaintPropertyTreeBuilderRootContext into PaintPropertyTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Rename
Patch Set: Created 4 years, 6 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 // 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/LayoutPart.h" 11 #include "core/layout/LayoutPart.h"
12 #include "core/paint/ObjectPaintProperties.h" 12 #include "core/paint/ObjectPaintProperties.h"
13 #include "core/paint/PaintLayer.h" 13 #include "core/paint/PaintLayer.h"
14 #include "platform/transforms/TransformationMatrix.h" 14 #include "platform/transforms/TransformationMatrix.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPro pertyTreeBuilderRootContext& rootContext) 18 void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPro pertyTreeBuilderContext& context)
19 { 19 {
20 // Only create extra root clip and transform nodes when RLS is enabled, beca use the main frame 20 // Only create extra root clip and transform nodes when RLS is enabled, beca use the main frame
21 // unconditionally create frame translation / clip nodes otherwise. 21 // unconditionally create frame translation / clip nodes otherwise.
22 if (rootFrame.frame().settings() && rootFrame.frame().settings()->rootLayerS crolls()) { 22 if (rootFrame.frame().settings() && rootFrame.frame().settings()->rootLayerS crolls()) {
23 rootContext.transformRoot = TransformPaintPropertyNode::create(Transform ationMatrix(), FloatPoint3D(), nullptr); 23 transformRoot = TransformPaintPropertyNode::create(TransformationMatrix( ), FloatPoint3D(), nullptr);
24 rootContext.currentTransform = rootContext.transformForAbsolutePosition = rootContext.transformForFixedPosition = rootContext.transformRoot.get(); 24 context.currentTransform = context.transformForAbsolutePosition = contex t.transformForFixedPosition = transformRoot.get();
25 25
26 rootContext.clipRoot = ClipPaintPropertyNode::create(rootContext.transfo rmRoot, FloatRoundedRect(LayoutRect::infiniteIntRect()), nullptr); 26 clipRoot = ClipPaintPropertyNode::create(transformRoot, FloatRoundedRect (LayoutRect::infiniteIntRect()), nullptr);
27 rootContext.currentClip = rootContext.clipForAbsolutePosition = rootCont ext.clipForFixedPosition = rootContext.clipRoot.get(); 27 context.currentClip = context.clipForAbsolutePosition = context.clipForF ixedPosition = clipRoot.get();
28 } 28 }
29 29
30 // The root frame never creates effect node so we unconditionally create a r oot node here. 30 // The root frame never creates effect node so we unconditionally create a r oot node here.
31 rootContext.effectRoot = EffectPaintPropertyNode::create(1.0, nullptr); 31 effectRoot = EffectPaintPropertyNode::create(1.0, nullptr);
32 rootContext.currentEffect = rootContext.effectRoot.get(); 32 context.currentEffect = effectRoot.get();
33 } 33 }
34 34
35 void PaintPropertyTreeBuilder::buildTreeNodes(FrameView& frameView, PaintPropert yTreeBuilderContext& context) 35 void PaintPropertyTreeBuilder::buildTreeNodes(FrameView& frameView, PaintPropert yTreeBuilderContext& context)
36 { 36 {
37 // TODO(pdr): Creating paint properties for FrameView here will not be 37 // TODO(pdr): Creating paint properties for FrameView here will not be
38 // needed once settings()->rootLayerScrolls() is enabled. 38 // needed once settings()->rootLayerScrolls() is enabled.
39 // TODO(pdr): Make this conditional on the rootLayerScrolls setting. 39 // TODO(pdr): Make this conditional on the rootLayerScrolls setting.
40 40
41 TransformationMatrix frameTranslate; 41 TransformationMatrix frameTranslate;
42 frameTranslate.translate(frameView.x() + context.paintOffset.x(), frameView. y() + context.paintOffset.y()); 42 frameTranslate.translate(frameView.x() + context.paintOffset.x(), frameView. y() + context.paintOffset.y());
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 updateOverflowClip(object, context); 372 updateOverflowClip(object, context);
373 // TODO(trchen): Insert flattening transform here, as specified by 373 // TODO(trchen): Insert flattening transform here, as specified by
374 // http://www.w3.org/TR/css3-transforms/#transform-style-property 374 // http://www.w3.org/TR/css3-transforms/#transform-style-property
375 updatePerspective(object, context); 375 updatePerspective(object, context);
376 updateSvgLocalTransform(object, context); 376 updateSvgLocalTransform(object, context);
377 updateScrollTranslation(object, context); 377 updateScrollTranslation(object, context);
378 updateOutOfFlowContext(object, context); 378 updateOutOfFlowContext(object, context);
379 } 379 }
380 380
381 } // namespace blink 381 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698