OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #include "platform/animation/CompositorTransformOperations.h" |
| 6 |
| 7 #include "ui/gfx/transform.h" |
| 8 #include <algorithm> |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 CompositorTransformOperations::CompositorTransformOperations() |
| 13 { |
| 14 } |
| 15 |
| 16 CompositorTransformOperations::~CompositorTransformOperations() |
| 17 { |
| 18 } |
| 19 |
| 20 const cc::TransformOperations& CompositorTransformOperations::asTransformOperati
ons() const |
| 21 { |
| 22 return m_transformOperations; |
| 23 } |
| 24 |
| 25 bool CompositorTransformOperations::canBlendWith(const blink::CompositorTransfor
mOperations& other) const |
| 26 { |
| 27 return m_transformOperations.CanBlendWith(other.m_transformOperations); |
| 28 } |
| 29 |
| 30 void CompositorTransformOperations::appendTranslate(double x, double y, double z
) |
| 31 { |
| 32 m_transformOperations.AppendTranslate(x, y, z); |
| 33 } |
| 34 |
| 35 void CompositorTransformOperations::appendRotate(double x, double y, double z, d
ouble degrees) |
| 36 { |
| 37 m_transformOperations.AppendRotate(x, y, z, degrees); |
| 38 } |
| 39 |
| 40 void CompositorTransformOperations::appendScale(double x, double y, double z) |
| 41 { |
| 42 m_transformOperations.AppendScale(x, y, z); |
| 43 } |
| 44 |
| 45 void CompositorTransformOperations::appendSkew(double x, double y) |
| 46 { |
| 47 m_transformOperations.AppendSkew(x, y); |
| 48 } |
| 49 |
| 50 void CompositorTransformOperations::appendPerspective(double depth) |
| 51 { |
| 52 m_transformOperations.AppendPerspective(depth); |
| 53 } |
| 54 |
| 55 void CompositorTransformOperations::appendMatrix(const SkMatrix44& matrix) |
| 56 { |
| 57 gfx::Transform transform(gfx::Transform::kSkipInitialization); |
| 58 transform.matrix() = matrix; |
| 59 m_transformOperations.AppendMatrix(transform); |
| 60 } |
| 61 |
| 62 void CompositorTransformOperations::appendIdentity() |
| 63 { |
| 64 m_transformOperations.AppendIdentity(); |
| 65 } |
| 66 |
| 67 bool CompositorTransformOperations::isIdentity() const |
| 68 { |
| 69 return m_transformOperations.IsIdentity(); |
| 70 } |
| 71 |
| 72 } // namespace blink |
OLD | NEW |