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

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

Issue 13616008: Remove CG codepaths from SVG (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 if (!renderer) 194 if (!renderer)
195 continue; 195 continue;
196 SVGResourcesCache::clientStyleChanged(renderer, StyleDifferenceLayout, r enderer->style()); 196 SVGResourcesCache::clientStyleChanged(renderer, StyleDifferenceLayout, r enderer->style());
197 renderer->setNeedsLayout(true); 197 renderer->setNeedsLayout(true);
198 } 198 }
199 } 199 }
200 200
201 bool RenderSVGResourceContainer::shouldTransformOnTextPainting(RenderObject* obj ect, AffineTransform& resourceTransform) 201 bool RenderSVGResourceContainer::shouldTransformOnTextPainting(RenderObject* obj ect, AffineTransform& resourceTransform)
202 { 202 {
203 ASSERT_UNUSED(object, object); 203 ASSERT_UNUSED(object, object);
204 #if USE(CG) 204
205 UNUSED_PARAM(resourceTransform);
206 return false;
207 #else
208 // This method should only be called for RenderObjects that deal with text r endering. Cmp. RenderObject.h's is*() methods. 205 // This method should only be called for RenderObjects that deal with text r endering. Cmp. RenderObject.h's is*() methods.
209 ASSERT(object->isSVGText() || object->isSVGTextPath() || object->isSVGInline ()); 206 ASSERT(object->isSVGText() || object->isSVGTextPath() || object->isSVGInline ());
210 207
211 // In text drawing, the scaling part of the graphics context CTM is removed, compare SVGInlineTextBox::paintTextWithShadows. 208 // In text drawing, the scaling part of the graphics context CTM is removed, compare SVGInlineTextBox::paintTextWithShadows.
212 // So, we use that scaling factor here, too, and then push it down to patter n or gradient space 209 // So, we use that scaling factor here, too, and then push it down to patter n or gradient space
213 // in order to keep the pattern or gradient correctly scaled. 210 // in order to keep the pattern or gradient correctly scaled.
214 float scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFac tor(object); 211 float scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFac tor(object);
215 if (scalingFactor == 1) 212 if (scalingFactor == 1)
216 return false; 213 return false;
217 resourceTransform.scale(scalingFactor); 214 resourceTransform.scale(scalingFactor);
218 return true; 215 return true;
219 #endif
220 } 216 }
221 217
222 // FIXME: This does not belong here. 218 // FIXME: This does not belong here.
223 AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderOb ject* object, const AffineTransform& resourceTransform) 219 AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderOb ject* object, const AffineTransform& resourceTransform)
224 { 220 {
225 if (!object->isSVGShape()) 221 if (!object->isSVGShape())
226 return resourceTransform; 222 return resourceTransform;
227 223
228 SVGStyledTransformableElement* element = toSVGStyledTransformableElement(obj ect->node()); 224 SVGStyledTransformableElement* element = toSVGStyledTransformableElement(obj ect->node());
229 AffineTransform transform = element->getScreenCTM(SVGLocatable::DisallowStyl eUpdate); 225 AffineTransform transform = element->getScreenCTM(SVGLocatable::DisallowStyl eUpdate);
230 transform *= resourceTransform; 226 transform *= resourceTransform;
231 return transform; 227 return transform;
232 } 228 }
233 229
234 } 230 }
235 231
236 #endif 232 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/svg/RenderSVGRect.cpp ('k') | Source/WebCore/rendering/svg/RenderSVGResourceGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698