From 6382f455f0bb447debc670c10360d7aed970b728 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 11 Aug 2017 13:34:02 -0400 Subject: [PATCH] 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 Commit-Queue: Brian Osman --- src/gpu/text/GrAtlasGlyphCache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;