summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorTed Bonkenburg <tedbo@google.com>2011-07-25 10:24:30 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-25 10:24:30 -0700
commit5518dd92d38edd5902482841413722aa654cc2e7 (patch)
tree8fed33fc854d72b0000c8ad99565f8377c7e6607 /core/java/android
parent63d050034df5eedc9586e393d56444cd34681bd1 (diff)
parent0de171b0d490a5928d54d2fb67c912d140aac643 (diff)
downloadframeworks_base-5518dd92d38edd5902482841413722aa654cc2e7.zip
frameworks_base-5518dd92d38edd5902482841413722aa654cc2e7.tar.gz
frameworks_base-5518dd92d38edd5902482841413722aa654cc2e7.tar.bz2
Merge "Add support for creating a Surface from a a SurfaceTexture."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/Surface.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index c913bb3..836867b 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -161,6 +161,9 @@ public class Surface implements Parcelable {
*/
public static final int FLAGS_ORIENTATION_ANIMATION_DISABLE = 0x000000001;
+ // The mSurfaceControl will only be present for Surfaces used by the window
+ // server or system processes. When this class is parceled we defer to the
+ // mSurfaceControl to do the parceling. Otherwise we parcel the mNativeSurface.
@SuppressWarnings("unused")
private int mSurfaceControl;
@SuppressWarnings("unused")
@@ -202,6 +205,19 @@ public class Surface implements Parcelable {
native private static void nativeClassInit();
static { nativeClassInit(); }
+ /**
+ * Create Surface from a SurfaceTexture.
+ *
+ * @param surfaceTexture The {@link SurfaceTexture} that is updated by this Surface.
+ * @hide
+ */
+ public Surface(SurfaceTexture surfaceTexture) {
+ if (DEBUG_RELEASE) {
+ mCreationStack = new Exception();
+ }
+ mCanvas = new CompatibleCanvas();
+ initFromSurfaceTexture(surfaceTexture);
+ }
/**
* create a surface
@@ -505,5 +521,7 @@ public class Surface implements Parcelable {
private native void init(Parcel source);
+ private native void initFromSurfaceTexture(SurfaceTexture surfaceTexture);
+
private native int getIdentity();
}