Title: [124901] trunk/Source/WebCore
Revision
124901
Author
r...@google.com
Date
2012-08-07 11:44:44 -0700 (Tue, 07 Aug 2012)

Log Message

reimplement fastMod w/o (soon to be) private skia macros
https://bugs.webkit.org/show_bug.cgi?id=93370

Reviewed by Adrienne Walker.

fastMod() reimplemented (same functionality) to stop using soon-to-be private macros in
SkMath.h. The new version is functionally identical.

No new tests -- existing layouttests exercise GraphicsContext::strokeArc(), the only caller

* platform/graphics/skia/GraphicsContextSkia.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124900 => 124901)


--- trunk/Source/WebCore/ChangeLog	2012-08-07 18:44:16 UTC (rev 124900)
+++ trunk/Source/WebCore/ChangeLog	2012-08-07 18:44:44 UTC (rev 124901)
@@ -1,3 +1,17 @@
+2012-08-07  Mike Reed  <r...@google.com>
+
+        reimplement fastMod w/o (soon to be) private skia macros
+        https://bugs.webkit.org/show_bug.cgi?id=93370
+
+        Reviewed by Adrienne Walker.
+
+        fastMod() reimplemented (same functionality) to stop using soon-to-be private macros in
+        SkMath.h. The new version is functionally identical.
+
+        No new tests -- existing layouttests exercise GraphicsContext::strokeArc(), the only caller
+
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+
 2012-08-07  Brian Anderson  <briander...@chromium.org>
 
         Add CCDelayBasedTimeSource::setTimebaseAndInterval

Modified: trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp (124900 => 124901)


--- trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	2012-08-07 18:44:16 UTC (rev 124900)
+++ trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	2012-08-07 18:44:44 UTC (rev 124901)
@@ -68,14 +68,19 @@
 
 namespace {
 
+// Return value % max, but account for value possibly being negative.
 inline int fastMod(int value, int max)
 {
-    int sign = SkExtractSign(value);
-
-    value = SkApplySign(value, sign);
+    bool isNeg = false;
+    if (value < 0) {
+        value = -value;
+        isNeg = true;
+    }
     if (value >= max)
         value %= max;
-    return SkApplySign(value, sign);
+    if (isNeg)
+        value = -value;
+    return value;
 }
 
 inline float square(float n)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to