Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: Source/core/animation/AnimatableStrokeDasharrayList.cpp

Issue 204743002: Oilpan: Move AnimatableValue's hierarchy to oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 lengths->append(length); 55 lengths->append(length);
56 } 56 }
57 return lengths.release(); 57 return lengths.release();
58 } 58 }
59 59
60 bool AnimatableStrokeDasharrayList::usesDefaultInterpolationWith(const Animatabl eValue* value) const 60 bool AnimatableStrokeDasharrayList::usesDefaultInterpolationWith(const Animatabl eValue* value) const
61 { 61 {
62 return false; 62 return false;
63 } 63 }
64 64
65 PassRefPtr<AnimatableValue> AnimatableStrokeDasharrayList::interpolateTo(const A nimatableValue* value, double fraction) const 65 PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableStrokeDasharrayList::interpola teTo(const AnimatableValue* value, double fraction) const
66 { 66 {
67 Vector<RefPtr<AnimatableValue> > from = m_values; 67 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > from = m_values;
68 Vector<RefPtr<AnimatableValue> > to = toAnimatableStrokeDasharrayList(value) ->m_values; 68 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > to = toAnimatableStro keDasharrayList(value)->m_values;
69 69
70 // The spec states that if the sum of all values is zero, this should be 70 // The spec states that if the sum of all values is zero, this should be
71 // treated like a value of 'none', which means that a solid line is drawn. 71 // treated like a value of 'none', which means that a solid line is drawn.
72 // Since we animate to and from values of zero, treat a value of 'none' the 72 // Since we animate to and from values of zero, treat a value of 'none' the
73 // same. If both the two and from values are 'none', we return 'none' 73 // same. If both the two and from values are 'none', we return 'none'
74 // rather than '0 0'. 74 // rather than '0 0'.
75 if (from.isEmpty() && to.isEmpty()) 75 if (from.isEmpty() && to.isEmpty())
76 return takeConstRef(this); 76 return takeConstRef(this);
77 if (from.isEmpty() || to.isEmpty()) { 77 if (from.isEmpty() || to.isEmpty()) {
78 #if ENABLE_OILPAN
79 DEFINE_STATIC_LOCAL(Persistent<AnimatableSVGLength>, zeroPixels, (Animat ableSVGLength::create(SVGLength::create())));
80 #else
78 DEFINE_STATIC_REF(AnimatableSVGLength, zeroPixels, AnimatableSVGLength:: create(SVGLength::create()).leakRef()); 81 DEFINE_STATIC_REF(AnimatableSVGLength, zeroPixels, AnimatableSVGLength:: create(SVGLength::create()).leakRef());
82 #endif
79 if (from.isEmpty()) { 83 if (from.isEmpty()) {
80 from.append(zeroPixels); 84 from.append(zeroPixels);
81 from.append(zeroPixels); 85 from.append(zeroPixels);
82 } 86 }
83 if (to.isEmpty()) { 87 if (to.isEmpty()) {
84 to.append(zeroPixels); 88 to.append(zeroPixels);
85 to.append(zeroPixels); 89 to.append(zeroPixels);
86 } 90 }
87 } 91 }
88 92
89 Vector<RefPtr<AnimatableValue> > interpolatedValues; 93 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > interpolatedValues;
90 bool success = interpolateLists(from, to, fraction, interpolatedValues); 94 bool success = interpolateLists(from, to, fraction, interpolatedValues);
91 ASSERT_UNUSED(success, success); 95 ASSERT_UNUSED(success, success);
92 return adoptRef(new AnimatableStrokeDasharrayList(interpolatedValues)); 96 return adoptRefWillBeNoop(new AnimatableStrokeDasharrayList(interpolatedValu es));
97 }
98
99 void AnimatableStrokeDasharrayList::trace(Visitor* visitor)
100 {
101 AnimatableRepeatable::trace(visitor);
93 } 102 }
94 103
95 } // namespace WebCore 104 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/AnimatableStrokeDasharrayList.h ('k') | Source/core/animation/AnimatableStrokeDasharrayListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698