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

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

Issue 721073003: Pass PaintBehaviorRenderingClipPathAsMask in PaintInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Constify; Add ASSERT. Created 6 years, 1 month 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/PaintInfo.h ('k') | Source/core/rendering/svg/SVGRenderSupport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourceClipper.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourceClipper.cpp b/Source/core/rendering/svg/RenderSVGResourceClipper.cpp
index cd283387b922f4c72aeefbfbb40c5a1fdb51f6d5..e5b5d2ff93cefd70de19b03271d048770e7129f4 100644
--- a/Source/core/rendering/svg/RenderSVGResourceClipper.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceClipper.cpp
@@ -21,14 +21,12 @@
*/
#include "config.h"
-
#include "core/rendering/svg/RenderSVGResourceClipper.h"
#include "core/SVGNames.h"
#include "core/dom/ElementTraversal.h"
-#include "core/frame/FrameView.h"
-#include "core/frame/LocalFrame.h"
#include "core/rendering/HitTestResult.h"
+#include "core/rendering/PaintInfo.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/rendering/svg/SVGRenderingContext.h"
#include "core/rendering/svg/SVGResources.h"
@@ -247,14 +245,6 @@ void RenderSVGResourceClipper::createDisplayList(GraphicsContext* context)
FloatRect bounds = strokeBoundingBox();
context->beginRecording(bounds);
- // Switch to a paint behavior where all children of this <clipPath> will be rendered using special constraints:
- // - fill-opacity/stroke-opacity/opacity set to 1
- // - masker/filter not applied when rendering the children
- // - fill is set to the initial fill paint server (solid, black)
- // - stroke is set to the initial stroke paint server (none)
- PaintBehavior oldBehavior = frame()->view()->paintBehavior();
- frame()->view()->setPaintBehavior(oldBehavior | PaintBehaviorRenderingClipPathAsMask);
-
for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement)) {
RenderObject* renderer = childElement->renderer();
if (!renderer)
@@ -284,11 +274,15 @@ void RenderSVGResourceClipper::createDisplayList(GraphicsContext* context)
if (isUseElement)
renderer = childElement->renderer();
- SVGRenderingContext::renderSubtree(context, renderer);
+ // Switch to a paint behavior where all children of this <clipPath> will be rendered using special constraints:
+ // - fill-opacity/stroke-opacity/opacity set to 1
+ // - masker/filter not applied when rendering the children
+ // - fill is set to the initial fill paint server (solid, black)
+ // - stroke is set to the initial stroke paint server (none)
+ PaintInfo info(context, PaintInfo::infiniteRect(), PaintPhaseForeground, PaintBehaviorRenderingClipPathAsMask);
+ renderer->paint(info, IntPoint());
}
- frame()->view()->setPaintBehavior(oldBehavior);
-
m_clipContentDisplayList = context->endRecording();
}
« no previous file with comments | « Source/core/rendering/PaintInfo.h ('k') | Source/core/rendering/svg/SVGRenderSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698