Loading core/java/com/android/internal/util/FastMath.java +3 −3 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ public class FastMath { * thought it may return slightly different results. It does not try to * handle (in any meaningful way) NaN or infinities. */ public static int round(float x) { long lx = (long)(x * (65536 * 256f)); public static int round(float value) { long lx = (long) (value * (65536 * 256f)); return (int) ((lx + 0x800000) >> 24); } } graphics/java/android/graphics/Rect.java +15 −7 Original line number Diff line number Diff line Loading @@ -76,13 +76,21 @@ public final class Rect implements Parcelable { } @Override public boolean equals(Object obj) { Rect r = (Rect) obj; if (r != null) { return left == r.left && top == r.top && right == r.right && bottom == r.bottom; public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Rect r = (Rect) o; return left == r.left && top == r.top && right == r.right && bottom == r.bottom; } return false; @Override public int hashCode() { int result = left; result = 31 * result + top; result = 31 * result + right; result = 31 * result + bottom; return result; } @Override Loading graphics/java/android/graphics/RectF.java +18 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,24 @@ public class RectF implements Parcelable { bottom = r.bottom; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Rect r = (Rect) o; return left == r.left && top == r.top && right == r.right && bottom == r.bottom; } @Override public int hashCode() { int result = (left != +0.0f ? Float.floatToIntBits(left) : 0); result = 31 * result + (top != +0.0f ? Float.floatToIntBits(top) : 0); result = 31 * result + (right != +0.0f ? Float.floatToIntBits(right) : 0); result = 31 * result + (bottom != +0.0f ? Float.floatToIntBits(bottom) : 0); return result; } public String toString() { return "RectF(" + left + ", " + top + ", " + right + ", " + bottom + ")"; Loading Loading
core/java/com/android/internal/util/FastMath.java +3 −3 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ public class FastMath { * thought it may return slightly different results. It does not try to * handle (in any meaningful way) NaN or infinities. */ public static int round(float x) { long lx = (long)(x * (65536 * 256f)); public static int round(float value) { long lx = (long) (value * (65536 * 256f)); return (int) ((lx + 0x800000) >> 24); } }
graphics/java/android/graphics/Rect.java +15 −7 Original line number Diff line number Diff line Loading @@ -76,13 +76,21 @@ public final class Rect implements Parcelable { } @Override public boolean equals(Object obj) { Rect r = (Rect) obj; if (r != null) { return left == r.left && top == r.top && right == r.right && bottom == r.bottom; public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Rect r = (Rect) o; return left == r.left && top == r.top && right == r.right && bottom == r.bottom; } return false; @Override public int hashCode() { int result = left; result = 31 * result + top; result = 31 * result + right; result = 31 * result + bottom; return result; } @Override Loading
graphics/java/android/graphics/RectF.java +18 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,24 @@ public class RectF implements Parcelable { bottom = r.bottom; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Rect r = (Rect) o; return left == r.left && top == r.top && right == r.right && bottom == r.bottom; } @Override public int hashCode() { int result = (left != +0.0f ? Float.floatToIntBits(left) : 0); result = 31 * result + (top != +0.0f ? Float.floatToIntBits(top) : 0); result = 31 * result + (right != +0.0f ? Float.floatToIntBits(right) : 0); result = 31 * result + (bottom != +0.0f ? Float.floatToIntBits(bottom) : 0); return result; } public String toString() { return "RectF(" + left + ", " + top + ", " + right + ", " + bottom + ")"; Loading