OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 static PassRefPtr<MatrixTransformOperation> create(const TransformationMatri
x& t) | 40 static PassRefPtr<MatrixTransformOperation> create(const TransformationMatri
x& t) |
41 { | 41 { |
42 return adoptRef(new MatrixTransformOperation(t)); | 42 return adoptRef(new MatrixTransformOperation(t)); |
43 } | 43 } |
44 | 44 |
45 TransformationMatrix matrix() const { return TransformationMatrix(m_a, m_b,
m_c, m_d, m_e, m_f); } | 45 TransformationMatrix matrix() const { return TransformationMatrix(m_a, m_b,
m_c, m_d, m_e, m_f); } |
46 | 46 |
47 private: | 47 private: |
48 virtual bool isIdentity() const { return m_a == 1 && m_b == 0 && m_c == 0 &&
m_d == 1 && m_e == 0 && m_f == 0; } | 48 virtual bool isIdentity() const OVERRIDE { return m_a == 1 && !m_b && !m_c &
& m_d == 1 && !m_e && !m_f; } |
49 | 49 |
50 virtual OperationType type() const OVERRIDE { return Matrix; } | 50 virtual OperationType type() const OVERRIDE { return Matrix; } |
51 | 51 |
52 virtual bool operator==(const TransformOperation& o) const | 52 virtual bool operator==(const TransformOperation& o) const |
53 { | 53 { |
54 if (!isSameType(o)) | 54 if (!isSameType(o)) |
55 return false; | 55 return false; |
56 | 56 |
57 const MatrixTransformOperation* m = static_cast<const MatrixTransformOpe
ration*>(&o); | 57 const MatrixTransformOperation* m = static_cast<const MatrixTransformOpe
ration*>(&o); |
58 return m_a == m->m_a && m_b == m->m_b && m_c == m->m_c && m_d == m->m_d
&& m_e == m->m_e && m_f == m->m_f; | 58 return m_a == m->m_a && m_b == m->m_b && m_c == m->m_c && m_d == m->m_d
&& m_e == m->m_e && m_f == m->m_f; |
59 } | 59 } |
60 | 60 |
61 virtual void apply(TransformationMatrix& transform, const FloatSize&) const | 61 virtual void apply(TransformationMatrix& transform, const FloatSize&) const
OVERRIDE |
62 { | 62 { |
63 TransformationMatrix matrix(m_a, m_b, m_c, m_d, m_e, m_f); | 63 TransformationMatrix matrix(m_a, m_b, m_c, m_d, m_e, m_f); |
64 transform.multiply(matrix); | 64 transform.multiply(matrix); |
65 } | 65 } |
66 | 66 |
67 virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from,
double progress, bool blendToIdentity = false); | 67 virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from,
double progress, bool blendToIdentity = false) OVERRIDE; |
68 | 68 |
69 MatrixTransformOperation(double a, double b, double c, double d, double e, d
ouble f) | 69 MatrixTransformOperation(double a, double b, double c, double d, double e, d
ouble f) |
70 : m_a(a) | 70 : m_a(a) |
71 , m_b(b) | 71 , m_b(b) |
72 , m_c(c) | 72 , m_c(c) |
73 , m_d(d) | 73 , m_d(d) |
74 , m_e(e) | 74 , m_e(e) |
75 , m_f(f) | 75 , m_f(f) |
76 { | 76 { |
77 } | 77 } |
(...skipping 12 matching lines...) Expand all Loading... |
90 double m_b; | 90 double m_b; |
91 double m_c; | 91 double m_c; |
92 double m_d; | 92 double m_d; |
93 double m_e; | 93 double m_e; |
94 double m_f; | 94 double m_f; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace WebCore | 97 } // namespace WebCore |
98 | 98 |
99 #endif // MatrixTransformOperation_h | 99 #endif // MatrixTransformOperation_h |
OLD | NEW |