OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 return defaultInterpolateTo(this, value, fraction); | 47 return defaultInterpolateTo(this, value, fraction); |
48 | 48 |
49 const AnimatableFilterOperations* target = toAnimatableFilterOperations(valu
e); | 49 const AnimatableFilterOperations* target = toAnimatableFilterOperations(valu
e); |
50 FilterOperations result; | 50 FilterOperations result; |
51 size_t fromSize = operations().size(); | 51 size_t fromSize = operations().size(); |
52 size_t toSize = target->operations().size(); | 52 size_t toSize = target->operations().size(); |
53 size_t size = std::max(fromSize, toSize); | 53 size_t size = std::max(fromSize, toSize); |
54 for (size_t i = 0; i < size; i++) { | 54 for (size_t i = 0; i < size; i++) { |
55 FilterOperation* from = (i < fromSize) ? m_operations.operations()[i].ge
t() : 0; | 55 FilterOperation* from = (i < fromSize) ? m_operations.operations()[i].ge
t() : 0; |
56 FilterOperation* to = (i < toSize) ? target->m_operations.operations()[i
].get() : 0; | 56 FilterOperation* to = (i < toSize) ? target->m_operations.operations()[i
].get() : 0; |
57 RefPtr<FilterOperation> blendedOp = FilterOperation::blend(from, to, fra
ction); | 57 RefPtrWillBeRawPtr<FilterOperation> blendedOp = FilterOperation::blend(f
rom, to, fraction); |
58 if (blendedOp) | 58 if (blendedOp) |
59 result.operations().append(blendedOp); | 59 result.operations().append(blendedOp); |
60 else | 60 else |
61 ASSERT_NOT_REACHED(); | 61 ASSERT_NOT_REACHED(); |
62 } | 62 } |
63 return AnimatableFilterOperations::create(result); | 63 return AnimatableFilterOperations::create(result); |
64 } | 64 } |
65 | 65 |
66 bool AnimatableFilterOperations::equalTo(const AnimatableValue* value) const | 66 bool AnimatableFilterOperations::equalTo(const AnimatableValue* value) const |
67 { | 67 { |
68 return operations() == toAnimatableFilterOperations(value)->operations(); | 68 return operations() == toAnimatableFilterOperations(value)->operations(); |
69 } | 69 } |
70 | 70 |
| 71 void AnimatableFilterOperations::trace(Visitor* visitor) |
| 72 { |
| 73 visitor->trace(m_operations); |
| 74 AnimatableValue::trace(visitor); |
71 } | 75 } |
| 76 |
| 77 } // namespace blink |
OLD | NEW |