36
35
#include "SVGResourceMasker.h"
37
36
#include "SVGStyledElement.h"
38
37
#include "SVGURIReference.h"
38
#include "TransformState.h"
39
#include "TransformationMatrix.h"
39
40
#include <wtf/UnusedParam.h>
41
42
namespace WebCore {
43
void prepareToRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& boundingBox, SVGResourceFilter*& filter, SVGResourceFilter* rootFilter)
44
IntRect SVGRenderBase::clippedOverflowRectForRepaint(RenderObject* object, RenderBoxModelObject* repaintContainer)
46
// Return early for any cases where we don't actually paint
47
if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->hasVisibleContent())
50
// Pass our local paint rect to computeRectForRepaint() which will
51
// map to parent coords and recurse up the parent chain.
52
IntRect repaintRect = enclosingIntRect(object->repaintRectInLocalCoordinates());
53
object->computeRectForRepaint(repaintContainer, repaintRect);
57
void SVGRenderBase::computeRectForRepaint(RenderObject* object, RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
59
// Translate to coords in our parent renderer, and then call computeRectForRepaint on our parent
60
repaintRect = object->localToParentTransform().mapRect(repaintRect);
61
object->parent()->computeRectForRepaint(repaintContainer, repaintRect, fixed);
64
void SVGRenderBase::mapLocalToContainer(const RenderObject* object, RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState)
66
ASSERT(!fixed); // We should have no fixed content in the SVG rendering tree.
67
ASSERT(useTransforms); // mapping a point through SVG w/o respecting trasnforms is useless.
68
transformState.applyTransform(object->localToParentTransform());
69
object->parent()->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState);
72
void SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& boundingBox, SVGResourceFilter*& filter, SVGResourceFilter* rootFilter)
45
74
#if !ENABLE(SVG_FILTERS)
46
75
UNUSED_PARAM(filter);
109
138
svgElement->document()->accessSVGExtensions()->addPendingResource(maskerId, styledElement);
112
void finishRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& boundingBox, SVGResourceFilter*& filter, GraphicsContext* savedContext)
141
void SVGRenderBase::finishRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& boundingBox, SVGResourceFilter*& filter, GraphicsContext* savedContext)
114
143
#if !ENABLE(SVG_FILTERS)
115
144
UNUSED_PARAM(boundingBox);
156
185
svgContainer->setDrawsContents(false);
159
void clampImageBufferSizeToViewport(RenderObject* object, IntSize& size)
188
void clampImageBufferSizeToViewport(FrameView* frameView, IntSize& size)
161
if (!object || !object->isRenderView())
164
RenderView* view = toRenderView(object);
165
if (!view->frameView())
168
int viewWidth = view->frameView()->visibleWidth();
169
int viewHeight = view->frameView()->visibleHeight();
193
int viewWidth = frameView->visibleWidth();
194
int viewHeight = frameView->visibleHeight();
171
196
if (size.width() > viewWidth)
172
197
size.setWidth(viewWidth);
175
200
size.setHeight(viewHeight);
178
FloatRect computeContainerBoundingBox(const RenderObject* container, bool includeAllPaintedContent)
203
FloatRect SVGRenderBase::computeContainerBoundingBox(const RenderObject* container, bool includeAllPaintedContent)
180
205
FloatRect boundingBox;