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

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

Issue 2137173002: [SPv2] Respect transform-style in the Blink and cc property trees. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dummyRootEffect Created 4 years, 5 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, or nullptr
21 // for the root. 21 // for the root.
22 class PLATFORM_EXPORT TransformPaintPropertyNode : public RefCounted<TransformPa intPropertyNode> { 22 class PLATFORM_EXPORT TransformPaintPropertyNode : public RefCounted<TransformPa intPropertyNode> {
23 public: 23 public:
24 static PassRefPtr<TransformPaintPropertyNode> create(const TransformationMat rix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent = nullptr) 24 static PassRefPtr<TransformPaintPropertyNode> create(
25 const TransformationMatrix& matrix,
26 const FloatPoint3D& origin,
27 PassRefPtr<TransformPaintPropertyNode> parent = nullptr,
28 bool flattensInheritedTransform = false,
29 unsigned renderingContextID = 0)
25 { 30 {
26 return adoptRef(new TransformPaintPropertyNode(matrix, origin, parent)); 31 return adoptRef(new TransformPaintPropertyNode(matrix, origin, parent, f lattensInheritedTransform, renderingContextID));
27 } 32 }
28 33
29 const TransformationMatrix& matrix() const { return m_matrix; } 34 const TransformationMatrix& matrix() const { return m_matrix; }
30 const FloatPoint3D& origin() const { return m_origin; } 35 const FloatPoint3D& origin() const { return m_origin; }
31 36
32 // Parent transform that this transform is relative to, or nullptr if this 37 // Parent transform that this transform is relative to, or nullptr if this
33 // is the root transform. 38 // is the root transform.
34 TransformPaintPropertyNode* parent() const { return m_parent.get(); } 39 TransformPaintPropertyNode* parent() const { return m_parent.get(); }
35 40
41 // If true, content with this transform node (or its descendant) appears in
42 // the plane of its parent. This is implemented by flattening the total
43 // accumulated transform from its ancestors.
44 bool flattensInheritedTransform() const { return m_flattensInheritedTransfor m; }
45
46 // Content whose transform nodes have a common rendering context ID are 3D
47 // sorted. If this is 0, content will not be 3D sorted.
48 unsigned renderingContextID() const { return m_renderingContextID; }
49 bool hasRenderingContext() const { return m_renderingContextID; }
50
36 private: 51 private:
37 52 TransformPaintPropertyNode(
38 TransformPaintPropertyNode(const TransformationMatrix& matrix, const FloatPo int3D& origin, PassRefPtr<TransformPaintPropertyNode> parent) 53 const TransformationMatrix& matrix,
39 : m_matrix(matrix), m_origin(origin), m_parent(parent) { } 54 const FloatPoint3D& origin,
55 PassRefPtr<TransformPaintPropertyNode> parent,
56 bool flattensInheritedTransform,
57 unsigned renderingContextID)
58 : m_matrix(matrix)
59 , m_origin(origin)
60 , m_parent(parent)
61 , m_flattensInheritedTransform(flattensInheritedTransform)
62 , m_renderingContextID(renderingContextID)
63 {
64 }
40 65
41 const TransformationMatrix m_matrix; 66 const TransformationMatrix m_matrix;
42 const FloatPoint3D m_origin; 67 const FloatPoint3D m_origin;
43 RefPtr<TransformPaintPropertyNode> m_parent; 68 const RefPtr<TransformPaintPropertyNode> m_parent;
69 const bool m_flattensInheritedTransform;
70 const unsigned m_renderingContextID;
44 }; 71 };
45 72
46 // Redeclared here to avoid ODR issues. 73 // Redeclared here to avoid ODR issues.
47 // See platform/testing/PaintPrinters.h. 74 // See platform/testing/PaintPrinters.h.
48 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); 75 void PrintTo(const TransformPaintPropertyNode&, std::ostream*);
49 76
50 } // namespace blink 77 } // namespace blink
51 78
52 #endif // TransformPaintPropertyNode_h 79 #endif // TransformPaintPropertyNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698