OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010, 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010, 2011. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "core/svg/SVGPathBlender.h" | 21 #include "core/svg/SVGPathBlender.h" |
22 | 22 |
23 #include "core/svg/SVGPathSeg.h" | 23 #include "core/svg/SVGPathSeg.h" |
24 #include "core/svg/SVGPathSource.h" | 24 #include "core/svg/SVGPathSource.h" |
25 #include "platform/animation/AnimationUtilities.h" | 25 #include "platform/animation/AnimationUtilities.h" |
26 #include "wtf/TemporaryChange.h" | 26 #include "wtf/TemporaryChange.h" |
27 | 27 |
28 namespace blink { | 28 namespace blink { |
29 | 29 |
30 SVGPathBlender::SVGPathBlender() | 30 SVGPathBlender::SVGPathBlender() |
31 : m_fromSource(0) | 31 : m_fromSource(nullptr) |
32 , m_toSource(0) | 32 , m_toSource(nullptr) |
33 , m_consumer(0) | 33 , m_consumer(nullptr) |
34 , m_progress(0) | 34 , m_progress(0) |
35 , m_addTypesCount(0) | 35 , m_addTypesCount(0) |
36 , m_isInFirstHalfOfAnimation(false) | 36 , m_isInFirstHalfOfAnimation(false) |
37 { | 37 { |
38 } | 38 } |
39 | 39 |
| 40 void SVGPathBlender::trace(Visitor* visitor) |
| 41 { |
| 42 visitor->trace(m_fromSource); |
| 43 visitor->trace(m_toSource); |
| 44 visitor->trace(m_consumer); |
| 45 } |
| 46 |
40 // Helper functions | 47 // Helper functions |
41 static inline FloatPoint blendFloatPoint(const FloatPoint& a, const FloatPoint&
b, float progress) | 48 static inline FloatPoint blendFloatPoint(const FloatPoint& a, const FloatPoint&
b, float progress) |
42 { | 49 { |
43 return FloatPoint(blend(a.x(), b.x(), progress), blend(a.y(), b.y(), progres
s)); | 50 return FloatPoint(blend(a.x(), b.x(), progress), blend(a.y(), b.y(), progres
s)); |
44 } | 51 } |
45 | 52 |
46 float SVGPathBlender::blendAnimatedDimensonalFloat(float from, float to, FloatBl
endMode blendMode) | 53 float SVGPathBlender::blendAnimatedDimensonalFloat(float from, float to, FloatBl
endMode blendMode) |
47 { | 54 { |
48 if (m_addTypesCount) { | 55 if (m_addTypesCount) { |
49 ASSERT(m_fromMode == m_toMode); | 56 ASSERT(m_fromMode == m_toMode); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 return true; | 399 return true; |
393 } | 400 } |
394 | 401 |
395 void SVGPathBlender::cleanup() | 402 void SVGPathBlender::cleanup() |
396 { | 403 { |
397 ASSERT(m_toSource); | 404 ASSERT(m_toSource); |
398 ASSERT(m_fromSource); | 405 ASSERT(m_fromSource); |
399 ASSERT(m_consumer); | 406 ASSERT(m_consumer); |
400 | 407 |
401 m_consumer->cleanup(); | 408 m_consumer->cleanup(); |
402 m_toSource = 0; | 409 m_toSource = nullptr; |
403 m_fromSource = 0; | 410 m_fromSource = nullptr; |
404 m_consumer = 0; | 411 m_consumer = nullptr; |
405 m_fromCurrentPoint = FloatPoint(); | 412 m_fromCurrentPoint = FloatPoint(); |
406 m_toCurrentPoint = FloatPoint(); | 413 m_toCurrentPoint = FloatPoint(); |
407 } | 414 } |
408 | 415 |
409 } | 416 } |
OLD | NEW |