Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef TransformPaintProperty_h | |
| 6 #define TransformPaintProperty_h | |
| 7 | |
| 8 #include "platform/PlatformExport.h" | |
| 9 #include "platform/geometry/FloatPoint3D.h" | |
| 10 #include "platform/transforms/TransformationMatrix.h" | |
| 11 #include "wtf/PassRefPtr.h" | |
| 12 #include "wtf/RefCounted.h" | |
| 13 #include "wtf/RefPtr.h" | |
| 14 | |
| 15 #include <iosfwd> | |
| 16 | |
| 17 namespace blink { | |
| 18 | |
| 19 // A transform created by a css property such as "transform" or "perspective" | |
| 20 // along with a reference to the parent TransformPaintProperty, or nullptr for | |
| 21 // the root. | |
| 22 class PLATFORM_EXPORT TransformPaintProperty : public RefCounted<TransformPaintP roperty> { | |
|
jbroman
2015/10/07 15:22:22
nit: Having "node" in this would suggest hierarchy
pdr.
2015/10/07 20:19:11
Changed to TransformPaintPropertyNode. I wanted to
| |
| 23 public: | |
| 24 | |
| 25 // Used for disambiguating multiple transforms of the same type. | |
| 26 enum Type { | |
| 27 Transform, | |
| 28 Perspective | |
|
jbroman
2015/10/07 15:22:22
Hmm. Ideally this distinction wouldn't leak into p
pdr.
2015/10/07 20:19:11
We can remove this for now, but it may be needed (
| |
| 29 }; | |
| 30 | |
| 31 TransformPaintProperty(const Type type, const TransformationMatrix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintProperty> parent = nullptr) | |
|
jbroman
2015/10/07 15:22:22
nit: taking arguments by const value is weird; jus
pdr.
2015/10/07 20:19:11
Fixed. For some reason this reminded me of the awe
| |
| 32 : m_type(type), m_matrix(matrix), m_origin(origin), m_parent(parent) { } | |
| 33 | |
| 34 Type type() const { return m_type; } | |
| 35 const TransformationMatrix& matrix() const { return m_matrix; } | |
| 36 const FloatPoint3D& origin() const { return m_origin; } | |
| 37 | |
| 38 // Parent transform that this transform is relative to, or nullptr if this | |
| 39 // is the root transform. | |
| 40 const TransformPaintProperty* parent() const { return m_parent.get(); } | |
| 41 | |
| 42 private: | |
| 43 const Type m_type; | |
| 44 const TransformationMatrix m_matrix; | |
| 45 const FloatPoint3D m_origin; | |
| 46 RefPtr<TransformPaintProperty> m_parent; | |
| 47 }; | |
| 48 | |
| 49 // Redeclared here to avoid ODR issues. | |
| 50 // See platform/testing/PaintPrinters.h. | |
| 51 void PrintTo(const TransformPaintProperty&, std::ostream*); | |
| 52 | |
| 53 } // namespace blink | |
| 54 | |
| 55 #endif // TransformPaintProperty_h | |
| OLD | NEW |