java.lang.Object | |
↳ | android.view.Surface |
Handle on to a raw buffer that is being managed by the screen compositor.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Surface.OutOfResourcesException | Exception thrown when a surface couldn't be created or resized |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creator<Surface> | CREATOR | ||||||||||
int | FX_SURFACE_BLUR | Creates a Blur surface. | |||||||||
int | FX_SURFACE_DIM | Creates a Dim surface. | |||||||||
int | FX_SURFACE_MASK | Mask used for FX values above | |||||||||
int | FX_SURFACE_NORMAL | Creates a normal surface. | |||||||||
int | GPU | Implies "HARDWARE", the surface is to be used by the GPU additionally the backbuffer is never preserved for these surfaces. | |||||||||
int | HARDWARE | The surface is to be used by hardware accelerators or DMA engines | |||||||||
int | HIDDEN | Surface is created hidden | |||||||||
int | NON_PREMULTIPLIED | Creates a surface where color components are interpreted as "non pre-multiplied" by their alpha channel. | |||||||||
int | PUSH_BUFFERS | Creates a surface without a rendering buffer. | |||||||||
int | ROTATION_0 | ||||||||||
int | ROTATION_180 | ||||||||||
int | ROTATION_270 | ||||||||||
int | ROTATION_90 | ||||||||||
int | SECURE | The surface contains secure content, special measures will be taken to disallow the surface's content to be copied from another process. | |||||||||
int | SURACE_FROZEN | Freeze the surface. | |||||||||
int | SURFACE_BLUR_FREEZE | ||||||||||
int | SURFACE_DITHER | Enable dithering when compositing this surface | |||||||||
int | SURFACE_HIDDEN | Hide the surface. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Does this object hold a valid surface? Returns true if it holds
a physical surface, so lockCanvas() will succeed.
| |||||||||||
draw into a surface
| |||||||||||
set surface parameters.
| |||||||||||
set the orientation of the given display.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
unlock the surface.
| |||||||||||
unlock the surface and asks a page flip
| |||||||||||
Flatten this object in to a Parcel.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Is called before the object's memory is being reclaimed by the VM.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface android.os.Parcelable
|
Creates a Blur surface. Everything behind this surface is blurred by some amount. The quality and refresh speed of the blur effect is not settable or guaranteed. It is an error to lock a Blur surface, since it doesn't have a backing store.
Creates a Dim surface. Everything behind this surface is dimmed by the amount specified in setAlpha(). It is an error to lock a Dim surface, since it doesn't have a backing store.
Mask used for FX values above
Creates a normal surface. This is the default
Implies "HARDWARE", the surface is to be used by the GPU additionally the backbuffer is never preserved for these surfaces.
The surface is to be used by hardware accelerators or DMA engines
Surface is created hidden
Creates a surface where color components are interpreted as "non pre-multiplied" by their alpha channel. Of course this flag is meaningless for surfaces without an alpha channel. By default surfaces are pre-multiplied, which means that each color component is already multiplied by its alpha value. In this case the blending equation used is: DEST = SRC + DEST * (1-SRC_ALPHA) By contrast, non pre-multiplied surfaces use the following equation: DEST = SRC * SRC_ALPHA * DEST * (1-SRC_ALPHA) pre-multiplied surfaces must always be used if transparent pixels are composited on top of each-other into the surface. A pre-multiplied surface can never lower the value of the alpha component of a given pixel. In some rare situations, a non pre-multiplied surface is preferable.
Creates a surface without a rendering buffer. Instead, the content of the surface must be pushed by an external entity. This is type of surface can be used for efficient camera preview or movie play back.
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.
Freeze the surface. Equivalent to calling freeze()
Enable dithering when compositing this surface
Hide the surface. Equivalent to calling hide()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Does this object hold a valid surface? Returns true if it holds a physical surface, so lockCanvas() will succeed. Otherwise returns false.
set surface parameters. needs to be inside open/closeTransaction block
set the orientation of the given display.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's hashCode(), that is, it is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
unlock the surface. the screen won't be updated until post() or postAll() is called
unlock the surface and asks a page flip
Flatten this object in to a Parcel.
dest | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. |
Is called before the object's memory is being reclaimed by the VM. This can only happen once the VM has detected, during a run of the garbage collector, that the object is no longer reachable by any thread of the running application.
The method can be used to free system resources or perform other cleanup
before the object is garbage collected. The default implementation of the
method is empty, which is also expected by the VM, but subclasses can
override finalize()
as required. Uncaught exceptions which are
thrown during the execution of this method cause it to terminate
immediately but are otherwise ignored.
Note that the VM does guarantee that finalize()
is called at most
once for any object, but it doesn't guarantee when (if at all) finalize()
will be called. For example, object B's finalize()
can delay the execution of object A's finalize()
method and
therefore it can delay the reclamation of A's memory. To be safe, use a
ReferenceQueue, because it provides more control
over the way the VM deals with references during garbage collection.
Throwable |
---|