aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-08-11 13:34:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-11 18:05:26 +0000
commit6382f455f0bb447debc670c10360d7aed970b728 (patch)
tree2710b342f746a3db251c59e76ccea432c24869f7 /src
parenta1d1703b749b55dc1a07da6aa28447c3cd060e57 (diff)
Replace log2 with SkNextLog2
log2 didn't exist on Android until API 18, and it's doing double precision math. I think this integer version is what we want? Bug: skia: Change-Id: I4909153c56a266688355349cda5d553b69f5c942 Reviewed-on: https://skia-review.googlesource.com/33680 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/text/GrAtlasGlyphCache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/text/GrAtlasGlyphCache.cpp b/src/gpu/text/GrAtlasGlyphCache.cpp
index 1487d28460..e0d3786502 100644
--- a/src/gpu/text/GrAtlasGlyphCache.cpp
+++ b/src/gpu/text/GrAtlasGlyphCache.cpp
@@ -11,6 +11,7 @@
#include "GrRectanizer.h"
#include "GrSurfacePriv.h"
#include "SkAutoMalloc.h"
+#include "SkMathPriv.h"
#include "SkString.h"
#include "SkDistanceFieldGen.h"
@@ -38,7 +39,7 @@ bool GrAtlasGlyphCache::initAtlas(GrMaskFormat format) {
GrAtlasGlyphCache::GrAtlasGlyphCache(GrContext* context, float maxTextureBytes)
: fContext(context), fPreserveStrike(nullptr) {
// Calculate RGBA size. Must be between 1024 x 512 and MaxTextureSize x MaxTextureSize / 2
- int log2MaxTextureSize = log2(context->caps()->maxTextureSize());
+ int log2MaxTextureSize = SkPrevLog2(context->caps()->maxTextureSize());
int log2MaxDim = 10;
for (; log2MaxDim <= log2MaxTextureSize; ++log2MaxDim) {
int maxDim = 1 << log2MaxDim;