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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TitleBitmapFactory.java

Issue 836123007: Use Math.ceil() instead of FloatMath.ceil() in TitleBitmapFactory class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TitleBitmapFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TitleBitmapFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TitleBitmapFactory.java
index dbf39e0adc8d9012b2d17235bc359b83babe5dcb..a488430e31c660e67960cdfae10221e877f741a9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TitleBitmapFactory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TitleBitmapFactory.java
@@ -15,7 +15,6 @@ import android.graphics.drawable.Drawable;
import android.text.Layout;
import android.text.TextPaint;
import android.text.TextUtils;
-import android.util.FloatMath;
import android.util.Log;
import android.view.InflateException;
@@ -73,7 +72,7 @@ public class TitleBitmapFactory {
mTextPaint.density = res.getDisplayMetrics().density;
FontMetrics textFontMetrics = mTextPaint.getFontMetrics();
- mTextHeight = FloatMath.ceil(textFontMetrics.bottom - textFontMetrics.top);
+ mTextHeight = (float) Math.ceil(textFontMetrics.bottom - textFontMetrics.top);
mTextYOffset = -textFontMetrics.top;
mFaviconDimension = res.getDimensionPixelSize(R.dimen.compositor_tab_title_favicon_size);
@@ -130,7 +129,7 @@ public class TitleBitmapFactory {
try {
boolean drawText = !TextUtils.isEmpty(title);
int textWidth =
- drawText ? (int) FloatMath.ceil(Layout.getDesiredWidth(title, mTextPaint)) : 0;
+ drawText ? (int) Math.ceil(Layout.getDesiredWidth(title, mTextPaint)) : 0;
// Minimum 1 width bitmap to avoid createBitmap function's IllegalArgumentException,
// when textWidth == 0.
Bitmap b = Bitmap.createBitmap(Math.max(Math.min(mMaxWidth, textWidth), 1), mViewHeight,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698