FloatRect RenderSVGImage::repaintRectInLocalCoordinates() const { // If we already have a cached repaint rect, return that if (!m_cachedLocalRepaintRect.isEmpty()) return m_cachedLocalRepaintRect; m_cachedLocalRepaintRect = m_localBounds; // FIXME: We need to be careful here. We assume that there is no filter, // clipper or masker if the rects are empty. FloatRect rect = filterBoundingBoxForRenderer(this); if (!rect.isEmpty()) m_cachedLocalRepaintRect = rect; rect = clipperBoundingBoxForRenderer(this); if (!rect.isEmpty()) m_cachedLocalRepaintRect.intersect(rect); rect = maskerBoundingBoxForRenderer(this); if (!rect.isEmpty()) m_cachedLocalRepaintRect.intersect(rect); style()->svgStyle()->inflateForShadow(m_cachedLocalRepaintRect); return m_cachedLocalRepaintRect; }
FloatRect RenderPath::repaintRectInLocalCoordinates() const { if (m_path.isEmpty()) return FloatRect(); // If we already have a cached repaint rect, return that if (!m_cachedLocalRepaintRect.isEmpty()) return m_cachedLocalRepaintRect; // FIXME: We need to be careful here. We assume that there is no filter, // clipper, marker or masker if the rects are empty. FloatRect rect = filterBoundingBoxForRenderer(this); if (!rect.isEmpty()) m_cachedLocalRepaintRect = rect; else { m_cachedLocalRepaintRect = strokeBoundingBox(); m_cachedLocalRepaintRect.unite(markerBoundingBox()); } rect = clipperBoundingBoxForRenderer(this); if (!rect.isEmpty()) m_cachedLocalRepaintRect.intersect(rect); rect = maskerBoundingBoxForRenderer(this); if (!rect.isEmpty()) m_cachedLocalRepaintRect.intersect(rect); style()->svgStyle()->inflateForShadow(m_cachedLocalRepaintRect); return m_cachedLocalRepaintRect; }
FloatRect RenderSVGImage::repaintRectInLocalCoordinates() const { FloatRect repaintRect = m_localBounds; // Filters can paint outside the image content repaintRect.unite(filterBoundingBoxForRenderer(this)); return repaintRect; }
// RenderSVGContainer is used for <g> elements which do not themselves have a // width or height, so we union all of our child rects as our repaint rect. FloatRect RenderSVGContainer::repaintRectInLocalCoordinates() const { FloatRect repaintRect = computeContainerBoundingBox(this, true); // A filter on this container can paint outside of the union of the child repaint rects repaintRect.unite(filterBoundingBoxForRenderer(this)); return repaintRect; }
// RenderSVGContainer is used for <g> elements which do not themselves have a // width or height, so we union all of our child rects as our repaint rect. FloatRect RenderSVGContainer::repaintRectInLocalCoordinates() const { FloatRect repaintRect = computeContainerBoundingBox(this, true); FloatRect rect = filterBoundingBoxForRenderer(this); if (!rect.isEmpty()) repaintRect = rect; rect = clipperBoundingBoxForRenderer(this); if (!rect.isEmpty()) repaintRect.intersect(rect); rect = maskerBoundingBoxForRenderer(this); if (!rect.isEmpty()) repaintRect.intersect(rect); style()->svgStyle()->inflateForShadow(repaintRect); return repaintRect; }
FloatRect RenderSVGText::repaintRectInLocalCoordinates() const { FloatRect repaintRect = strokeBoundingBox(); // FIXME: We need to be careful here. We assume that there is no filter, // clipper or masker if the rects are empty. FloatRect rect = filterBoundingBoxForRenderer(this); if (!rect.isEmpty()) repaintRect = rect; rect = clipperBoundingBoxForRenderer(this); if (!rect.isEmpty()) repaintRect.intersect(rect); rect = maskerBoundingBoxForRenderer(this); if (!rect.isEmpty()) repaintRect.intersect(rect); style()->svgStyle()->inflateForShadow(repaintRect); return repaintRect; }
FloatRect RenderPath::repaintRectInLocalCoordinates() const { if (m_path.isEmpty()) return FloatRect(); // If we already have a cached repaint rect, return that if (!m_cachedLocalRepaintRect.isEmpty()) return m_cachedLocalRepaintRect; if (!style()->svgStyle()->hasStroke()) m_cachedLocalRepaintRect = objectBoundingBox(); else { BoundingRectStrokeStyleApplier strokeStyle(this, style()); m_cachedLocalRepaintRect = m_path.strokeBoundingRect(&strokeStyle); } // Markers and filters can paint outside of the stroke path m_cachedLocalRepaintRect.unite(m_markerBounds); m_cachedLocalRepaintRect.unite(filterBoundingBoxForRenderer(this)); return m_cachedLocalRepaintRect; }