Chromium Code Reviews| Index: Source/core/style/StyleTransformData.cpp |
| diff --git a/Source/core/style/StyleTransformData.cpp b/Source/core/style/StyleTransformData.cpp |
| index f9f35a5780f5b2d2499175884d2824d24dfc5b6d..36473bb035969ca709f079971a0b51816030c3f7 100644 |
| --- a/Source/core/style/StyleTransformData.cpp |
| +++ b/Source/core/style/StyleTransformData.cpp |
| @@ -21,7 +21,6 @@ |
| #include "config.h" |
| #include "core/style/StyleTransformData.h" |
| - |
|
alancutter (OOO until 2018)
2015/06/12 07:56:31
These two headers should always be separated from
soonm
2015/06/15 05:07:17
Done.
|
| #include "core/style/ComputedStyle.h" |
| namespace blink { |
| @@ -38,12 +37,77 @@ StyleTransformData::StyleTransformData(const StyleTransformData& o) |
| , m_operations(o.m_operations) |
| , m_origin(o.m_origin) |
| , m_motion(o.m_motion) |
| + , m_translate(o.m_translate) |
| + , m_rotate(o.m_rotate) |
| + , m_scale(o.m_scale) |
| { |
| } |
| bool StyleTransformData::operator==(const StyleTransformData& o) const |
| { |
| - return m_origin == o.m_origin && m_operations == o.m_operations && m_motion == o.m_motion; |
| + return m_origin == o.m_origin |
| + && m_operations == o.m_operations |
| + && m_motion == o.m_motion |
| + && m_translate == o.m_translate |
| + && m_rotate == o.m_rotate |
| + && m_scale == o.m_scale; |
| +} |
| + |
| +bool StyleTransformData::has3DTransformProperties() const |
| +{ |
| + bool b = false; |
| + b |= m_translate ? m_translate->is3DOperation() : false; |
|
Timothy Loh
2015/06/05 00:56:00
m_translate && m_translate->is3DOperation()
Eric Willigers
2015/06/05 01:58:23
Perhaps
if (m_translate && m_translate->is3DOperat
soonm
2015/06/10 04:09:32
Done.
|
| + b |= m_rotate ? m_rotate->is3DOperation() : false; |
| + b |= m_scale ? m_scale->is3DOperation() : false; |
| + return b; |
| +} |
| + |
| +void StyleTransformData::setTranslate(PassRefPtr<TranslateTransformOperation> translate) |
| +{ |
| + m_translate = translate; |
| +} |
| + |
| +void StyleTransformData::setTranslate(const Length& tx, const Length& ty, const double& tz) |
| +{ |
| + TransformOperation::OperationType type; |
| + if (tz == 0) { |
| + if (ty.isZero()) |
| + type = TransformOperation::TranslateX; |
| + else |
| + type = TransformOperation::Translate; |
| + } else { |
| + type = TransformOperation::Translate3D; |
| + } |
| + m_translate = TranslateTransformOperation::create(tx, ty, tz, type); |
| +} |
| + |
| +void StyleTransformData::setRotate(const double& angle, const double& x, const double& y, const double& z) |
| +{ |
| + m_rotate = RotateTransformOperation::create(x, y, z, angle, TransformOperation::Rotate3D); |
| +} |
| + |
| +void StyleTransformData::setRotate(PassRefPtr<RotateTransformOperation> rotate) |
| +{ |
| + m_rotate = rotate; |
| +} |
| + |
| +void StyleTransformData::setScale(const double& sx, const double& sy, const double& sz) |
| +{ |
| + TransformOperation::OperationType type; |
| + if (sz == 0) { |
| + if (sy == 0) |
| + type = TransformOperation::ScaleX; |
| + else |
| + type = TransformOperation::Scale; |
| + } else { |
| + type = TransformOperation::Scale3D; |
| + } |
| + m_scale = ScaleTransformOperation::create(sx, sy, sz, type); |
| +} |
| + |
| +void StyleTransformData::setScale(PassRefPtr<ScaleTransformOperation> scale) |
| +{ |
| + m_scale = scale; |
| } |
| } // namespace blink |