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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.h

Issue 2000483003: Rework timeline/frame scheduling logic for SVGImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unittest Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.h
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
index cc30344b556c7a4b538a9c90613a7245ca319aa6..7e066d430890368f5b0ace776141a15d7e47a9bb 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
@@ -27,6 +27,7 @@
#ifndef SVGImage_h
#define SVGImage_h
+#include "core/CoreExport.h"
#include "platform/graphics/Image.h"
#include "platform/heap/Handle.h"
#include "platform/weborigin/KURL.h"
@@ -35,13 +36,12 @@
namespace blink {
class Document;
-class FrameView;
class Page;
class LayoutReplaced;
class SVGImageChromeClient;
class SVGImageForContainer;
-class SVGImage final : public Image {
+class CORE_EXPORT SVGImage final : public Image {
public:
static PassRefPtr<SVGImage> create(ImageObserver* observer)
{
@@ -64,14 +64,14 @@ public:
// Advances an animated image. This will trigger an animation update for CSS
// and advance the SMIL timeline by one frame.
void advanceAnimationForTesting() override;
+ SVGImageChromeClient& chromeClientForTesting();
PassRefPtr<SkImage> imageForCurrentFrame() override;
- // Returns the SVG image document's frame.
- FrameView* frameView() const;
-
// Does the SVG image/document contain any animations?
bool hasAnimations() const;
+ // Service CSS and SMIL animations.
+ void serviceAnimations(double monotonicAnimationStartTime);
void updateUseCounters(Document&) const;
@@ -83,8 +83,10 @@ public:
bool hasIntrinsicDimensions() const;
private:
- friend class AXLayoutObject;
+ // Accesses m_page.
friend class SVGImageChromeClient;
+ // Forwards calls to the various *ForContainer methods and other parts of
+ // the the Image interface.
friend class SVGImageForContainer;
~SVGImage() override;
@@ -112,6 +114,8 @@ private:
void drawInternal(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatRect& toRect, RespectImageOrientationEnum,
ImageClampingMode, const KURL&);
+ void stopAnimation();
+
Persistent<SVGImageChromeClient> m_chromeClient;
Persistent<Page> m_page;

Powered by Google App Engine
This is Rietveld 408576698