diff options
Diffstat (limited to 'android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java')
-rw-r--r-- | android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java b/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java index f860cd9b4be2..f2e164b5ba89 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java @@ -7,7 +7,6 @@ package org.mozilla.gecko.gfx; import android.graphics.PointF; import android.graphics.RectF; -import android.util.FloatMath; import android.util.Log; import org.json.JSONArray; @@ -169,10 +168,10 @@ final class DisplayPortCalculator { float top = metrics.viewportRectTop - margins.top; float right = metrics.viewportRectRight + margins.right; float bottom = metrics.viewportRectBottom + margins.bottom; - left = Math.max(metrics.pageRectLeft, TILE_SIZE * FloatMath.floor(left / TILE_SIZE)); - top = Math.max(metrics.pageRectTop, TILE_SIZE * FloatMath.floor(top / TILE_SIZE)); - right = Math.min(metrics.pageRectRight, TILE_SIZE * FloatMath.ceil(right / TILE_SIZE)); - bottom = Math.min(metrics.pageRectBottom, TILE_SIZE * FloatMath.ceil(bottom / TILE_SIZE)); + left = (float) Math.max(metrics.pageRectLeft, TILE_SIZE * Math.floor(left / TILE_SIZE)); + top = (float) Math.max(metrics.pageRectTop, TILE_SIZE * Math.floor(top / TILE_SIZE)); + right = (float) Math.min(metrics.pageRectRight, TILE_SIZE * Math.ceil(right / TILE_SIZE)); + bottom = (float) Math.min(metrics.pageRectBottom, TILE_SIZE * Math.ceil(bottom / TILE_SIZE)); return new DisplayPortMetrics(left, top, right, bottom, zoom); } @@ -722,7 +721,7 @@ final class DisplayPortCalculator { public boolean drawTimeUpdate(long millis, int pixels) { // calculate the number of frames it took to draw a viewport-sized area float normalizedTime = (float)mPixelArea * (float)millis / (float)pixels; - int normalizedFrames = (int)FloatMath.ceil(normalizedTime * 60f / 1000f); + int normalizedFrames = (int)Math.ceil(normalizedTime * 60f / 1000f); // broaden our range on how long it takes to draw if the draw falls outside // the range. this allows it to grow gradually. this heuristic may need to // be tweaked into more of a floating window average or something. |