summaryrefslogtreecommitdiff
path: root/core/java/android/view/Surface.java
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2020-04-16 17:01:19 -0400
committerLeon Scroggins <scroggo@google.com>2020-04-20 15:30:36 +0000
commit3819930112b71099f4074a2beadf75b7aa967eb3 (patch)
tree4fc9d1dd6a62e265762ce7b04db8f271bd020817 /core/java/android/view/Surface.java
parent0356f7b169a18097972d83dcd1bb928dc2e5a06c (diff)
Remove old versions of attachAndQueBuffer
Bug: 150395371 Bug: 153729799 Test: go/wm-smoke Once I30a02c3688e43c1cbe3cbcef0775f3f554a0370f lands, there are no callers of the old versions. Rather than creating a new Java object and waiting for its finalizer, pass the HardwareBuffer directly to native and use it to retrieve the native GraphicBuffer. Change-Id: I190bc7ba5e9ea4f2f57287471e211be1d3bfcb6d
Diffstat (limited to 'core/java/android/view/Surface.java')
-rw-r--r--core/java/android/view/Surface.java23
1 files changed, 2 insertions, 21 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index e0dd918e50e3..b6725c0ebc13 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -25,7 +25,6 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.res.CompatibilityInfo.Translator;
import android.graphics.Canvas;
import android.graphics.ColorSpace;
-import android.graphics.GraphicBuffer;
import android.graphics.HardwareRenderer;
import android.graphics.Matrix;
import android.graphics.RecordingCanvas;
@@ -87,7 +86,7 @@ public class Surface implements Parcelable {
private static native int nativeSetScalingMode(long nativeObject, int scalingMode);
private static native int nativeForceScopedDisconnect(long nativeObject);
private static native int nativeAttachAndQueueBufferWithColorSpace(long nativeObject,
- GraphicBuffer buffer, int colorSpaceId);
+ HardwareBuffer buffer, int colorSpaceId);
private static native int nativeSetSharedBufferModeEnabled(long nativeObject, boolean enabled);
private static native int nativeSetAutoRefreshEnabled(long nativeObject, boolean enabled);
@@ -736,7 +735,7 @@ public class Surface implements Parcelable {
* treated as SRGB.
* @hide
*/
- public void attachAndQueueBufferWithColorSpace(GraphicBuffer buffer, ColorSpace colorSpace) {
+ public void attachAndQueueBufferWithColorSpace(HardwareBuffer buffer, ColorSpace colorSpace) {
synchronized (mLock) {
checkNotReleasedLocked();
if (colorSpace == null) {
@@ -753,24 +752,6 @@ public class Surface implements Parcelable {
}
/**
- * @hide
- */
- public void attachAndQueueBufferWithColorSpace(HardwareBuffer buffer, ColorSpace colorSpace) {
- attachAndQueueBufferWithColorSpace(GraphicBuffer.createFromHardwareBuffer(buffer),
- colorSpace);
- }
-
- /**
- * Deprecated, use attachAndQueueBufferWithColorSpace instead.
- * Transfer ownership of buffer and present it on the Surface.
- * The color space of the buffer is treated as SRGB.
- * @hide
- */
- public void attachAndQueueBuffer(GraphicBuffer buffer) {
- attachAndQueueBufferWithColorSpace(buffer, ColorSpace.get(ColorSpace.Named.SRGB));
- }
-
- /**
* Returns whether or not this Surface is backed by a single-buffered SurfaceTexture
* @hide
*/