| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/animation/CSSTranslateInterpolationType.h" | 5 #include "core/animation/CSSTranslateInterpolationType.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include "core/animation/LengthInterpolationFunctions.h" | 8 #include "core/animation/LengthInterpolationFunctions.h" |
| 9 #include "core/css/CSSValueList.h" | 9 #include "core/css/CSSValueList.h" |
| 10 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 InterpolationValue convertTranslateOperation( | 74 InterpolationValue convertTranslateOperation( |
| 75 const TranslateTransformOperation* translate, | 75 const TranslateTransformOperation* translate, |
| 76 double zoom) { | 76 double zoom) { |
| 77 if (!translate) | 77 if (!translate) |
| 78 return createNoneValue(); | 78 return createNoneValue(); |
| 79 | 79 |
| 80 std::unique_ptr<InterpolableList> result = | 80 std::unique_ptr<InterpolableList> result = |
| 81 InterpolableList::create(TranslateComponentIndexCount); | 81 InterpolableList::create(TranslateComponentIndexCount); |
| 82 result->set(TranslateX, LengthInterpolationFunctions::maybeConvertLength( | 82 result->set( |
| 83 translate->x(), zoom) | 83 TranslateX, |
| 84 .interpolableValue); | 84 LengthInterpolationFunctions::maybeConvertLength(translate->x(), zoom) |
| 85 result->set(TranslateY, LengthInterpolationFunctions::maybeConvertLength( | 85 .interpolableValue); |
| 86 translate->y(), zoom) | 86 result->set( |
| 87 .interpolableValue); | 87 TranslateY, |
| 88 result->set(TranslateZ, LengthInterpolationFunctions::maybeConvertLength( | 88 LengthInterpolationFunctions::maybeConvertLength(translate->y(), zoom) |
| 89 Length(translate->z(), Fixed), zoom) | 89 .interpolableValue); |
| 90 .interpolableValue); | 90 result->set(TranslateZ, |
| 91 LengthInterpolationFunctions::maybeConvertLength( |
| 92 Length(translate->z(), Fixed), zoom) |
| 93 .interpolableValue); |
| 91 return InterpolationValue(std::move(result)); | 94 return InterpolationValue(std::move(result)); |
| 92 } | 95 } |
| 93 | 96 |
| 94 } // namespace | 97 } // namespace |
| 95 | 98 |
| 96 InterpolationValue CSSTranslateInterpolationType::maybeConvertNeutral( | 99 InterpolationValue CSSTranslateInterpolationType::maybeConvertNeutral( |
| 97 const InterpolationValue& underlying, | 100 const InterpolationValue& underlying, |
| 98 ConversionCheckers&) const { | 101 ConversionCheckers&) const { |
| 99 return InterpolationValue(createIdentityInterpolableValue()); | 102 return InterpolationValue(createIdentityInterpolableValue()); |
| 100 } | 103 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 *list.get(TranslateZ), nullptr, conversionData, ValueRangeAll) | 207 *list.get(TranslateZ), nullptr, conversionData, ValueRangeAll) |
| 205 .pixels(); | 208 .pixels(); |
| 206 | 209 |
| 207 RefPtr<TranslateTransformOperation> result = | 210 RefPtr<TranslateTransformOperation> result = |
| 208 TranslateTransformOperation::create(x, y, z, | 211 TranslateTransformOperation::create(x, y, z, |
| 209 TransformOperation::Translate3D); | 212 TransformOperation::Translate3D); |
| 210 state.style()->setTranslate(std::move(result)); | 213 state.style()->setTranslate(std::move(result)); |
| 211 } | 214 } |
| 212 | 215 |
| 213 } // namespace blink | 216 } // namespace blink |
| OLD | NEW |