| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return result; | 98 return result; |
| 99 } | 99 } |
| 100 | 100 |
| 101 PassRefPtr<TransformOperation> | 101 PassRefPtr<TransformOperation> |
| 102 TransformOperations::blendByUsingMatrixInterpolation( | 102 TransformOperations::blendByUsingMatrixInterpolation( |
| 103 const TransformOperations& from, | 103 const TransformOperations& from, |
| 104 double progress) const { | 104 double progress) const { |
| 105 if (dependsOnBoxSize() || from.dependsOnBoxSize()) | 105 if (dependsOnBoxSize() || from.dependsOnBoxSize()) |
| 106 return InterpolatedTransformOperation::create(from, *this, progress); | 106 return InterpolatedTransformOperation::create(from, *this, progress); |
| 107 | 107 |
| 108 // Evaluate blended matrix here to avoid creating a nested data structure of u
nbounded depth. | 108 // Evaluate blended matrix here to avoid creating a nested data structure of |
| 109 // unbounded depth. |
| 109 TransformationMatrix fromTransform; | 110 TransformationMatrix fromTransform; |
| 110 TransformationMatrix toTransform; | 111 TransformationMatrix toTransform; |
| 111 from.apply(FloatSize(), fromTransform); | 112 from.apply(FloatSize(), fromTransform); |
| 112 apply(FloatSize(), toTransform); | 113 apply(FloatSize(), toTransform); |
| 113 toTransform.blend(fromTransform, progress); | 114 toTransform.blend(fromTransform, progress); |
| 114 return Matrix3DTransformOperation::create(toTransform); | 115 return Matrix3DTransformOperation::create(toTransform); |
| 115 } | 116 } |
| 116 | 117 |
| 117 TransformOperations TransformOperations::blend(const TransformOperations& from, | 118 TransformOperations TransformOperations::blend(const TransformOperations& from, |
| 118 double progress) const { | 119 double progress) const { |
| 119 if (from == *this || (!from.size() && !size())) | 120 if (from == *this || (!from.size() && !size())) |
| 120 return *this; | 121 return *this; |
| 121 | 122 |
| 122 // If either list is empty, use blendByMatchingOperations which has special lo
gic for this case. | 123 // If either list is empty, use blendByMatchingOperations which has special |
| 124 // logic for this case. |
| 123 if (!from.size() || !size() || from.operationsMatch(*this)) | 125 if (!from.size() || !size() || from.operationsMatch(*this)) |
| 124 return blendByMatchingOperations(from, progress); | 126 return blendByMatchingOperations(from, progress); |
| 125 | 127 |
| 126 TransformOperations result; | 128 TransformOperations result; |
| 127 result.operations().append(blendByUsingMatrixInterpolation(from, progress)); | 129 result.operations().append(blendByUsingMatrixInterpolation(from, progress)); |
| 128 return result; | 130 return result; |
| 129 } | 131 } |
| 130 | 132 |
| 131 static void findCandidatesInPlane(double px, | 133 static void findCandidatesInPlane(double px, |
| 132 double py, | 134 double py, |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 427 } |
| 426 | 428 |
| 427 TransformOperations TransformOperations::zoom(double factor) const { | 429 TransformOperations TransformOperations::zoom(double factor) const { |
| 428 TransformOperations result; | 430 TransformOperations result; |
| 429 for (auto& transformOperation : m_operations) | 431 for (auto& transformOperation : m_operations) |
| 430 result.m_operations.append(transformOperation->zoom(factor)); | 432 result.m_operations.append(transformOperation->zoom(factor)); |
| 431 return result; | 433 return result; |
| 432 } | 434 } |
| 433 | 435 |
| 434 } // namespace blink | 436 } // namespace blink |
| OLD | NEW |