Title: [130531] trunk/Source/WebCore
Revision
130531
Author
m...@apple.com
Date
2012-10-05 11:18:50 -0700 (Fri, 05 Oct 2012)

Log Message

Reversing a GlyphBuffer needlessly queries its size multiple times
https://bugs.webkit.org/show_bug.cgi?id=98530

Reviewed by Simon Fraser.

No new tests because there is no change in behavior.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::getGlyphsAndAdvancesForSimpleText): Replaced the condition
(i < glyphBuffer.size() / 2) with the equivalent test (i < end).
* platform/graphics/mac/FontComplexTextMac.cpp:
(WebCore::Font::getGlyphsAndAdvancesForComplexText): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (130530 => 130531)


--- trunk/Source/WebCore/ChangeLog	2012-10-05 18:09:14 UTC (rev 130530)
+++ trunk/Source/WebCore/ChangeLog	2012-10-05 18:18:50 UTC (rev 130531)
@@ -1,3 +1,19 @@
+2012-10-05  Dan Bernstein  <m...@apple.com>
+
+        Reversing a GlyphBuffer needlessly queries its size multiple times
+        https://bugs.webkit.org/show_bug.cgi?id=98530
+
+        Reviewed by Simon Fraser.
+
+        No new tests because there is no change in behavior.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::Font::getGlyphsAndAdvancesForSimpleText): Replaced the condition
+        (i < glyphBuffer.size() / 2) with the equivalent test (i < end).
+        * platform/graphics/mac/FontComplexTextMac.cpp:
+        (WebCore::Font::getGlyphsAndAdvancesForComplexText): Ditto.
+
 2012-10-05  José Dapena Paz  <jdap...@igalia.com>
 
         [GTK] Add support for creating EGL contexts

Modified: trunk/Source/WebCore/platform/graphics/FontFastPath.cpp (130530 => 130531)


--- trunk/Source/WebCore/platform/graphics/FontFastPath.cpp	2012-10-05 18:09:14 UTC (rev 130530)
+++ trunk/Source/WebCore/platform/graphics/FontFastPath.cpp	2012-10-05 18:18:50 UTC (rev 130531)
@@ -350,7 +350,7 @@
         initialAdvance = beforeWidth;
 
     if (run.rtl()) {
-        for (int i = 0, end = glyphBuffer.size() - 1; i < glyphBuffer.size() / 2; ++i, --end)
+        for (int i = 0, end = glyphBuffer.size() - 1; i < end; ++i, --end)
             glyphBuffer.swap(i, end);
     }
 

Modified: trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp (130530 => 130531)


--- trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp	2012-10-05 18:09:14 UTC (rev 130530)
+++ trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp	2012-10-05 18:18:50 UTC (rev 130531)
@@ -91,7 +91,7 @@
 
     if (run.rtl()) {
         initialAdvance = controller.totalWidth() + controller.finalRoundingWidth() - afterWidth;
-        for (int i = 0, end = glyphBuffer.size() - 1; i < glyphBuffer.size() / 2; ++i, --end)
+        for (int i = 0, end = glyphBuffer.size() - 1; i < end; ++i, --end)
             glyphBuffer.swap(i, end);
     } else
         initialAdvance = beforeWidth;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to