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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h

Issue 2364103003: Switch RootLayerScrolls to use root transform and scroll properties (Closed)
Patch Set: Created 4 years, 2 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 #ifndef TransformPaintPropertyNode_h 5 #ifndef TransformPaintPropertyNode_h
6 #define TransformPaintPropertyNode_h 6 #define TransformPaintPropertyNode_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/geometry/FloatPoint3D.h" 9 #include "platform/geometry/FloatPoint3D.h"
10 #include "platform/transforms/TransformationMatrix.h" 10 #include "platform/transforms/TransformationMatrix.h"
11 #include "wtf/PassRefPtr.h" 11 #include "wtf/PassRefPtr.h"
12 #include "wtf/RefCounted.h" 12 #include "wtf/RefCounted.h"
13 #include "wtf/RefPtr.h" 13 #include "wtf/RefPtr.h"
14 14
15 #include <iosfwd> 15 #include <iosfwd>
16 16
17 namespace blink { 17 namespace blink {
18 18
19 // A transform created by a css property such as "transform" or "perspective" 19 // A transform created by a css property such as "transform" or "perspective"
20 // along with a reference to the parent TransformPaintPropertyNode, or nullptr 20 // along with a reference to the parent TransformPaintPropertyNode.
21 // for the root. 21 //
22 // The transform tree is rooted at a node with no parent. This root node should
23 // not be modified.
22 class PLATFORM_EXPORT TransformPaintPropertyNode : public RefCounted<TransformPa intPropertyNode> { 24 class PLATFORM_EXPORT TransformPaintPropertyNode : public RefCounted<TransformPa intPropertyNode> {
23 public: 25 public:
24 static PassRefPtr<TransformPaintPropertyNode> create( 26 static PassRefPtr<TransformPaintPropertyNode> create(
25 PassRefPtr<const TransformPaintPropertyNode> parent, 27 PassRefPtr<const TransformPaintPropertyNode> parent,
26 const TransformationMatrix& matrix, 28 const TransformationMatrix& matrix,
27 const FloatPoint3D& origin, 29 const FloatPoint3D& origin,
28 bool flattensInheritedTransform = false, 30 bool flattensInheritedTransform = false,
29 unsigned renderingContextID = 0) 31 unsigned renderingContextID = 0)
30 { 32 {
31 return adoptRef(new TransformPaintPropertyNode(matrix, origin, std::move (parent), flattensInheritedTransform, renderingContextID)); 33 return adoptRef(new TransformPaintPropertyNode(matrix, origin, std::move (parent), flattensInheritedTransform, renderingContextID));
32 } 34 }
33 35
34 void update(PassRefPtr<const TransformPaintPropertyNode> parent, const Trans formationMatrix& matrix, const FloatPoint3D& origin, bool flattensInheritedTrans form = false, unsigned renderingContextID = 0) 36 void update(PassRefPtr<const TransformPaintPropertyNode> parent, const Trans formationMatrix& matrix, const FloatPoint3D& origin, bool flattensInheritedTrans form = false, unsigned renderingContextID = 0)
35 { 37 {
38 DCHECK(!isRoot());
36 DCHECK(parent != this); 39 DCHECK(parent != this);
37 m_parent = parent; 40 m_parent = parent;
38 m_matrix = matrix; 41 m_matrix = matrix;
39 m_origin = origin; 42 m_origin = origin;
40 m_flattensInheritedTransform = flattensInheritedTransform; 43 m_flattensInheritedTransform = flattensInheritedTransform;
41 m_renderingContextID = renderingContextID; 44 m_renderingContextID = renderingContextID;
42 } 45 }
43 46
44 const TransformationMatrix& matrix() const { return m_matrix; } 47 const TransformationMatrix& matrix() const { return m_matrix; }
45 const FloatPoint3D& origin() const { return m_origin; } 48 const FloatPoint3D& origin() const { return m_origin; }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 unsigned m_renderingContextID; 84 unsigned m_renderingContextID;
82 }; 85 };
83 86
84 // Redeclared here to avoid ODR issues. 87 // Redeclared here to avoid ODR issues.
85 // See platform/testing/PaintPrinters.h. 88 // See platform/testing/PaintPrinters.h.
86 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); 89 void PrintTo(const TransformPaintPropertyNode&, std::ostream*);
87 90
88 } // namespace blink 91 } // namespace blink
89 92
90 #endif // TransformPaintPropertyNode_h 93 #endif // TransformPaintPropertyNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698