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

Unified Diff: tools/PictureRenderer.cpp

Issue 93643004: move SkScalarLog2 into its only client, in a move to reduce our public API surface area (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkScalar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureRenderer.cpp
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index 88ddc7513748161bbeed1b804b88b06c663f3ca3..aae10067c4411157fbaaf344cfdb2ac0e146b52d 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 @@ void TiledPictureRenderer::setupPowerOf2Tiles() {
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;
« no previous file with comments | « include/core/SkScalar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698