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

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

Issue 24071003: Add toSVGImage fuction, and use it as much as we can. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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/rendering/RenderImage.cpp ('k') | no next file » | 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRe ct& toRect, CompositeOperator, BlendMode) OVERRIDE; 95 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRe ct& toRect, CompositeOperator, BlendMode) OVERRIDE;
96 void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatR ect&, const FloatRect&, CompositeOperator, BlendMode); 96 void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatR ect&, const FloatRect&, CompositeOperator, BlendMode);
97 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&, 97 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&,
98 CompositeOperator, const FloatRect&, BlendMode); 98 CompositeOperator, const FloatRect&, BlendMode);
99 99
100 OwnPtr<SVGImageChromeClient> m_chromeClient; 100 OwnPtr<SVGImageChromeClient> m_chromeClient;
101 OwnPtr<Page> m_page; 101 OwnPtr<Page> m_page;
102 IntSize m_intrinsicSize; 102 IntSize m_intrinsicSize;
103 }; 103 };
104 104
105 inline SVGImage* toSVGImage(Image* image)
106 {
107 ASSERT_WITH_SECURITY_IMPLICATION(!image || image->isSVGImage());
108 return static_cast<SVGImage*>(image);
109 }
110
105 class ImageObserverDisabler { 111 class ImageObserverDisabler {
106 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); 112 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler);
107 public: 113 public:
108 ImageObserverDisabler(Image* image) 114 ImageObserverDisabler(Image* image)
109 : m_image(image) 115 : m_image(image)
110 { 116 {
111 ASSERT(m_image->imageObserver()); 117 ASSERT(m_image->imageObserver());
112 m_observer = m_image->imageObserver(); 118 m_observer = m_image->imageObserver();
113 m_image->setImageObserver(0); 119 m_image->setImageObserver(0);
114 } 120 }
115 121
116 ~ImageObserverDisabler() 122 ~ImageObserverDisabler()
117 { 123 {
118 m_image->setImageObserver(m_observer); 124 m_image->setImageObserver(m_observer);
119 } 125 }
120 private: 126 private:
121 Image* m_image; 127 Image* m_image;
122 ImageObserver* m_observer; 128 ImageObserver* m_observer;
123 }; 129 };
124 130
125 } 131 }
126 132
127 #endif // SVGImage_h 133 #endif // SVGImage_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698