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

Side by Side Diff: Source/core/svg/SVGDocumentExtensions.cpp

Issue 179293004: Drive SVG Animations via requestAnimationFrame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use AnimationClock. 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
« no previous file with comments | « Source/core/svg/SVGDocumentExtensions.h ('k') | Source/core/svg/animation/SMILTimeContainer.h » ('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) 2006 Apple Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2007 Rob Buis <buis@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 RenderSVGResourceContainer* SVGDocumentExtensions::resourceById(const AtomicStri ng& id) const 78 RenderSVGResourceContainer* SVGDocumentExtensions::resourceById(const AtomicStri ng& id) const
79 { 79 {
80 if (id.isEmpty()) 80 if (id.isEmpty())
81 return 0; 81 return 0;
82 82
83 return m_resources.get(id); 83 return m_resources.get(id);
84 } 84 }
85 85
86 void SVGDocumentExtensions::serviceOnAnimationFrame(Document& document, double m onotonicAnimationStartTime)
87 {
88 if (!document.svgExtensions())
89 return;
90 document.accessSVGExtensions().serviceAnimations(monotonicAnimationStartTime );
91 }
92
93 void SVGDocumentExtensions::serviceAnimations(double monotonicAnimationStartTime )
94 {
95 Vector<RefPtr<SVGSVGElement> > timeContainers;
96 timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end()) ;
97 Vector<RefPtr<SVGSVGElement> >::iterator end = timeContainers.end();
98 for (Vector<RefPtr<SVGSVGElement> >::iterator itr = timeContainers.begin(); itr != end; ++itr)
99 (*itr)->timeContainer()->serviceAnimations(monotonicAnimationStartTime);
100 }
101
86 void SVGDocumentExtensions::startAnimations() 102 void SVGDocumentExtensions::startAnimations()
87 { 103 {
88 // FIXME: Eventually every "Time Container" will need a way to latch on to s ome global timer 104 // FIXME: Eventually every "Time Container" will need a way to latch on to s ome global timer
89 // starting animations for a document will do this "latching" 105 // starting animations for a document will do this "latching"
90 // FIXME: We hold a ref pointers to prevent a shadow tree from getting remov ed out from underneath us. 106 // FIXME: We hold a ref pointers to prevent a shadow tree from getting remov ed out from underneath us.
91 // In the future we should refactor the use-element to avoid this. See https ://webkit.org/b/53704 107 // In the future we should refactor the use-element to avoid this. See https ://webkit.org/b/53704
92 Vector<RefPtr<SVGSVGElement> > timeContainers; 108 Vector<RefPtr<SVGSVGElement> > timeContainers;
93 timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end()) ; 109 timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end()) ;
94 Vector<RefPtr<SVGSVGElement> >::iterator end = timeContainers.end(); 110 Vector<RefPtr<SVGSVGElement> >::iterator end = timeContainers.end();
95 for (Vector<RefPtr<SVGSVGElement> >::iterator itr = timeContainers.begin(); itr != end; ++itr) 111 for (Vector<RefPtr<SVGSVGElement> >::iterator itr = timeContainers.begin(); itr != end; ++itr)
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 426 }
411 427
412 void SVGDocumentExtensions::unregisterSVGFontFaceElement(SVGFontFaceElement* ele ment) 428 void SVGDocumentExtensions::unregisterSVGFontFaceElement(SVGFontFaceElement* ele ment)
413 { 429 {
414 ASSERT(m_svgFontFaceElements.contains(element)); 430 ASSERT(m_svgFontFaceElements.contains(element));
415 m_svgFontFaceElements.remove(element); 431 m_svgFontFaceElements.remove(element);
416 } 432 }
417 #endif 433 #endif
418 434
419 } 435 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGDocumentExtensions.h ('k') | Source/core/svg/animation/SMILTimeContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698