move SkScalarLog2 into its only client, in a move to reduce our public API surface area
BUG=
Review URL: https://codereview.chromium.org/93643004
git-svn-id: http://skia.googlecode.com/svn/trunk@12731 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h
index 93677df..4ab3616 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -216,12 +216,6 @@
return A + SkScalarMul(B - A, t);
}
-static inline SkScalar SkScalarLog2(SkScalar x) {
- static const SkScalar log2_conversion_factor = SkScalarDiv(1, SkScalarLog(2));
-
- return SkScalarMul(SkScalarLog(x), log2_conversion_factor);
-}
-
/** Interpolate along the function described by (keys[length], values[length])
for the passed searchKey. SearchKeys outside the range keys[0]-keys[Length]
clamp to the min or max value. This function was inspired by a desire
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index 88ddc75..aae1006 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -34,6 +34,12 @@
#include "SkThreadUtils.h"
#include "SkTypes.h"
+static inline SkScalar scalar_log2(SkScalar x) {
+ static const SkScalar log2_conversion_factor = SkScalarDiv(1, SkScalarLog(2));
+
+ return SkScalarLog(x) * log2_conversion_factor;
+}
+
namespace sk_tools {
enum {
@@ -512,7 +518,7 @@
rounded_value = width - (width % fTileMinPowerOf2Width) + fTileMinPowerOf2Width;
}
- int num_bits = SkScalarCeilToInt(SkScalarLog2(SkIntToScalar(width)));
+ int num_bits = SkScalarCeilToInt(scalar_log2(SkIntToScalar(width)));
int largest_possible_tile_size = 1 << num_bits;
fTilesX = fTilesY = 0;