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

Side by Side Diff: Source/core/rendering/svg/SVGRenderingContext.cpp

Issue 721073003: Pass PaintBehaviorRenderingClipPathAsMask in PaintInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 12 matching lines...) Expand all
23 */ 23 */
24 24
25 #include "config.h" 25 #include "config.h"
26 #include "core/rendering/svg/SVGRenderingContext.h" 26 #include "core/rendering/svg/SVGRenderingContext.h"
27 27
28 #include "core/frame/FrameHost.h" 28 #include "core/frame/FrameHost.h"
29 #include "core/rendering/PaintInfo.h" 29 #include "core/rendering/PaintInfo.h"
30 #include "core/rendering/RenderLayer.h" 30 #include "core/rendering/RenderLayer.h"
31 #include "core/rendering/svg/RenderSVGResourceFilter.h" 31 #include "core/rendering/svg/RenderSVGResourceFilter.h"
32 #include "core/rendering/svg/RenderSVGResourceMasker.h" 32 #include "core/rendering/svg/RenderSVGResourceMasker.h"
33 #include "core/rendering/svg/SVGRenderSupport.h"
34 #include "core/rendering/svg/SVGResources.h" 33 #include "core/rendering/svg/SVGResources.h"
35 #include "core/rendering/svg/SVGResourcesCache.h" 34 #include "core/rendering/svg/SVGResourcesCache.h"
36 #include "platform/FloatConversion.h" 35 #include "platform/FloatConversion.h"
37 36
38 namespace blink { 37 namespace blink {
39 38
40 SVGRenderingContext::~SVGRenderingContext() 39 SVGRenderingContext::~SVGRenderingContext()
41 { 40 {
42 // Fast path if we don't need to restore anything. 41 // Fast path if we don't need to restore anything.
43 if (!(m_renderingFlags & ActionsNeeded)) 42 if (!(m_renderingFlags & ActionsNeeded))
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 85
87 m_object = object; 86 m_object = object;
88 m_paintInfo = &paintInfo; 87 m_paintInfo = &paintInfo;
89 88
90 RenderStyle* style = m_object->style(); 89 RenderStyle* style = m_object->style();
91 ASSERT(style); 90 ASSERT(style);
92 91
93 const SVGRenderStyle& svgStyle = style->svgStyle(); 92 const SVGRenderStyle& svgStyle = style->svgStyle();
94 93
95 // Setup transparency layers before setting up SVG resources! 94 // Setup transparency layers before setting up SVG resources!
96 bool isRenderingMask = SVGRenderSupport::isRenderingClipPathAsMaskImage(*m_o bject); 95 bool isRenderingMask = paintInfo.isRenderingClipPathAsMaskImage();
97 // RenderLayer takes care of root opacity. 96 // RenderLayer takes care of root opacity.
98 float opacity = object->isSVGRoot() ? 1 : style->opacity(); 97 float opacity = object->isSVGRoot() ? 1 : style->opacity();
99 bool hasBlendMode = style->hasBlendMode(); 98 bool hasBlendMode = style->hasBlendMode();
100 99
101 if (!isRenderingMask && (opacity < 1 || hasBlendMode || style->hasIsolation( ))) { 100 if (!isRenderingMask && (opacity < 1 || hasBlendMode || style->hasIsolation( ))) {
102 FloatRect paintInvalidationRect = m_object->paintInvalidationRectInLocal Coordinates(); 101 FloatRect paintInvalidationRect = m_object->paintInvalidationRectInLocal Coordinates();
103 m_paintInfo->context->clip(paintInvalidationRect); 102 m_paintInfo->context->clip(paintInvalidationRect);
104 103
105 if (hasBlendMode) { 104 if (hasBlendMode) {
106 if (!(m_renderingFlags & RestoreGraphicsContext)) { 105 if (!(m_renderingFlags & RestoreGraphicsContext)) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 { 237 {
239 ASSERT(context); 238 ASSERT(context);
240 ASSERT(item); 239 ASSERT(item);
241 ASSERT(!item->needsLayout()); 240 ASSERT(!item->needsLayout());
242 241
243 PaintInfo info(context, PaintInfo::infiniteRect(), PaintPhaseForeground, Pai ntBehaviorNormal); 242 PaintInfo info(context, PaintInfo::infiniteRect(), PaintPhaseForeground, Pai ntBehaviorNormal);
244 item->paint(info, IntPoint()); 243 item->paint(info, IntPoint());
245 } 244 }
246 245
247 } // namespace blink 246 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698