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

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

Issue 597753002: Move paint code from RenderSVGForeignObject to SVGForeignObjectPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add SVGForeignObjectPainter Created 6 years, 3 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/RenderSVGForeignObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGForeignObject.cpp
diff --git a/Source/core/rendering/svg/RenderSVGForeignObject.cpp b/Source/core/rendering/svg/RenderSVGForeignObject.cpp
index 9e595ee873f9948738b0829816d545b536825320..ef0574d968f74565280c6be5cc61da90200dd78e 100644
--- a/Source/core/rendering/svg/RenderSVGForeignObject.cpp
+++ b/Source/core/rendering/svg/RenderSVGForeignObject.cpp
@@ -23,13 +23,12 @@
#include "core/rendering/svg/RenderSVGForeignObject.h"
+#include "core/paint/SVGForeignObjectPainter.h"
#include "core/rendering/HitTestResult.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/svg/SVGRenderSupport.h"
-#include "core/rendering/svg/SVGRenderingContext.h"
#include "core/rendering/svg/SVGResourcesCache.h"
#include "core/svg/SVGForeignObjectElement.h"
-#include "platform/graphics/GraphicsContextStateSaver.h"
namespace blink {
@@ -51,41 +50,7 @@ bool RenderSVGForeignObject::isChildAllowed(RenderObject* child, RenderStyle* st
void RenderSVGForeignObject::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
- return;
-
- PaintInfo childPaintInfo(paintInfo);
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
- childPaintInfo.applyTransform(localTransform());
-
- if (SVGRenderSupport::isOverflowHidden(this))
- childPaintInfo.context->clip(m_viewport);
-
- SVGRenderingContext renderingContext;
- bool continueRendering = true;
- if (paintInfo.phase == PaintPhaseForeground) {
- renderingContext.prepareToRenderSVGContent(this, childPaintInfo);
- continueRendering = renderingContext.isRenderingPrepared();
- }
-
- if (continueRendering) {
- // Paint all phases of FO elements atomically, as though the FO element established its
- // own stacking context.
- bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip;
- LayoutPoint childPoint = IntPoint();
- childPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
- RenderBlock::paint(childPaintInfo, IntPoint());
- if (!preservePhase) {
- childPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
- RenderBlock::paint(childPaintInfo, childPoint);
- childPaintInfo.phase = PaintPhaseFloat;
- RenderBlock::paint(childPaintInfo, childPoint);
- childPaintInfo.phase = PaintPhaseForeground;
- RenderBlock::paint(childPaintInfo, childPoint);
- childPaintInfo.phase = PaintPhaseOutline;
- RenderBlock::paint(childPaintInfo, childPoint);
- }
- }
+ SVGForeignObjectPainter(*this).paint(paintInfo);
}
const AffineTransform& RenderSVGForeignObject::localToParentTransform() const
« no previous file with comments | « Source/core/rendering/svg/RenderSVGForeignObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698