OLD | NEW |
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRe
ct& toRect, CompositeOperator, blink::WebBlendMode) OVERRIDE; | 94 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRe
ct& toRect, CompositeOperator, blink::WebBlendMode) OVERRIDE; |
95 void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatR
ect&, const FloatRect&, CompositeOperator, blink::WebBlendMode); | 95 void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatR
ect&, const FloatRect&, CompositeOperator, blink::WebBlendMode); |
96 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const
FloatRect&, const FloatSize&, const FloatPoint&, | 96 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const
FloatRect&, const FloatSize&, const FloatPoint&, |
97 CompositeOperator, const FloatRect&, blink::WebBlendMode, const IntSize&
repeatSpacing); | 97 CompositeOperator, const FloatRect&, blink::WebBlendMode, const IntSize&
repeatSpacing); |
98 | 98 |
99 OwnPtr<SVGImageChromeClient> m_chromeClient; | 99 OwnPtr<SVGImageChromeClient> m_chromeClient; |
100 OwnPtr<Page> m_page; | 100 OwnPtr<Page> m_page; |
101 IntSize m_intrinsicSize; | 101 IntSize m_intrinsicSize; |
102 }; | 102 }; |
103 | 103 |
104 inline SVGImage* toSVGImage(Image* image) | 104 DEFINE_IMAGE_TYPE_CASTS(SVGImage); |
105 { | |
106 ASSERT_WITH_SECURITY_IMPLICATION(!image || image->isSVGImage()); | |
107 return static_cast<SVGImage*>(image); | |
108 } | |
109 | 105 |
110 class ImageObserverDisabler { | 106 class ImageObserverDisabler { |
111 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); | 107 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); |
112 public: | 108 public: |
113 ImageObserverDisabler(Image* image) | 109 ImageObserverDisabler(Image* image) |
114 : m_image(image) | 110 : m_image(image) |
115 { | 111 { |
116 ASSERT(m_image->imageObserver()); | 112 ASSERT(m_image->imageObserver()); |
117 m_observer = m_image->imageObserver(); | 113 m_observer = m_image->imageObserver(); |
118 m_image->setImageObserver(0); | 114 m_image->setImageObserver(0); |
119 } | 115 } |
120 | 116 |
121 ~ImageObserverDisabler() | 117 ~ImageObserverDisabler() |
122 { | 118 { |
123 m_image->setImageObserver(m_observer); | 119 m_image->setImageObserver(m_observer); |
124 } | 120 } |
125 private: | 121 private: |
126 Image* m_image; | 122 Image* m_image; |
127 ImageObserver* m_observer; | 123 ImageObserver* m_observer; |
128 }; | 124 }; |
129 | 125 |
130 } | 126 } |
131 | 127 |
132 #endif // SVGImage_h | 128 #endif // SVGImage_h |
OLD | NEW |