Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1641)

Unified Diff: Source/core/rendering/svg/RenderSVGContainer.cpp

Issue 601093002: Move SVG container paint code to SVGContainerPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address reviewer comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGContainer.h ('k') | Source/core/rendering/svg/RenderSVGResourceMarker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGContainer.cpp
diff --git a/Source/core/rendering/svg/RenderSVGContainer.cpp b/Source/core/rendering/svg/RenderSVGContainer.cpp
index 0970d69ee521411cef898115c0076fc7c5db86d2..caec9d2d35b9251f6dddc5472f1a89c03bedda99 100644
--- a/Source/core/rendering/svg/RenderSVGContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGContainer.cpp
@@ -25,15 +25,11 @@
#include "core/rendering/svg/RenderSVGContainer.h"
-#include "core/frame/Settings.h"
-#include "core/rendering/GraphicsContextAnnotator.h"
+#include "core/paint/SVGContainerPainter.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/svg/SVGRenderSupport.h"
-#include "core/rendering/svg/SVGRenderingContext.h"
#include "core/rendering/svg/SVGResources.h"
#include "core/rendering/svg/SVGResourcesCache.h"
-#include "platform/graphics/GraphicsContextCullSaver.h"
-#include "platform/graphics/GraphicsContextStateSaver.h"
namespace blink {
@@ -96,7 +92,6 @@ void RenderSVGContainer::removeChild(RenderObject* child)
RenderSVGModelObject::removeChild(child);
}
-
bool RenderSVGContainer::selfWillPaint()
{
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
@@ -105,52 +100,7 @@ bool RenderSVGContainer::selfWillPaint()
void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
- ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
-
- // Spec: groups w/o children still may render filter content.
- if (!firstChild() && !selfWillPaint())
- return;
-
- FloatRect paintInvalidationRect = paintInvalidationRectInLocalCoordinates();
- if (!SVGRenderSupport::paintInfoIntersectsPaintInvalidationRect(paintInvalidationRect, localToParentTransform(), paintInfo))
- return;
-
- PaintInfo childPaintInfo(paintInfo);
- {
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
-
- // Let the RenderSVGViewportContainer subclass clip if necessary
- applyViewportClip(childPaintInfo);
-
- childPaintInfo.applyTransform(localToParentTransform());
-
- SVGRenderingContext renderingContext;
- GraphicsContextCullSaver cullSaver(*childPaintInfo.context);
- bool continueRendering = true;
- if (childPaintInfo.phase == PaintPhaseForeground) {
- renderingContext.prepareToRenderSVGContent(this, childPaintInfo);
- continueRendering = renderingContext.isRenderingPrepared();
-
- if (continueRendering && document().settings()->containerCullingEnabled())
- cullSaver.cull(paintInvalidationRectInLocalCoordinates());
- }
-
- if (continueRendering) {
- childPaintInfo.updatePaintingRootForChildren(this);
- for (RenderObject* child = firstChild(); child; child = child->nextSibling())
- child->paint(childPaintInfo, IntPoint());
- }
- }
-
- // FIXME: This really should be drawn from local coordinates, but currently we hack it
- // to avoid our clip killing our outline rect. Thus we translate our
- // outline rect into parent coords before drawing.
- // FIXME: This means our focus ring won't share our rotation like it should.
- // We should instead disable our clip during PaintPhaseOutline
- if (paintInfo.phase == PaintPhaseForeground && style()->outlineWidth() && style()->visibility() == VISIBLE) {
- IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(paintInvalidationRect));
- paintOutline(paintInfo, paintRectInParent);
- }
+ SVGContainerPainter(*this).paint(paintInfo);
}
// addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call
« no previous file with comments | « Source/core/rendering/svg/RenderSVGContainer.h ('k') | Source/core/rendering/svg/RenderSVGResourceMarker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698