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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix a crashers (everything is building!) Created 5 years, 10 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 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 void SVGRenderingContext::applyCompositingIfNecessary() 104 void SVGRenderingContext::applyCompositingIfNecessary()
105 { 105 {
106 ASSERT(!m_paintInfo.isRenderingClipPathAsMaskImage()); 106 ASSERT(!m_paintInfo.isRenderingClipPathAsMaskImage());
107 107
108 // RenderLayer takes care of root opacity and blend mode. 108 // RenderLayer takes care of root opacity and blend mode.
109 if (m_object->isSVGRoot()) 109 if (m_object->isSVGRoot())
110 return; 110 return;
111 111
112 RenderStyle* style = m_object->style(); 112 const RenderStyle* style = m_object->style();
113 ASSERT(style); 113 ASSERT(style);
114 float opacity = style->opacity(); 114 float opacity = style->opacity();
115 bool hasBlendMode = style->hasBlendMode() && m_object->isBlendingAllowed(); 115 bool hasBlendMode = style->hasBlendMode() && m_object->isBlendingAllowed();
116 if (opacity < 1 || hasBlendMode) { 116 if (opacity < 1 || hasBlendMode) {
117 m_clipRecorder = adoptPtr(new FloatClipRecorder(*m_paintInfo.context, m_ object->displayItemClient(), m_paintInfo.phase, m_object->paintInvalidationRectI nLocalCoordinates())); 117 m_clipRecorder = adoptPtr(new FloatClipRecorder(*m_paintInfo.context, m_ object->displayItemClient(), m_paintInfo.phase, m_object->paintInvalidationRectI nLocalCoordinates()));
118 WebBlendMode blendMode = hasBlendMode ? style->blendMode() : WebBlendMod eNormal; 118 WebBlendMode blendMode = hasBlendMode ? style->blendMode() : WebBlendMod eNormal;
119 CompositeOperator compositeOp = hasBlendMode ? CompositeSourceOver : m_p aintInfo.context->compositeOperationDeprecated(); 119 CompositeOperator compositeOp = hasBlendMode ? CompositeSourceOver : m_p aintInfo.context->compositeOperationDeprecated();
120 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con text, m_object->displayItemClient(), compositeOp, blendMode, opacity, compositeO p)); 120 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con text, m_object->displayItemClient(), compositeOp, blendMode, opacity, compositeO p));
121 } 121 }
122 } 122 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 { 250 {
251 ASSERT(context); 251 ASSERT(context);
252 ASSERT(item); 252 ASSERT(item);
253 ASSERT(!item->needsLayout()); 253 ASSERT(!item->needsLayout());
254 254
255 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorNormal); 255 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorNormal);
256 item->paint(info, IntPoint()); 256 item->paint(info, IntPoint());
257 } 257 }
258 258
259 } // namespace blink 259 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698