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

Side by Side 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: CSSCrossfadeValue needs to reply truthfully to willRenderImage. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 17 matching lines...) Expand all
28 #define SVGImage_h 28 #define SVGImage_h
29 29
30 #include "platform/graphics/Image.h" 30 #include "platform/graphics/Image.h"
31 #include "platform/heap/Handle.h" 31 #include "platform/heap/Handle.h"
32 #include "platform/weborigin/KURL.h" 32 #include "platform/weborigin/KURL.h"
33 #include "wtf/Allocator.h" 33 #include "wtf/Allocator.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class Document; 37 class Document;
38 class FrameView;
39 class Page; 38 class Page;
40 class LayoutReplaced; 39 class LayoutReplaced;
41 class SVGImageChromeClient; 40 class SVGImageChromeClient;
42 class SVGImageForContainer; 41 class SVGImageForContainer;
43 42
44 class SVGImage final : public Image { 43 class SVGImage final : public Image {
45 public: 44 public:
46 static PassRefPtr<SVGImage> create(ImageObserver* observer) 45 static PassRefPtr<SVGImage> create(ImageObserver* observer)
47 { 46 {
48 return adoptRef(new SVGImage(observer)); 47 return adoptRef(new SVGImage(observer));
(...skipping 12 matching lines...) Expand all
61 void startAnimation(CatchUpAnimation = CatchUp) override; 60 void startAnimation(CatchUpAnimation = CatchUp) override;
62 void stopAnimation() override; 61 void stopAnimation() override;
63 void resetAnimation() override; 62 void resetAnimation() override;
64 63
65 // Advances an animated image. This will trigger an animation update for CSS 64 // Advances an animated image. This will trigger an animation update for CSS
66 // and advance the SMIL timeline by one frame. 65 // and advance the SMIL timeline by one frame.
67 void advanceAnimationForTesting() override; 66 void advanceAnimationForTesting() override;
68 67
69 PassRefPtr<SkImage> imageForCurrentFrame() override; 68 PassRefPtr<SkImage> imageForCurrentFrame() override;
70 69
71 // Returns the SVG image document's frame.
72 FrameView* frameView() const;
73
74 // Does the SVG image/document contain any animations? 70 // Does the SVG image/document contain any animations?
75 bool hasAnimations() const; 71 bool hasAnimations() const;
72 // Service CSS and SMIL animations.
73 void serviceAnimations(double monotonicAnimationStartTime);
76 74
77 void updateUseCounters(Document&) const; 75 void updateUseCounters(Document&) const;
78 76
79 // The defaultObjectSize is assumed to be unzoomed, i.e. it should 77 // The defaultObjectSize is assumed to be unzoomed, i.e. it should
80 // not have the effective zoom level applied. The returned size is 78 // not have the effective zoom level applied. The returned size is
81 // thus also independent of current zoom level. 79 // thus also independent of current zoom level.
82 FloatSize concreteObjectSize(const FloatSize& defaultObjectSize) const; 80 FloatSize concreteObjectSize(const FloatSize& defaultObjectSize) const;
83 81
84 bool hasIntrinsicDimensions() const; 82 bool hasIntrinsicDimensions() const;
85 83
86 private: 84 private:
87 friend class AXLayoutObject; 85 // Accesses m_page.
88 friend class SVGImageChromeClient; 86 friend class SVGImageChromeClient;
87 // Forwards calls to the various *ForContainer methods and other parts of
88 // the the Image interface.
89 friend class SVGImageForContainer; 89 friend class SVGImageForContainer;
90 90
91 ~SVGImage() override; 91 ~SVGImage() override;
92 92
93 String filenameExtension() const override; 93 String filenameExtension() const override;
94 94
95 IntSize containerSize() const; 95 IntSize containerSize() const;
96 bool usesContainerSize() const override { return true; } 96 bool usesContainerSize() const override { return true; }
97 97
98 bool dataChanged(bool allDataReceived) override; 98 bool dataChanged(bool allDataReceived) override;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 { 141 {
142 m_image->setImageObserverDisabled(false); 142 m_image->setImageObserverDisabled(false);
143 } 143 }
144 private: 144 private:
145 Image* m_image; 145 Image* m_image;
146 }; 146 };
147 147
148 } // namespace blink 148 } // namespace blink
149 149
150 #endif // SVGImage_h 150 #endif // SVGImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698