OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void TransformState::applyTransform(const AffineTransform& transformFromContaine
r, TransformAccumulation accumulate, bool* wasClamped) | 104 void TransformState::applyTransform(const AffineTransform& transformFromContaine
r, TransformAccumulation accumulate, bool* wasClamped) |
105 { | 105 { |
106 applyTransform(transformFromContainer.toTransformationMatrix(), accumulate,
wasClamped); | 106 applyTransform(transformFromContainer.toTransformationMatrix(), accumulate,
wasClamped); |
107 } | 107 } |
108 | 108 |
109 void TransformState::applyTransform(const TransformationMatrix& transformFromCon
tainer, TransformAccumulation accumulate, bool* wasClamped) | 109 void TransformState::applyTransform(const TransformationMatrix& transformFromCon
tainer, TransformAccumulation accumulate, bool* wasClamped) |
110 { | 110 { |
111 if (wasClamped) | 111 if (wasClamped) |
112 *wasClamped = false; | 112 *wasClamped = false; |
113 | 113 |
| 114 if (transformFromContainer.isIntegerTranslation()) { |
| 115 move(LayoutSize(transformFromContainer.e(), transformFromContainer.f()),
accumulate); |
| 116 return; |
| 117 } |
| 118 |
114 applyAccumulatedOffset(); | 119 applyAccumulatedOffset(); |
115 | 120 |
116 // If we have an accumulated transform from last time, multiply in this tran
sform | 121 // If we have an accumulated transform from last time, multiply in this tran
sform |
117 if (m_accumulatedTransform) { | 122 if (m_accumulatedTransform) { |
118 if (m_direction == ApplyTransformDirection) | 123 if (m_direction == ApplyTransformDirection) |
119 m_accumulatedTransform = adoptPtr(new TransformationMatrix(transform
FromContainer * *m_accumulatedTransform)); | 124 m_accumulatedTransform = adoptPtr(new TransformationMatrix(transform
FromContainer * *m_accumulatedTransform)); |
120 else | 125 else |
121 m_accumulatedTransform->multiply(transformFromContainer); | 126 m_accumulatedTransform->multiply(transformFromContainer); |
122 } else if (accumulate == AccumulateTransform) { | 127 } else if (accumulate == AccumulateTransform) { |
123 // Make one if we started to accumulate | 128 // Make one if we started to accumulate |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 200 |
196 // We could throw away m_accumulatedTransform if we wanted to here, but that | 201 // We could throw away m_accumulatedTransform if we wanted to here, but that |
197 // would cause thrash when traversing hierarchies with alternating | 202 // would cause thrash when traversing hierarchies with alternating |
198 // preserve-3d and flat elements. | 203 // preserve-3d and flat elements. |
199 if (m_accumulatedTransform) | 204 if (m_accumulatedTransform) |
200 m_accumulatedTransform->makeIdentity(); | 205 m_accumulatedTransform->makeIdentity(); |
201 m_accumulatingTransform = false; | 206 m_accumulatingTransform = false; |
202 } | 207 } |
203 | 208 |
204 } // namespace WebCore | 209 } // namespace WebCore |
OLD | NEW |