Reference:Android.view.Surface

From Triled Wiki

Jump to: navigation, search


android.view
public class android.view.Surface

java.lang.Object
android.view.Surface Parcelable

[edit] Summary

[edit] Constants

      Value  
Creator   CREATOR        
int  HIDDEN   Surface is created hidden   0x00000004 
int  ORIENTATION_180     0x00000002 
int  ORIENTATION_270     0x00000003 
int  ORIENTATION_90     0x00000001 
int  ORIENTATION_DEFAULT     0x00000000 
int  PAGE_ALIGNED   The surface is guaranteed to be aligned on a Page boundary   16  0x00000010 
int  SECURE   The surface contains secure content, special measures will be taken to disallow the surface's content to be copied from another process.   128  0x00000080 
int  SURACE_FROZEN   Freeze the surface.   0x00000002 
int  SURFACE_BLUR_FREEZE     16  0x00000010 
int  SURFACE_DITHER   Enable dithering when compositing this surface   0x00000004 
int  SURFACE_HIDDEN   Hide the surface.   0x00000001 

[edit] Public Constructors

          Surface (SurfaceSession s, int display, int w, int h, int format)
create a surface
          Surface (SurfaceSession s, int display, int w, int h, int format, int flags)
          Surface ()
Create an empty surface, which will later be filled in by readFromParcel().

[edit] Public Methods

        void  clear ()
Call this free the surface up.
      static  void  closeTransaction ()
        void  copyFrom (Surface o)
Copy another surface to this one.
        void  freeze ()
      static  void  freezeDisplay (int display)
Freezes the specified display, No updating of the screen will occur until unfreezeDisplay() is called.
        void  hide ()
        boolean  isValid ()
Does this object hold a valid surface? Returns true if it holds a physical surface, so lockCanvas() will succeed.
        Canvas   lockCanvas (Rect dirty)
draw into a surface
      static  void  openTransaction ()
start/end a transaction
        void  post ()
request a page flip for this surface
        void  readFromParcel (Parcel source)
        Bitmap   screenshot ()
screenshot API for instrumentation.
        void  setAlpha (float alpha)
        void  setFlags (int flags, int mask)
        void  setFreezeTint (int tint)
        void  setLayer (int zorder)
set surface parameters.
        void  setMatrix (float dsdx, float dtdx, float dsdy, float dtdy)
      static  void  setOrientation (int display, int orientation)
set the orientation of the given display.
        void  setPosition (int x, int y)
        void  setSize (int w, int h)
        void  setTransparentRegionHint (Region region)
        void  show ()
        String   toString ()
Answers a string containing a concise, human-readable description of the receiver.
        void  unfreeze ()
      static  void  unfreezeDisplay (int display)
resume updating the specified display.
        void  unlockCanvas (Canvas canvas)
unlock the surface.
        void  unlockCanvasAndPost (Canvas canvas)
unlock the surface and asks a page flip
        void  writeToParcel (Parcel dest)

[edit] Protected Methods

        void  finalize ()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver.

[edit] Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
[edit] Methods inherited from interface android.os.Parcelable

writeToParcel

[edit] Details

[edit] Constants

[edit] public static final Creator CREATOR

[edit] public static final int HIDDEN

Surface is created hidden Constant Value: 4 (0x00000004)

[edit] public static final int ORIENTATION_180

Constant Value: 2 (0x00000002)

[edit] public static final int ORIENTATION_270

Constant Value: 3 (0x00000003)

[edit] public static final int ORIENTATION_90

Constant Value: 1 (0x00000001)

[edit] public static final int ORIENTATION_DEFAULT

Constant Value: 0 (0x00000000)

[edit] public static final int PAGE_ALIGNED

The surface is guaranteed to be aligned on a Page boundary Constant Value: 16 (0x00000010)

[edit] public static final int SECURE

The surface contains secure content, special measures will be taken to disallow the surface's content to be copied from another process. In particular, screenshots and VNC servers will be disabled, but other measures can take place, for instance the surface might not be hardware accelerated. Constant Value: 128 (0x00000080)

[edit] public static final int SURACE_FROZEN

Freeze the surface. Equivalent to calling freeze() Constant Value: 2 (0x00000002)

[edit] public static final int SURFACE_BLUR_FREEZE

Constant Value: 16 (0x00000010)

[edit] public static final int SURFACE_DITHER

Enable dithering when compositing this surface Constant Value: 4 (0x00000004)

[edit] public static final int SURFACE_HIDDEN

Hide the surface. Equivalent to calling hide() Constant Value: 1 (0x00000001)

[edit] Public Constructors

[edit] public Surface(SurfaceSession s, int display, int w, int h, int format)

create a surface

[edit] public Surface(SurfaceSession s, int display, int w, int h, int format, int flags)

[edit] public Surface()

Create an empty surface, which will later be filled in by readFromParcel().

[edit] Public Methods

[edit] public void clear()

Call this free the surface up.

[edit] public static void closeTransaction()

[edit] public void copyFrom(Surface o)

Copy another surface to this one. This surface now holds a reference to the same data as the original surface, and is -not- the owner.

[edit] public void freeze()

[edit] public static void freezeDisplay(int display)

Freezes the specified display, No updating of the screen will occur until unfreezeDisplay() is called. Everything else works as usual though, in particular transactions.

[edit] public void hide()

[edit] public boolean isValid()

Does this object hold a valid surface? Returns true if it holds a physical surface, so lockCanvas() will succeed. Otherwise returns false.

[edit] public Canvas lockCanvas(Rect dirty)

draw into a surface

[edit] public static void openTransaction()

start/end a transaction

[edit] public void post()

request a page flip for this surface

[edit] public void readFromParcel(Parcel source)

[edit] public Bitmap screenshot()

screenshot API for instrumentation. Returns a copy of the content of the Surface's front buffer. The Surface MUST NOT be locked.

[edit] public void setAlpha(float alpha)

[edit] public void setFlags(int flags, int mask)

[edit] public void setFreezeTint(int tint)

[edit] public void setLayer(int zorder)

set surface parameters. needs to be inside open/closeTransaction block

[edit] public void setMatrix(float dsdx, float dtdx, float dsdy, float dtdy)

[edit] public static void setOrientation(int display, int orientation)

set the orientation of the given display.

[edit] public void setPosition(int x, int y)

[edit] public void setSize(int w, int h)

[edit] public void setTransparentRegionHint(Region region)

[edit] public void show()

[edit] public String toString()

Answers a string containing a concise, human-readable description of the receiver.

[edit] public void unfreeze()

[edit] public static void unfreezeDisplay(int display)

resume updating the specified display.

[edit] public void unlockCanvas(Canvas canvas)

unlock the surface. the screen won't be updated until post() or postAll() is called

[edit] public void unlockCanvasAndPost(Canvas canvas)

unlock the surface and asks a page flip

[edit] public void writeToParcel(Parcel dest)

[edit] Protected Methods

[edit] protected void finalize()

Called by the virtual machine when there are no longer any (non-weak) references to the receiver. Subclasses can use this facility to guarantee that any associated resources are cleaned up before the receiver is garbage collected. Uncaught exceptions which are thrown during the running of the method cause it to terminate immediately, but are otherwise ignored.

Note: The virtual machine assumes that the implementation in class Object is empty.

Throws

Throwable

[edit] References

Personal tools