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

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

Issue 256483003: Add DEFINE_STATIC_REF_WILL_BE_PERSISTENT macro (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | Source/core/animation/AnimatableValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > to = toAnimatableStro keDasharrayList(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 78 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(AnimatableSVGLength, zeroPixels, (A nimatableSVGLength::create(SVGLength::create())));
79 DEFINE_STATIC_LOCAL(Persistent<AnimatableSVGLength>, zeroPixels, (Animat ableSVGLength::create(SVGLength::create())));
80 #else
81 DEFINE_STATIC_REF(AnimatableSVGLength, zeroPixels, AnimatableSVGLength:: create(SVGLength::create()).leakRef());
82 #endif
83 if (from.isEmpty()) { 79 if (from.isEmpty()) {
84 from.append(zeroPixels); 80 from.append(zeroPixels);
85 from.append(zeroPixels); 81 from.append(zeroPixels);
86 } 82 }
87 if (to.isEmpty()) { 83 if (to.isEmpty()) {
88 to.append(zeroPixels); 84 to.append(zeroPixels);
89 to.append(zeroPixels); 85 to.append(zeroPixels);
90 } 86 }
91 } 87 }
92 88
93 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > interpolatedValues; 89 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > interpolatedValues;
94 bool success = interpolateLists(from, to, fraction, interpolatedValues); 90 bool success = interpolateLists(from, to, fraction, interpolatedValues);
95 ASSERT_UNUSED(success, success); 91 ASSERT_UNUSED(success, success);
96 return adoptRefWillBeNoop(new AnimatableStrokeDasharrayList(interpolatedValu es)); 92 return adoptRefWillBeNoop(new AnimatableStrokeDasharrayList(interpolatedValu es));
97 } 93 }
98 94
99 void AnimatableStrokeDasharrayList::trace(Visitor* visitor) 95 void AnimatableStrokeDasharrayList::trace(Visitor* visitor)
100 { 96 {
101 AnimatableRepeatable::trace(visitor); 97 AnimatableRepeatable::trace(visitor);
102 } 98 }
103 99
104 } // namespace WebCore 100 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/AnimatableValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698