English | Site Directory

Android - An Open Handset Alliance Project

android.view
public class

android.view.Surface

java.lang.Object
android.view.Surface Parcelable

Summary

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 

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().

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)

Protected Methods

        void  finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver.
Methods inherited from class java.lang.Object
Methods inherited from interface android.os.Parcelable

Details

Constants

public static final Creator CREATOR

public static final int HIDDEN

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

public static final int ORIENTATION_180

Constant Value: 2 (0x00000002)

public static final int ORIENTATION_270

Constant Value: 3 (0x00000003)

public static final int ORIENTATION_90

Constant Value: 1 (0x00000001)

public static final int ORIENTATION_DEFAULT

Constant Value: 0 (0x00000000)

public static final int PAGE_ALIGNED

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

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)

public static final int SURACE_FROZEN

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

public static final int SURFACE_BLUR_FREEZE

Constant Value: 16 (0x00000010)

public static final int SURFACE_DITHER

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

public static final int SURFACE_HIDDEN

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

Public Constructors

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

create a surface

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

public Surface()

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

Public Methods

public void clear()

Call this free the surface up.

public static void closeTransaction()

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.

public void freeze()

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.

public void hide()

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.

public Canvas lockCanvas(Rect dirty)

draw into a surface

public static void openTransaction()

start/end a transaction

public void post()

request a page flip for this surface

public void readFromParcel(Parcel source)

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.

public void setAlpha(float alpha)

public void setFlags(int flags, int mask)

public void setFreezeTint(int tint)

public void setLayer(int zorder)

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

public void setMatrix(float dsdx, float dtdx, float dsdy, float dtdy)

public static void setOrientation(int display, int orientation)

set the orientation of the given display.

public void setPosition(int x, int y)

public void setSize(int w, int h)

public void setTransparentRegionHint(Region region)

public void show()

public String toString()

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

public void unfreeze()

public static void unfreezeDisplay(int display)

resume updating the specified display.

public void unlockCanvas(Canvas canvas)

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

public void unlockCanvasAndPost(Canvas canvas)

unlock the surface and asks a page flip

public void writeToParcel(Parcel dest)

Protected Methods

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
Build m5-rc15g - 14 May 2008 12:50