OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&) | 106 void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&) |
107 { | 107 { |
108 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); | 108 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); |
109 | 109 |
110 // Spec: groups w/o children still may render filter content. | 110 // Spec: groups w/o children still may render filter content. |
111 if (!firstChild() && !selfWillPaint()) | 111 if (!firstChild() && !selfWillPaint()) |
112 return; | 112 return; |
113 | 113 |
114 FloatRect repaintRect = paintInvalidationRectInLocalCoordinates(); | 114 FloatRect paintInvalidationRect = paintInvalidationRectInLocalCoordinates(); |
115 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(repaintRect, localToPa
rentTransform(), paintInfo)) | 115 if (!SVGRenderSupport::paintInfoIntersectsPaintInvalidationRect(paintInvalid
ationRect, localToParentTransform(), paintInfo)) |
116 return; | 116 return; |
117 | 117 |
118 PaintInfo childPaintInfo(paintInfo); | 118 PaintInfo childPaintInfo(paintInfo); |
119 { | 119 { |
120 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); | 120 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); |
121 | 121 |
122 // Let the RenderSVGViewportContainer subclass clip if necessary | 122 // Let the RenderSVGViewportContainer subclass clip if necessary |
123 applyViewportClip(childPaintInfo); | 123 applyViewportClip(childPaintInfo); |
124 | 124 |
125 childPaintInfo.applyTransform(localToParentTransform()); | 125 childPaintInfo.applyTransform(localToParentTransform()); |
(...skipping 15 matching lines...) Expand all Loading... |
141 child->paint(childPaintInfo, IntPoint()); | 141 child->paint(childPaintInfo, IntPoint()); |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 // FIXME: This really should be drawn from local coordinates, but currently
we hack it | 145 // FIXME: This really should be drawn from local coordinates, but currently
we hack it |
146 // to avoid our clip killing our outline rect. Thus we translate our | 146 // to avoid our clip killing our outline rect. Thus we translate our |
147 // outline rect into parent coords before drawing. | 147 // outline rect into parent coords before drawing. |
148 // FIXME: This means our focus ring won't share our rotation like it should. | 148 // FIXME: This means our focus ring won't share our rotation like it should. |
149 // We should instead disable our clip during PaintPhaseOutline | 149 // We should instead disable our clip during PaintPhaseOutline |
150 if (paintInfo.phase == PaintPhaseForeground && style()->outlineWidth() && st
yle()->visibility() == VISIBLE) { | 150 if (paintInfo.phase == PaintPhaseForeground && style()->outlineWidth() && st
yle()->visibility() == VISIBLE) { |
151 IntRect paintRectInParent = enclosingIntRect(localToParentTransform().ma
pRect(repaintRect)); | 151 IntRect paintRectInParent = enclosingIntRect(localToParentTransform().ma
pRect(paintInvalidationRect)); |
152 paintOutline(paintInfo, paintRectInParent); | 152 paintOutline(paintInfo, paintRectInParent); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 // addFocusRingRects is called from paintOutline and needs to be in the same coo
rdinates as the paintOuline call | 156 // addFocusRingRects is called from paintOutline and needs to be in the same coo
rdinates as the paintOuline call |
157 void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, const LayoutP
oint&, const RenderLayerModelObject*) const | 157 void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, const LayoutP
oint&, const RenderLayerModelObject*) const |
158 { | 158 { |
159 IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRec
t(paintInvalidationRectInLocalCoordinates())); | 159 IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRec
t(paintInvalidationRectInLocalCoordinates())); |
160 if (!paintRectInParent.isEmpty()) | 160 if (!paintRectInParent.isEmpty()) |
161 rects.append(paintRectInParent); | 161 rects.append(paintRectInParent); |
162 } | 162 } |
163 | 163 |
164 void RenderSVGContainer::updateCachedBoundaries() | 164 void RenderSVGContainer::updateCachedBoundaries() |
165 { | 165 { |
166 SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m
_objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBox); | 166 SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m
_objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox); |
167 SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingB
ox); | 167 SVGRenderSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); |
168 } | 168 } |
169 | 169 |
170 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) | 170 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) |
171 { | 171 { |
172 // Give RenderSVGViewportContainer a chance to apply its viewport clip | 172 // Give RenderSVGViewportContainer a chance to apply its viewport clip |
173 if (!pointIsInsideViewportClip(pointInParent)) | 173 if (!pointIsInsideViewportClip(pointInParent)) |
174 return false; | 174 return false; |
175 | 175 |
176 FloatPoint localPoint; | 176 FloatPoint localPoint; |
177 if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, localToPar
entTransform(), pointInParent, localPoint)) | 177 if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, localToPar
entTransform(), pointInParent, localPoint)) |
(...skipping 12 matching lines...) Expand all Loading... |
190 if (objectBoundingBox().contains(localPoint)) { | 190 if (objectBoundingBox().contains(localPoint)) { |
191 updateHitTestResult(result, roundedLayoutPoint(localPoint)); | 191 updateHitTestResult(result, roundedLayoutPoint(localPoint)); |
192 return true; | 192 return true; |
193 } | 193 } |
194 } | 194 } |
195 // 16.4: "If there are no graphics elements whose relevant graphics content
is under the pointer (i.e., there is no target element), the event is not dispat
ched." | 195 // 16.4: "If there are no graphics elements whose relevant graphics content
is under the pointer (i.e., there is no target element), the event is not dispat
ched." |
196 return false; | 196 return false; |
197 } | 197 } |
198 | 198 |
199 } | 199 } |
OLD | NEW |