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