Changeset 116899 in webkit
- Timestamp:
- May 13, 2012 10:00:50 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116864 r116899 1 2012-05-13 Igor Oliveira <igor.o@sisa.samsung.com> 2 3 [Texmap] TextureMapperAnimations does not support keyframe with multiple animations 4 https://bugs.webkit.org/show_bug.cgi?id=86303 5 6 Qt and GTK, in WebKit1, use TextureMapper to store AC animations using 7 TextureMapperAnimations::add(keyframeName, TextureMapperAnimation). And when a 8 CSS animation animates several CSS properties, TextureMapperAnimations::add is 9 called more than once with the same keyframeName value. However, currently, 10 TextureMapperAnimations can not store more than one animated property in the keyframe 11 because it is using HashMap<String, TextureMapperAnimation>, and WebKit HashMap 12 does not support add the same key twice. 13 14 Reviewed by Noam Rosenthal. 15 16 * platform/graphics/texmap/TextureMapperAnimation.cpp: 17 (WebCore::TextureMapperAnimations::hasActiveAnimationsOfType): 18 (WebCore::TextureMapperAnimations::hasRunningAnimations): 19 (WebCore::TextureMapperAnimations::add): 20 (WebCore): 21 (WebCore::TextureMapperAnimations::pause): 22 (WebCore::TextureMapperAnimations::apply): 23 * platform/graphics/texmap/TextureMapperAnimation.h: 24 (TextureMapperAnimations): Use HashMap<String, Vector<TextureMapperAnimation> >, 25 so we can support an keyframe with multiple animations. 26 1 27 2012-05-12 Abhishek Arya <inferno@chromium.org> 2 28 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
r111347 r116899 181 181 bool TextureMapperAnimations::hasActiveAnimationsOfType(AnimatedPropertyID type) const 182 182 { 183 HashMap<String, TextureMapperAnimation>::const_iterator end = m_animations.end(); 184 for (HashMap<String, TextureMapperAnimation>::const_iterator it = m_animations.begin(); it != end; ++it) { 185 const TextureMapperAnimation& animation = it->second; 186 if (animation.isActive() && animation.property() == type) 187 return true; 183 HashMap<String, Vector<TextureMapperAnimation> >::const_iterator end = m_animations.end(); 184 for (HashMap<String, Vector<TextureMapperAnimation> >::const_iterator it = m_animations.begin(); it != end; ++it) { 185 const Vector<TextureMapperAnimation>& animations = it->second; 186 for (size_t i = 0; i < animations.size(); ++i) { 187 if (animations[i].isActive() && animations[i].property() == type) 188 return true; 189 } 188 190 } 189 191 return false; … … 192 194 bool TextureMapperAnimations::hasRunningAnimations() const 193 195 { 194 HashMap<String, TextureMapperAnimation>::const_iterator end = m_animations.end(); 195 for (HashMap<String, TextureMapperAnimation>::const_iterator it = m_animations.begin(); it != end; ++it) { 196 const TextureMapperAnimation& animation = it->second; 197 if (animation.state() == TextureMapperAnimation::PlayingState) 198 return true; 196 HashMap<String, Vector<TextureMapperAnimation> >::const_iterator end = m_animations.end(); 197 for (HashMap<String, Vector<TextureMapperAnimation> >::const_iterator it = m_animations.begin(); it != end; ++it) { 198 const Vector<TextureMapperAnimation>& animations = it->second; 199 for (size_t i = 0; i < animations.size(); ++i) { 200 if (animations[i].state() == TextureMapperAnimation::PlayingState) 201 return true; 202 } 199 203 } 200 204 … … 248 252 } 249 253 254 void TextureMapperAnimations::add(const String& name, const TextureMapperAnimation& animation) 255 { 256 HashMap<String, Vector<TextureMapperAnimation> >::iterator it = m_animations.find(name); 257 if (it != m_animations.end()) { 258 it->second.append(animation); 259 return; 260 } 261 262 Vector<TextureMapperAnimation> animations; 263 animations.append(animation); 264 m_animations.add(name, animations); 265 } 266 250 267 void TextureMapperAnimations::pause(const String& name, double offset) 251 268 { 252 HashMap<String, TextureMapperAnimation>::iterator it = m_animations.find(name);269 HashMap<String, Vector<TextureMapperAnimation> >::iterator it = m_animations.find(name); 253 270 if (it == m_animations.end()) 254 271 return; 255 it->second.pause(offset); 272 273 for (size_t i = 0; i < it->second.size(); i++) 274 it->second[i].pause(offset); 256 275 } 257 276 258 277 void TextureMapperAnimations::apply(TextureMapperAnimationClient* client) 259 278 { 260 HashMap<String, TextureMapperAnimation>::iterator end = m_animations.end(); 261 for (HashMap<String, TextureMapperAnimation>::iterator it = m_animations.begin(); it != end; ++it) 262 it->second.apply(client); 279 HashMap<String, Vector<TextureMapperAnimation> >::iterator end = m_animations.end(); 280 for (HashMap<String, Vector<TextureMapperAnimation> >::iterator it = m_animations.begin(); it != end; ++it) { 281 for (size_t i = 0; i < it->second.size(); ++i) 282 it->second[i].apply(client); 283 } 263 284 } 264 285 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h
r111344 r116899 67 67 TextureMapperAnimations() { } 68 68 69 void add(const String& name, const TextureMapperAnimation& animation) { m_animations.add(name, animation); }69 void add(const String&, const TextureMapperAnimation&); 70 70 void remove(const String& name) { m_animations.remove(name); } 71 71 void pause(const String&, double); … … 77 77 78 78 private: 79 HashMap<String, TextureMapperAnimation> m_animations;79 HashMap<String, Vector<TextureMapperAnimation> > m_animations; 80 80 }; 81 81
Note: See TracChangeset
for help on using the changeset viewer.