Title: [133897] trunk/Source/WebCore
Revision
133897
Author
p...@google.com
Date
2012-11-08 07:19:57 -0800 (Thu, 08 Nov 2012)

Log Message

Remove unnecessary save/restore in SVGTextRunRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=101546

Reviewed by Andreas Kling.

This patch removes an unnecessary context save/restore SVGTextRunRenderingContext by
refactoring the code to save off the stroke thickness.

No new tests as this is heavily covered by existing tests.

* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (133896 => 133897)


--- trunk/Source/WebCore/ChangeLog	2012-11-08 15:09:36 UTC (rev 133896)
+++ trunk/Source/WebCore/ChangeLog	2012-11-08 15:19:57 UTC (rev 133897)
@@ -1,3 +1,18 @@
+2012-11-08  Philip Rogers  <p...@google.com>
+
+        Remove unnecessary save/restore in SVGTextRunRenderingContext
+        https://bugs.webkit.org/show_bug.cgi?id=101546
+
+        Reviewed by Andreas Kling.
+
+        This patch removes an unnecessary context save/restore SVGTextRunRenderingContext by
+        refactoring the code to save off the stroke thickness.
+
+        No new tests as this is heavily covered by existing tests.
+
+        * rendering/svg/SVGTextRunRenderingContext.cpp:
+        (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
+
 2012-11-08  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Clean up includes in GObject DOM bindings code

Modified: trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp (133896 => 133897)


--- trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp	2012-11-08 15:09:36 UTC (rev 133896)
+++ trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp	2012-11-08 15:19:57 UTC (rev 133897)
@@ -142,8 +142,6 @@
             continue;
          }
 
-        context->save();
-
         if (isVerticalText) {
             glyphOrigin.setX(svgGlyph.verticalOriginX * scale);
             glyphOrigin.setY(svgGlyph.verticalOriginY * scale);
@@ -157,14 +155,12 @@
         glyphPath.transform(glyphPathTransform);
 
         if (activePaintingResource->applyResource(parentRenderObject, parentRenderObjectStyle, context, resourceMode)) {
-            if (renderObject && renderObject->isSVGInlineText()) {
-                const RenderSVGInlineText* textRenderer = toRenderSVGInlineText(renderObject);
-                context->setStrokeThickness(context->strokeThickness() * textRenderer->scalingFactor());
-            }
+            float strokeThickness = context->strokeThickness();
+            if (renderObject && renderObject->isSVGInlineText())
+                context->setStrokeThickness(strokeThickness * toRenderSVGInlineText(renderObject)->scalingFactor());
             activePaintingResource->postApplyResource(parentRenderObject, context, resourceMode, &glyphPath, 0);
-         }
- 
-        context->restore();
+            context->setStrokeThickness(strokeThickness);
+        }
 
         if (isVerticalText)
             currentPoint.move(0, advance);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to