java.lang.Object | |
↳ | sun.awt.image.SurfaceManager |
![]() |
![]() |
The abstract base class that manages the various SurfaceData objects that represent an Image's contents. Subclasses can customize how the surfaces are organized, whether to cache the original contents in an accelerated surface, and so on.
The SurfaceManager also maintains an arbitrary "cache" mechanism which allows other agents to store data in it specific to their use of this image. The most common use of the caching mechanism is for destination SurfaceData objects to store cached copies of the source image.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SurfaceManager.FlushableCacheData | An interface for Objects used in the SurfaceManager cache to implement if they have data that should be flushed when the Image is flushed. | ||||||||||
SurfaceManager.ImageAccessor | |||||||||||
SurfaceManager.ProxiedGraphicsConfig | An interface for GraphicsConfiguration objects to implement if their surfaces accelerate images using SurfaceDataProxy objects. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Notification that any accelerated surfaces associated with this manager
have been "lost", which might mean that they need to be manually
restored or recreated.
| |||||||||||
Releases system resources in use by ancillary SurfaceData objects,
such as surfaces cached in accelerated memory.
| |||||||||||
Return an arbitrary cached object for an arbitrary cache key.
| |||||||||||
Returns an ImageCapabilities object which can be
inquired as to the specific capabilities of this
Image.
| |||||||||||
Returns the SurfaceManager object contained within the given Image.
| |||||||||||
Returns the main SurfaceData object that "owns" the pixels for
this SurfaceManager.
| |||||||||||
Restores the primary surface being managed, and then returns the
replacement surface.
| |||||||||||
Called when image's acceleration priority is changed.
| |||||||||||
Store an arbitrary cached object for an arbitrary cache key.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Notification that any accelerated surfaces associated with this manager have been "lost", which might mean that they need to be manually restored or recreated. The default implementation does nothing, but platform-specific variants which have accelerated surfaces should perform any necessary actions.
Releases system resources in use by ancillary SurfaceData objects, such as surfaces cached in accelerated memory. Subclasses should override to release any of their flushable data.
The default implementation will visit all of the value objects in the cacheMap and flush them if they implement the FlushableCacheData interface.
Return an arbitrary cached object for an arbitrary cache key. Other objects can use this mechanism to store cached data about the source image that will let them save time when using or manipulating the image in the future.
Note that the cache is maintained as a simple Map with no attempts to keep it up to date or invalidate it so any data stored here must either not be dependent on the state of the image or it must be individually tracked to see if it is outdated or obsolete.
The SurfaceData object of the primary (destination) surface has a StateTracker mechanism which can help track the validity and "currentness" of any data stored here. For convenience and expediency an object stored as cached data may implement the FlushableCacheData interface specified below so that it may be notified immediately if the flush() method is ever called.
Returns an ImageCapabilities object which can be inquired as to the specific capabilities of this Image. The capabilities object will return true for isAccelerated() if the image has a current and valid SurfaceDataProxy object cached for the specified GraphicsConfiguration parameter.
This class provides a default implementation of the ImageCapabilities that will try to determine if there is an associated SurfaceDataProxy object and if it is up to date, but only works for GraphicsConfiguration objects which implement the ProxiedGraphicsConfig interface defined below. In practice, all configs which can be accelerated are currently implementing that interface.
A null GraphicsConfiguration returns a value based on whether the image is currently accelerated on its default GraphicsConfiguration.
Returns the SurfaceManager object contained within the given Image.
Returns the main SurfaceData object that "owns" the pixels for this SurfaceManager. This SurfaceData is used as the destination surface in a rendering operation and is the most authoritative storage for the current state of the pixels, though other versions might be cached in other locations for efficiency.
Restores the primary surface being managed, and then returns the replacement surface. This is called when an accelerated surface has been "lost", in an attempt to auto-restore its contents.
Called when image's acceleration priority is changed.
The default implementation will visit all of the value objects in the cacheMap when the priority gets set to 0.0 and flush them if they implement the FlushableCacheData interface.
Store an arbitrary cached object for an arbitrary cache key. See the getCacheData() method for notes on tracking the validity of data stored using this mechanism.