OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> | 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> |
6 * Copyright (C) 2009 Google, Inc. | 6 * Copyright (C) 2009 Google, Inc. |
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 11 matching lines...) Expand all Loading... |
22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 * Boston, MA 02110-1301, USA. | 23 * Boston, MA 02110-1301, USA. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 | 27 |
28 #include "core/rendering/svg/RenderSVGImage.h" | 28 #include "core/rendering/svg/RenderSVGImage.h" |
29 | 29 |
30 #include "core/layout/ImageQualityController.h" | 30 #include "core/layout/ImageQualityController.h" |
31 #include "core/layout/PointerEventsHitRules.h" | 31 #include "core/layout/PointerEventsHitRules.h" |
| 32 #include "core/layout/svg/LayoutSVGResourceContainer.h" |
32 #include "core/layout/svg/SVGLayoutSupport.h" | 33 #include "core/layout/svg/SVGLayoutSupport.h" |
33 #include "core/layout/svg/SVGResources.h" | 34 #include "core/layout/svg/SVGResources.h" |
34 #include "core/layout/svg/SVGResourcesCache.h" | 35 #include "core/layout/svg/SVGResourcesCache.h" |
35 #include "core/paint/SVGImagePainter.h" | 36 #include "core/paint/SVGImagePainter.h" |
36 #include "core/rendering/RenderImageResource.h" | 37 #include "core/rendering/RenderImageResource.h" |
37 #include "core/rendering/svg/RenderSVGResourceContainer.h" | |
38 #include "core/svg/SVGImageElement.h" | 38 #include "core/svg/SVGImageElement.h" |
39 #include "platform/LengthFunctions.h" | 39 #include "platform/LengthFunctions.h" |
40 #include "third_party/skia/include/core/SkPicture.h" | 40 #include "third_party/skia/include/core/SkPicture.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 RenderSVGImage::RenderSVGImage(SVGImageElement* impl) | 44 RenderSVGImage::RenderSVGImage(SVGImageElement* impl) |
45 : RenderSVGModelObject(impl) | 45 : RenderSVGModelObject(impl) |
46 , m_needsBoundariesUpdate(true) | 46 , m_needsBoundariesUpdate(true) |
47 , m_needsTransformUpdate(true) | 47 , m_needsTransformUpdate(true) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 172 } |
173 | 173 |
174 void RenderSVGImage::imageChanged(WrappedImagePtr, const IntRect*) | 174 void RenderSVGImage::imageChanged(WrappedImagePtr, const IntRect*) |
175 { | 175 { |
176 // The image resource defaults to nullImage until the resource arrives. | 176 // The image resource defaults to nullImage until the resource arrives. |
177 // This empty image may be cached by SVG resources which must be invalidated
. | 177 // This empty image may be cached by SVG resources which must be invalidated
. |
178 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj
ect(this)) | 178 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj
ect(this)) |
179 resources->removeClientFromCache(this); | 179 resources->removeClientFromCache(this); |
180 | 180 |
181 // Eventually notify parent resources, that we've changed. | 181 // Eventually notify parent resources, that we've changed. |
182 RenderSVGResourceContainer::markForLayoutAndParentResourceInvalidation(this,
false); | 182 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(this,
false); |
183 | 183 |
184 // Update the SVGImageCache sizeAndScales entry in case image loading finish
ed after layout. | 184 // Update the SVGImageCache sizeAndScales entry in case image loading finish
ed after layout. |
185 // (https://bugs.webkit.org/show_bug.cgi?id=99489) | 185 // (https://bugs.webkit.org/show_bug.cgi?id=99489) |
186 m_objectBoundingBox = FloatRect(); | 186 m_objectBoundingBox = FloatRect(); |
187 updateImageViewport(); | 187 updateImageViewport(); |
188 | 188 |
189 m_bufferedForeground.clear(); | 189 m_bufferedForeground.clear(); |
190 | 190 |
191 setShouldDoFullPaintInvalidation(); | 191 setShouldDoFullPaintInvalidation(); |
192 } | 192 } |
193 | 193 |
194 void RenderSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo
int&) const | 194 void RenderSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo
int&) const |
195 { | 195 { |
196 // this is called from paint() after the localTransform has already been app
lied | 196 // this is called from paint() after the localTransform has already been app
lied |
197 LayoutRect contentRect = LayoutRect(paintInvalidationRectInLocalCoordinates(
)); | 197 LayoutRect contentRect = LayoutRect(paintInvalidationRectInLocalCoordinates(
)); |
198 if (!contentRect.isEmpty()) | 198 if (!contentRect.isEmpty()) |
199 rects.append(contentRect); | 199 rects.append(contentRect); |
200 } | 200 } |
201 | 201 |
202 } // namespace blink | 202 } // namespace blink |
OLD | NEW |