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

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

Issue 22604008: Allow SVG images to not taint the canvas with drawImage/drawPattern (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
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 13 matching lines...) Expand all
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #ifndef SVGImage_h 27 #ifndef SVGImage_h
28 #define SVGImage_h 28 #define SVGImage_h
29 29
30 #include "core/platform/graphics/Image.h" 30 #include "core/platform/graphics/Image.h"
31 31
32 namespace WebCore { 32 namespace WebCore {
33 33
34 class Element;
34 class FrameView; 35 class FrameView;
35 class ImageBuffer; 36 class ImageBuffer;
36 class Page; 37 class Page;
37 class RenderBox; 38 class RenderBox;
38 class SVGImageChromeClient; 39 class SVGImageChromeClient;
39 class SVGImageForContainer; 40 class SVGImageForContainer;
40 41
41 class SVGImage : public Image { 42 class SVGImage : public Image {
42 public: 43 public:
43 static PassRefPtr<SVGImage> create(ImageObserver* observer) 44 static PassRefPtr<SVGImage> create(ImageObserver* observer)
44 { 45 {
45 return adoptRef(new SVGImage(observer)); 46 return adoptRef(new SVGImage(observer));
46 } 47 }
47 48
49 static bool isInSVGImage(const Element*);
50
48 RenderBox* embeddedContentBox() const; 51 RenderBox* embeddedContentBox() const;
49 FrameView* frameView() const; 52 FrameView* frameView() const;
50 53
51 virtual bool isSVGImage() const OVERRIDE { return true; } 54 virtual bool isSVGImage() const OVERRIDE { return true; }
52 virtual IntSize size() const OVERRIDE { return m_intrinsicSize; } 55 virtual IntSize size() const OVERRIDE { return m_intrinsicSize; }
53 56
57 virtual bool hasSingleSecurityOrigin() const OVERRIDE;
58
54 virtual bool hasRelativeWidth() const OVERRIDE; 59 virtual bool hasRelativeWidth() const OVERRIDE;
55 virtual bool hasRelativeHeight() const OVERRIDE; 60 virtual bool hasRelativeHeight() const OVERRIDE;
56 61
57 virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) OVERRIDE; 62 virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) OVERRIDE;
58 virtual void stopAnimation() OVERRIDE; 63 virtual void stopAnimation() OVERRIDE;
59 virtual void resetAnimation() OVERRIDE; 64 virtual void resetAnimation() OVERRIDE;
60 65
61 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE; 66 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE;
62 67
63 private: 68 private:
(...skipping 25 matching lines...) Expand all
89 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&, 94 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&,
90 CompositeOperator, const FloatRect&, BlendMode); 95 CompositeOperator, const FloatRect&, BlendMode);
91 96
92 OwnPtr<SVGImageChromeClient> m_chromeClient; 97 OwnPtr<SVGImageChromeClient> m_chromeClient;
93 OwnPtr<Page> m_page; 98 OwnPtr<Page> m_page;
94 IntSize m_intrinsicSize; 99 IntSize m_intrinsicSize;
95 }; 100 };
96 } 101 }
97 102
98 #endif // SVGImage_h 103 #endif // SVGImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698