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

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 23643003: ImageBuffer-less SVG masking and clipping. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the Win build. Created 7 years, 4 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/RenderInline.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 33b0a7d59868918592247dba36eda2808b7ef5ac..20a5ddf43ca406ae0f04cffebca1a1e848613c41 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -3674,6 +3674,7 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
// Apply clip-path to context.
bool hasClipPath = false;
RenderStyle* style = renderer()->style();
+ RenderSVGResourceClipper* resourceClipper = 0;
if (renderer()->hasClipPath() && !context->paintingDisabled() && style) {
ASSERT(style->clipPath());
if (style->clipPath()->getOperationType() == ClipPathOperation::SHAPE) {
@@ -3699,7 +3700,11 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
}
// FIXME: This should use a safer cast such as toRenderSVGResourceContainer().
- static_cast<RenderSVGResourceClipper*>(element->renderer())->applyClippingToContext(renderer(), rootRelativeBounds, paintingInfo.paintDirtyRect, context);
+ resourceClipper = static_cast<RenderSVGResourceClipper*>(element->renderer());
+ if (!resourceClipper->applyClippingToContext(renderer(), rootRelativeBounds, paintingInfo.paintDirtyRect, context)) {
+ // No need to post-apply the clipper if this failed.
+ resourceClipper = 0;
+ }
}
}
}
@@ -3820,11 +3825,14 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
// End our transparency layer
if (haveTransparency && m_usedTransparency && !m_paintingInsideReflection) {
- context->endTransparencyLayer();
+ context->endLayer();
context->restore();
m_usedTransparency = false;
}
+ if (resourceClipper)
+ resourceClipper->postApplyResource(renderer(), context, ApplyToDefaultMode, 0, 0);
+
if (hasClipPath)
context->restore();
}
« no previous file with comments | « Source/core/rendering/RenderInline.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698