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

Side by Side Diff: Source/core/svg/graphics/SVGImage.h

Issue 1339183003: NOT FOR LANDING Experiment with allocating SVGImageForContainer on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 3 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
« no previous file with comments | « Source/core/style/StylePendingImage.h ('k') | Source/core/svg/graphics/SVGImage.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) 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 { 48 {
49 return adoptRef(new SVGImage(observer)); 49 return adoptRef(new SVGImage(observer));
50 } 50 }
51 51
52 static bool isInSVGImage(const Node*); 52 static bool isInSVGImage(const Node*);
53 53
54 LayoutBox* embeddedContentBox() const; 54 LayoutBox* embeddedContentBox() const;
55 55
56 bool isSVGImage() const override { return true; } 56 bool isSVGImage() const override { return true; }
57 IntSize size() const override { return m_intrinsicSize; } 57 IntSize size() const override { return m_intrinsicSize; }
58 void setURL(const KURL& url) { m_url = url; }
59 58
60 bool currentFrameHasSingleSecurityOrigin() const override; 59 bool currentFrameHasSingleSecurityOrigin() const override;
61 60
62 void startAnimation(CatchUpAnimation = CatchUp) override; 61 void startAnimation(CatchUpAnimation = CatchUp) override;
63 void stopAnimation() override; 62 void stopAnimation() override;
64 void resetAnimation() override; 63 void resetAnimation() override;
65 64
66 // Advances an animated image. This will trigger an animation update for CSS 65 // Advances an animated image. This will trigger an animation update for CSS
67 // and advance the SMIL timeline by one frame. 66 // and advance the SMIL timeline by one frame.
68 void advanceAnimationForTesting() override; 67 void advanceAnimationForTesting() override;
(...skipping 29 matching lines...) Expand all
98 97
99 // FIXME: SVGImages are underreporting decoded sizes and will be unable 98 // FIXME: SVGImages are underreporting decoded sizes and will be unable
100 // to prune because these functions are not implemented yet. 99 // to prune because these functions are not implemented yet.
101 void destroyDecodedData(bool) override { } 100 void destroyDecodedData(bool) override { }
102 101
103 // FIXME: Implement this to be less conservative. 102 // FIXME: Implement this to be less conservative.
104 bool currentFrameKnownToBeOpaque() override { return false; } 103 bool currentFrameKnownToBeOpaque() override { return false; }
105 104
106 SVGImage(ImageObserver*); 105 SVGImage(ImageObserver*);
107 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override; 106 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override;
108 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con st FloatRect&, const FloatRect&); 107 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con st FloatRect&, const FloatRect&, const KURL& urlWithFragment);
109 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&, 108 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&,
110 SkXfermode::Mode, const FloatRect&, const IntSize& repeatSpacing); 109 SkXfermode::Mode, const FloatRect&, const IntSize& repeatSpacing, const KURL& urlWithFragment);
110 void drawInternal(SkCanvas*, const SkPaint&, const FloatRect& fromRect, cons t FloatRect& toRect, RespectImageOrientationEnum, ImageClampingMode);
111 111
112 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient; 112 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient;
113 OwnPtrWillBePersistent<Page> m_page; 113 OwnPtrWillBePersistent<Page> m_page;
114 IntSize m_intrinsicSize; 114 IntSize m_intrinsicSize;
115 KURL m_url;
116 }; 115 };
117 116
118 DEFINE_IMAGE_TYPE_CASTS(SVGImage); 117 DEFINE_IMAGE_TYPE_CASTS(SVGImage);
119 118
120 class ImageObserverDisabler { 119 class ImageObserverDisabler {
121 STACK_ALLOCATED(); 120 STACK_ALLOCATED();
122 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); 121 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler);
123 public: 122 public:
124 ImageObserverDisabler(Image* image) 123 ImageObserverDisabler(Image* image)
125 : m_image(image) 124 : m_image(image)
126 { 125 {
127 m_observer = m_image->imageObserver(); 126 m_observer = m_image->imageObserver();
128 m_image->setImageObserver(0); 127 m_image->setImageObserver(0);
129 } 128 }
130 129
131 ~ImageObserverDisabler() 130 ~ImageObserverDisabler()
132 { 131 {
133 m_image->setImageObserver(m_observer); 132 m_image->setImageObserver(m_observer);
134 } 133 }
135 private: 134 private:
136 Image* m_image; 135 Image* m_image;
137 ImageObserver* m_observer; 136 ImageObserver* m_observer;
138 }; 137 };
139 138
140 } 139 }
141 140
142 #endif // SVGImage_h 141 #endif // SVGImage_h
OLDNEW
« no previous file with comments | « Source/core/style/StylePendingImage.h ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698