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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 FloatRect srcRect(0, 0, image->width(), image->height()); | 137 FloatRect srcRect(0, 0, image->width(), image->height()); |
138 | 138 |
139 SVGImageElement* imageElement = static_cast<SVGImageElement*>(no
de()); | 139 SVGImageElement* imageElement = static_cast<SVGImageElement*>(no
de()); |
140 imageElement->preserveAspectRatio().transformRect(destRect, srcR
ect); | 140 imageElement->preserveAspectRatio().transformRect(destRect, srcR
ect); |
141 | 141 |
142 childPaintInfo.context->drawImage(image.get(), ColorSpaceDeviceR
GB, destRect, srcRect); | 142 childPaintInfo.context->drawImage(image.get(), ColorSpaceDeviceR
GB, destRect, srcRect); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 if (drawsOutline) | 146 if (drawsOutline) |
147 paintOutline(childPaintInfo.context, IntRect(boundingBox)); | 147 paintOutline(childPaintInfo, IntRect(boundingBox)); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) | 151 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) |
152 { | 152 { |
153 // We only draw in the forground phase, so we only hit-test then. | 153 // We only draw in the forground phase, so we only hit-test then. |
154 if (hitTestAction != HitTestForeground) | 154 if (hitTestAction != HitTestForeground) |
155 return false; | 155 return false; |
156 | 156 |
157 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING,
request, style()->pointerEvents()); | 157 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING,
request, style()->pointerEvents()); |
(...skipping 26 matching lines...) Expand all Loading... |
184 RenderSVGResource::markForLayoutAndParentResourceInvalidation(this, false); | 184 RenderSVGResource::markForLayoutAndParentResourceInvalidation(this, false); |
185 | 185 |
186 // Update the SVGImageCache sizeAndScales entry in case image loading finish
ed after layout. | 186 // Update the SVGImageCache sizeAndScales entry in case image loading finish
ed after layout. |
187 // (https://bugs.webkit.org/show_bug.cgi?id=99489) | 187 // (https://bugs.webkit.org/show_bug.cgi?id=99489) |
188 m_objectBoundingBox = FloatRect(); | 188 m_objectBoundingBox = FloatRect(); |
189 updateImageViewport(); | 189 updateImageViewport(); |
190 | 190 |
191 repaint(); | 191 repaint(); |
192 } | 192 } |
193 | 193 |
194 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint
&) | 194 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint
&, const RenderLayerModelObject*) |
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 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); | 197 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); |
198 if (!contentRect.isEmpty()) | 198 if (!contentRect.isEmpty()) |
199 rects.append(contentRect); | 199 rects.append(contentRect); |
200 } | 200 } |
201 | 201 |
202 } // namespace WebCore | 202 } // namespace WebCore |
203 | 203 |
204 #endif // ENABLE(SVG) | 204 #endif // ENABLE(SVG) |
OLD | NEW |