Android的surface类源码深度剖析(2)


    public native   void unlockCanvas(Canvas canvas);
 
    public static native   void openTransaction();
 
    public static native   void closeTransaction();


 
    public static native   void freezeDisplay(int display);


    public static native   void unfreezeDisplay(int display);

public static native   void setOrientation(int display, int orientation, int flags);

public static void setOrientation(int display, int orientation) {
        setOrientation(display, orientation, 0);
    }
   
  
    public native   void setLayer(int zorder);
    public native   void setPosition(int x, int y);
    public native   void setSize(int w, int h);

public native   void hide();
    public native   void show();
    public native   void setTransparentRegionHint(Region region);
    public native   void setAlpha(float alpha);
    public native   void setMatrix(float dsdx, float dtdx,
                                   float dsdy, float dtdy);

public native   void freeze();
    public native   void unfreeze();

public native   void setFreezeTint(int tint);

public native   void setFlags(int flags, int mask);

@Override
    public String toString() {
        return "Surface(native-token=" + mSurface + ")";
    }

private Surface(Parcel source) throws OutOfResourcesException {
        init(source);
    }
   
    public int describeContents() {
        return 0;
    }

public native   void readFromParcel(Parcel source);
    public native   void writeToParcel(Parcel dest, int flags);

public static final Parcelable.Creator<Surface> CREATOR
            = new Parcelable.Creator<Surface>()
    {
        public Surface createFromParcel(Parcel source) {
            try {
                return new Surface(source);
            } catch (Exception e) {
                Log.e(LOG_TAG, "Exception creating surface from parcel", e);
            }
            return null;
        }

public Surface[] newArray(int size) {
            return new Surface[size];
        }
    };

/* no user serviceable parts here ... */
    @Override
    protected void finalize() throws Throwable {
        clear();
    }
   
    private native void init(SurfaceSession s,
            int pid, int display, int w, int h, int format, int flags)
            throws OutOfResourcesException;

private native void init(Parcel source);
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wyspxy.html