android.view
public
class
android.view.Surface
Summary
Constants
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
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
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
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
String
toString()
Answers a string containing a concise, human-readable description of the
receiver.
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.