Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc7d8008 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Add plumbing for new surface flinger display API." into jb-mr1-dev

parents ac66d4a8 64a55af0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24427,7 +24427,7 @@ package android.view {
    method public android.graphics.Canvas lockCanvas(android.graphics.Rect) throws java.lang.IllegalArgumentException, android.view.Surface.OutOfResourcesException;
    method public void readFromParcel(android.os.Parcel);
    method public void release();
    method public void unlockCanvas(android.graphics.Canvas);
    method public deprecated void unlockCanvas(android.graphics.Canvas);
    method public void unlockCanvasAndPost(android.graphics.Canvas);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
+614 −317

File changed.

Preview size limit exceeded, changes collapsed.

+13 −11
Original line number Diff line number Diff line
@@ -16,30 +16,32 @@

package android.view;


/**
 * An instance of this class represents a connection to the surface
 * flinger, in which you can create one or more Surface instances that will
 * flinger, from which you can create one or more Surface instances that will
 * be composited to the screen.
 * {@hide}
 */
public class SurfaceSession {
    private int mClient;
public final class SurfaceSession {
    // Note: This field is accessed by native code.
    private int mNativeClient; // SurfaceComposerClient*

    private native void nativeInit();
    private native void nativeDestroy();
    private native void nativeKill();
    private static native int nativeCreate();
    private static native void nativeDestroy(int ptr);
    private static native void nativeKill(int ptr);

    /** Create a new connection with the surface flinger. */
    public SurfaceSession() {
        nativeInit();
        mNativeClient = nativeCreate();
    }

    /* no user serviceable parts here ... */
    @Override
    protected void finalize() throws Throwable {
        try {
            nativeDestroy();
            if (mNativeClient != 0) {
                nativeDestroy(mNativeClient);
            }
        } finally {
            super.finalize();
        }
@@ -48,10 +50,10 @@ public class SurfaceSession {
    /**
     * Forcibly detach native resources associated with this object.
     * Unlike destroy(), after this call any surfaces that were created
     * from the session will no longer work. The session itself is destroyed.
     * from the session will no longer work.
     */
    public void kill() {
        nativeKill();
        nativeKill(mNativeClient);
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ LOCAL_SRC_FILES:= \
	android_emoji_EmojiFactory.cpp \
	android_view_DisplayEventReceiver.cpp \
	android_view_Surface.cpp \
	android_view_SurfaceSession.cpp \
	android_view_TextureView.cpp \
	android_view_InputChannel.cpp \
	android_view_InputDevice.cpp \
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ extern int register_android_view_GLES20DisplayList(JNIEnv* env);
extern int register_android_view_GLES20Canvas(JNIEnv* env);
extern int register_android_view_HardwareRenderer(JNIEnv* env);
extern int register_android_view_Surface(JNIEnv* env);
extern int register_android_view_SurfaceSession(JNIEnv* env);
extern int register_android_view_TextureView(JNIEnv* env);
extern int register_android_database_CursorWindow(JNIEnv* env);
extern int register_android_database_SQLiteConnection(JNIEnv* env);
@@ -1094,6 +1095,7 @@ static const RegJNIRec gRegJNI[] = {
    REG_JNI(register_android_view_GLES20Canvas),
    REG_JNI(register_android_view_HardwareRenderer),
    REG_JNI(register_android_view_Surface),
    REG_JNI(register_android_view_SurfaceSession),
    REG_JNI(register_android_view_TextureView),
    REG_JNI(register_com_google_android_gles_jni_EGLImpl),
    REG_JNI(register_com_google_android_gles_jni_GLImpl),
Loading