summaryrefslogtreecommitdiff
path: root/core/java/android/view/MagnificationSpec.java
diff options
context:
space:
mode:
authorQasid Ahmad Sadiq <qasid@google.com>2020-12-14 17:47:38 -0800
committerQasid Ahmad Sadiq <qasid@google.com>2020-12-14 18:35:45 -0800
commit179a6b06836d574ee5a418e4f0876ac8d79d8a7d (patch)
tree9b284edd8728d2fd5b1a9846916dfd20dca9be40 /core/java/android/view/MagnificationSpec.java
parent027e0e0debdd4dabcc79d4bd49a6517cd32b525b (diff)
Remove recycling magnificationSpec and region.
It doesn't seem like this would add a performance bump, but it does make code quite ab it more complex (especially the prefetching CL). Let's remove it to avoid bugs. Test: CTSAccessibility* Tried it by hand. Bug: 30969887 Change-Id: Ibc2fb856dbb1a0f7786882d4b89d71bbcb7e5af2
Diffstat (limited to 'core/java/android/view/MagnificationSpec.java')
-rw-r--r--core/java/android/view/MagnificationSpec.java29
1 files changed, 1 insertions, 28 deletions
diff --git a/core/java/android/view/MagnificationSpec.java b/core/java/android/view/MagnificationSpec.java
index 034598a92532..50d3113d4e7c 100644
--- a/core/java/android/view/MagnificationSpec.java
+++ b/core/java/android/view/MagnificationSpec.java
@@ -19,7 +19,6 @@ package android.view;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
-import android.util.Pools.SynchronizedPool;
/**
* This class represents spec for performing screen magnification.
@@ -27,9 +26,6 @@ import android.util.Pools.SynchronizedPool;
* @hide
*/
public class MagnificationSpec implements Parcelable {
- private static final int MAX_POOL_SIZE = 20;
- private static final SynchronizedPool<MagnificationSpec> sPool =
- new SynchronizedPool<>(MAX_POOL_SIZE);
/** The magnification scaling factor. */
public float scale = 1.0f;
@@ -46,10 +42,6 @@ public class MagnificationSpec implements Parcelable {
*/
public float offsetY;
- private MagnificationSpec() {
- /* do nothing - reducing visibility */
- }
-
public void initialize(float scale, float offsetX, float offsetY) {
if (scale < 1) {
throw new IllegalArgumentException("Scale must be greater than or equal to one!");
@@ -63,24 +55,6 @@ public class MagnificationSpec implements Parcelable {
return scale == 1.0f && offsetX == 0 && offsetY == 0;
}
- public static MagnificationSpec obtain(MagnificationSpec other) {
- MagnificationSpec info = obtain();
- info.scale = other.scale;
- info.offsetX = other.offsetX;
- info.offsetY = other.offsetY;
- return info;
- }
-
- public static MagnificationSpec obtain() {
- MagnificationSpec spec = sPool.acquire();
- return (spec != null) ? spec : new MagnificationSpec();
- }
-
- public void recycle() {
- clear();
- sPool.release(this);
- }
-
public void clear() {
scale = 1.0f;
offsetX = 0.0f;
@@ -103,7 +77,6 @@ public class MagnificationSpec implements Parcelable {
parcel.writeFloat(scale);
parcel.writeFloat(offsetX);
parcel.writeFloat(offsetY);
- recycle();
}
@Override
@@ -155,7 +128,7 @@ public class MagnificationSpec implements Parcelable {
@Override
public MagnificationSpec createFromParcel(Parcel parcel) {
- MagnificationSpec spec = MagnificationSpec.obtain();
+ MagnificationSpec spec = new MagnificationSpec();
spec.initFromParcel(parcel);
return spec;
}