Changeset 157945 in webkit
- Timestamp:
- Oct 24, 2013, 12:36:55 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
rendering/svg/RenderSVGContainer.cpp (modified) (1 diff)
-
rendering/svg/RenderSVGForeignObject.cpp (modified) (1 diff)
-
rendering/svg/RenderSVGImage.cpp (modified) (1 diff)
-
rendering/svg/RenderSVGRoot.cpp (modified) (1 diff)
-
rendering/svg/RenderSVGShape.cpp (modified) (1 diff)
-
rendering/svg/SVGInlineFlowBox.cpp (modified) (1 diff)
-
rendering/svg/SVGRenderingContext.cpp (modified) (12 diffs)
-
rendering/svg/SVGRenderingContext.h (modified) (3 diffs)
-
rendering/svg/SVGRootInlineBox.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157944 r157945 1 2013-10-24 Andreas Kling <akling@apple.com> 2 3 SVGRenderingContext should wrap a RenderElement. 4 <https://webkit.org/b/123283> 5 6 The SVG rendering context class is never used with text renderers 7 so we can have it wrap a RenderElement for tighter code. 8 9 Also renamed SVGRenderingContext::m_object to m_renderer. 10 11 Reviewed by Antti Koivisto. 12 1 13 2013-10-24 Santosh Mahto <santosh.ma@samsung.com> 2 14 -
trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
r157940 r157945 134 134 bool continueRendering = true; 135 135 if (childPaintInfo.phase == PaintPhaseForeground) { 136 renderingContext.prepareToRenderSVGContent( this, childPaintInfo);136 renderingContext.prepareToRenderSVGContent(*this, childPaintInfo); 137 137 continueRendering = renderingContext.isRenderingPrepared(); 138 138 } -
trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
r155756 r157945 71 71 bool continueRendering = true; 72 72 if (paintInfo.phase == PaintPhaseForeground) { 73 renderingContext.prepareToRenderSVGContent( this, childPaintInfo);73 renderingContext.prepareToRenderSVGContent(*this, childPaintInfo); 74 74 continueRendering = renderingContext.isRenderingPrepared(); 75 75 } -
trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp
r157940 r157945 135 135 136 136 if (childPaintInfo.phase == PaintPhaseForeground) { 137 SVGRenderingContext renderingContext( this, childPaintInfo);137 SVGRenderingContext renderingContext(*this, childPaintInfo); 138 138 139 139 if (renderingContext.isRenderingPrepared()) { -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r157940 r157945 288 288 bool continueRendering = true; 289 289 if (childPaintInfo.phase == PaintPhaseForeground) { 290 renderingContext.prepareToRenderSVGContent( this, childPaintInfo);290 renderingContext.prepareToRenderSVGContent(*this, childPaintInfo); 291 291 continueRendering = renderingContext.isRenderingPrepared(); 292 292 } -
trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp
r157940 r157945 281 281 282 282 if (childPaintInfo.phase == PaintPhaseForeground) { 283 SVGRenderingContext renderingContext( this, childPaintInfo);283 SVGRenderingContext renderingContext(*this, childPaintInfo); 284 284 285 285 if (renderingContext.isRenderingPrepared()) { -
trunk/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
r157907 r157945 55 55 ASSERT(!paintInfo.context->paintingDisabled()); 56 56 57 SVGRenderingContext renderingContext( &renderer(), paintInfo, SVGRenderingContext::SaveGraphicsContext);57 SVGRenderingContext renderingContext(renderer(), paintInfo, SVGRenderingContext::SaveGraphicsContext); 58 58 if (renderingContext.isRenderingPrepared()) { 59 59 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) { -
trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
r157823 r157945 57 57 return; 58 58 59 ASSERT(m_ object&& m_paintInfo);59 ASSERT(m_renderer && m_paintInfo); 60 60 61 61 #if ENABLE(FILTERS) 62 62 if (m_renderingFlags & EndFilterLayer) { 63 63 ASSERT(m_filter); 64 m_filter->postApplyResource(m_ object, m_paintInfo->context, ApplyToDefaultMode, 0, 0);64 m_filter->postApplyResource(m_renderer, m_paintInfo->context, ApplyToDefaultMode, 0, 0); 65 65 m_paintInfo->context = m_savedContext; 66 66 m_paintInfo->rect = m_savedPaintRect; … … 78 78 } 79 79 80 void SVGRenderingContext::prepareToRenderSVGContent(RenderObject* object, PaintInfo& paintInfo, NeedsGraphicsContextSave needsGraphicsContextSave) 81 { 82 ASSERT(object); 83 80 void SVGRenderingContext::prepareToRenderSVGContent(RenderElement& renderer, PaintInfo& paintInfo, NeedsGraphicsContextSave needsGraphicsContextSave) 81 { 84 82 #ifndef NDEBUG 85 83 // This function must not be called twice! … … 88 86 #endif 89 87 90 m_ object = object;88 m_renderer = &renderer; 91 89 m_paintInfo = &paintInfo; 92 90 #if ENABLE(FILTERS) … … 100 98 } 101 99 102 RenderStyle* style = m_ object->style();100 RenderStyle* style = m_renderer->style(); 103 101 ASSERT(style); 104 102 … … 107 105 108 106 // Setup transparency layers before setting up SVG resources! 109 bool isRenderingMask = isRenderingMaskImage(*m_ object);107 bool isRenderingMask = isRenderingMaskImage(*m_renderer); 110 108 float opacity = isRenderingMask ? 1 : style->opacity(); 111 109 const ShadowData* shadow = svgStyle->shadow(); 112 110 if (opacity < 1 || shadow) { 113 FloatRect repaintRect = m_ object->repaintRectInLocalCoordinates();111 FloatRect repaintRect = m_renderer->repaintRectInLocalCoordinates(); 114 112 115 113 if (opacity < 1) { … … 130 128 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::SHAPE) { 131 129 ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(clipPathOperation); 132 m_paintInfo->context->clipPath(clipPath->path( object->objectBoundingBox()), clipPath->windRule());133 } 134 135 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(m_ object);130 m_paintInfo->context->clipPath(clipPath->path(renderer.objectBoundingBox()), clipPath->windRule()); 131 } 132 133 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(m_renderer); 136 134 if (!resources) { 137 135 #if ENABLE(FILTERS) … … 145 143 if (!isRenderingMask) { 146 144 if (RenderSVGResourceMasker* masker = resources->masker()) { 147 if (!masker->applyResource(m_ object, style, m_paintInfo->context, ApplyToDefaultMode))145 if (!masker->applyResource(m_renderer, style, m_paintInfo->context, ApplyToDefaultMode)) 148 146 return; 149 147 } … … 152 150 RenderSVGResourceClipper* clipper = resources->clipper(); 153 151 if (!clipPathOperation && clipper) { 154 if (!clipper->applyResource(m_ object, style, m_paintInfo->context, ApplyToDefaultMode))152 if (!clipper->applyResource(m_renderer, style, m_paintInfo->context, ApplyToDefaultMode)) 155 153 return; 156 154 } … … 165 163 // (because it was either drawn before or empty) but we still need to apply the filter. 166 164 m_renderingFlags |= EndFilterLayer; 167 if (!m_filter->applyResource(m_ object, style, m_paintInfo->context, ApplyToDefaultMode))165 if (!m_filter->applyResource(m_renderer, style, m_paintInfo->context, ApplyToDefaultMode)) 168 166 return; 169 167 … … 172 170 // at the time of the initial paint (due to scrolling, window size, etc.) will never 173 171 // be drawn. 174 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_ object));172 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_renderer)); 175 173 } 176 174 } … … 334 332 { 335 333 ASSERT(m_paintInfo); 336 ASSERT(m_ object->isSVGImage());337 FloatRect boundingBox = m_ object->objectBoundingBox();334 ASSERT(m_renderer->isSVGImage()); 335 FloatRect boundingBox = m_renderer->objectBoundingBox(); 338 336 339 337 // Invalidate an existing buffer if the scale is not correct. … … 353 351 PaintInfo bufferedInfo(*m_paintInfo); 354 352 bufferedInfo.context = bufferedRenderingContext; 355 toRenderSVGImage(m_ object)->paintForeground(bufferedInfo);353 toRenderSVGImage(m_renderer)->paintForeground(bufferedInfo); 356 354 } else 357 355 return false; -
trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h
r157011 r157945 49 49 SVGRenderingContext() 50 50 : m_renderingFlags(0) 51 , m_ object(0)52 , m_paintInfo( 0)53 , m_savedContext( 0)51 , m_renderer(nullptr) 52 , m_paintInfo(nullptr) 53 , m_savedContext(nullptr) 54 54 #if ENABLE(FILTERS) 55 , m_filter( 0)55 , m_filter(nullptr) 56 56 #endif 57 57 { 58 58 } 59 59 60 SVGRenderingContext(Render Object*object, PaintInfo& paintinfo, NeedsGraphicsContextSave needsGraphicsContextSave = DontSaveGraphicsContext)60 SVGRenderingContext(RenderElement& object, PaintInfo& paintinfo, NeedsGraphicsContextSave needsGraphicsContextSave = DontSaveGraphicsContext) 61 61 : m_renderingFlags(0) 62 , m_ object(0)63 , m_paintInfo( 0)64 , m_savedContext( 0)62 , m_renderer(nullptr) 63 , m_paintInfo(nullptr) 64 , m_savedContext(nullptr) 65 65 #if ENABLE(FILTERS) 66 , m_filter( 0)66 , m_filter(nullptr) 67 67 #endif 68 68 { … … 74 74 75 75 // Used by all SVG renderers who apply clip/filter/etc. resources to the renderer content. 76 void prepareToRenderSVGContent(Render Object*, PaintInfo&, NeedsGraphicsContextSave = DontSaveGraphicsContext);76 void prepareToRenderSVGContent(RenderElement&, PaintInfo&, NeedsGraphicsContextSave = DontSaveGraphicsContext); 77 77 bool isRenderingPrepared() const { return m_renderingFlags & RenderingPrepared; } 78 78 … … 113 113 114 114 int m_renderingFlags; 115 Render Object* m_object;115 RenderElement* m_renderer; 116 116 PaintInfo* m_paintInfo; 117 117 GraphicsContext* m_savedContext; -
trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
r157662 r157945 66 66 } 67 67 68 SVGRenderingContext renderingContext( &renderSVGText(), paintInfo, SVGRenderingContext::SaveGraphicsContext);68 SVGRenderingContext renderingContext(renderSVGText(), paintInfo, SVGRenderingContext::SaveGraphicsContext); 69 69 if (renderingContext.isRenderingPrepared()) { 70 70 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
Note:
See TracChangeset
for help on using the changeset viewer.