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

Side by Side Diff: Source/WebCore/rendering/svg/SVGInlineTextBox.cpp

Issue 9235065: Merge 105978 - crash in WebCore::RenderSVGContainer::paint (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007 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) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 ASSERT(textRenderer); 191 ASSERT(textRenderer);
192 if (!textShouldBePainted(textRenderer)) 192 if (!textShouldBePainted(textRenderer))
193 return; 193 return;
194 194
195 RenderStyle* style = parentRenderer->style(); 195 RenderStyle* style = parentRenderer->style();
196 ASSERT(style); 196 ASSERT(style);
197 197
198 const SVGRenderStyle* svgStyle = style->svgStyle(); 198 const SVGRenderStyle* svgStyle = style->svgStyle();
199 ASSERT(svgStyle); 199 ASSERT(svgStyle);
200 200
201 bool hasFill = svgStyle->hasFill();
202 bool hasStroke = svgStyle->hasStroke();
203
204 RenderStyle* selectionStyle = style; 201 RenderStyle* selectionStyle = style;
205 if (hasSelection) { 202 if (hasSelection) {
206 selectionStyle = parentRenderer->getCachedPseudoStyle(SELECTION); 203 selectionStyle = parentRenderer->getCachedPseudoStyle(SELECTION);
207 if (selectionStyle) { 204 if (!selectionStyle)
208 const SVGRenderStyle* svgSelectionStyle = selectionStyle->svgStyle() ;
209 ASSERT(svgSelectionStyle);
210
211 if (!hasFill)
212 hasFill = svgSelectionStyle->hasFill();
213 if (!hasStroke)
214 hasStroke = svgSelectionStyle->hasStroke();
215 } else
216 selectionStyle = style; 205 selectionStyle = style;
217 } 206 }
218 207
219 int startPosition, endPosition; 208 int startPosition, endPosition;
220 selectionStartEnd(startPosition, endPosition); 209 selectionStartEnd(startPosition, endPosition);
221 210
222 int fragmentStartPosition = 0; 211 int fragmentStartPosition = 0;
223 int fragmentEndPosition = 0; 212 int fragmentEndPosition = 0;
224 AffineTransform fragmentTransform; 213 AffineTransform fragmentTransform;
225 unsigned textFragmentsSize = m_textFragments.size(); 214 unsigned textFragmentsSize = m_textFragments.size();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 ASSERT(svgSelectionStyle); 277 ASSERT(svgSelectionStyle);
289 278
290 if (!hasFill) 279 if (!hasFill)
291 hasFill = svgSelectionStyle->hasFill(); 280 hasFill = svgSelectionStyle->hasFill();
292 if (!hasStroke) 281 if (!hasStroke)
293 hasStroke = svgSelectionStyle->hasStroke(); 282 hasStroke = svgSelectionStyle->hasStroke();
294 } else 283 } else
295 selectionStyle = style; 284 selectionStyle = style;
296 } 285 }
297 286
287 if (textRenderer->frame() && textRenderer->frame()->view() && textRenderer-> frame()->view()->paintBehavior() & PaintBehaviorRenderingSVGMask) {
288 hasFill = true;
289 hasStroke = false;
290 }
291
298 AffineTransform fragmentTransform; 292 AffineTransform fragmentTransform;
299 unsigned textFragmentsSize = m_textFragments.size(); 293 unsigned textFragmentsSize = m_textFragments.size();
300 for (unsigned i = 0; i < textFragmentsSize; ++i) { 294 for (unsigned i = 0; i < textFragmentsSize; ++i) {
301 SVGTextFragment& fragment = m_textFragments.at(i); 295 SVGTextFragment& fragment = m_textFragments.at(i);
302 ASSERT(!m_paintingResource); 296 ASSERT(!m_paintingResource);
303 297
304 GraphicsContextStateSaver stateSaver(*paintInfo.context); 298 GraphicsContextStateSaver stateSaver(*paintInfo.context);
305 fragment.buildFragmentTransform(fragmentTransform); 299 fragment.buildFragmentTransform(fragmentTransform);
306 if (!fragmentTransform.isIdentity()) 300 if (!fragmentTransform.isIdentity())
307 paintInfo.context->concatCTM(fragmentTransform); 301 paintInfo.context->concatCTM(fragmentTransform);
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 return true; 742 return true;
749 } 743 }
750 } 744 }
751 } 745 }
752 return false; 746 return false;
753 } 747 }
754 748
755 } // namespace WebCore 749 } // namespace WebCore
756 750
757 #endif 751 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/svg/SVGImageBufferTools.cpp ('k') | Source/WebCore/rendering/svg/SVGRenderSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698