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.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | SurfaceManager.
An interface for GraphicsConfiguration objects to implement if they create their own VolatileSurfaceManager implementations. |
| public static interface | SurfaceManager.
An interface for Objects used in the SurfaceManager cache to implement if they have data that should be flushed when the Image is flushed. |
| public abstract static class | |
| pack-priv class | |
| public static interface | SurfaceManager.
An interface for GraphicsConfiguration objects to implement if their surfaces accelerate images using SurfaceDataProxy objects. |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private static SurfaceManager. | |
| private final Map | weakCache
This map holds references to SurfaceDataProxy per given ProxyCache. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | acceleratedSurfaceLost()
Notification that any accelerated surfaces associated with this manager have been "lost", which might mean that they need to be manually restored or recreated. |
| public synchronized void | flush()
Releases system resources in use by ancillary SurfaceData objects, such as surfaces cached in accelerated memory. |
| pack-priv void | |
| public ImageCapabilities | getCapabilities(GraphicsConfiguration gc)
Returns an ImageCapabilities object which can be inquired as to the specific capabilities of this Image. |
| public static double | |
| public static double | |
| public static SurfaceManager | |
| public abstract SurfaceData | getPrimarySurfaceData()
Returns the main SurfaceData object that "owns" the pixels for this SurfaceManager. |
| public abstract SurfaceData | restoreContents()
Restores the primary surface being managed, and then returns the replacement surface. |
| public void | |
| public static void | |
| public static void |
| imgaccessor | back to summary |
|---|---|
| private static SurfaceManager. | |
| weakCache | back to summary |
|---|---|
| private final Map<SurfaceManager. This map holds references to SurfaceDataProxy per given ProxyCache. Unlike ProxyCache, which contains SurfaceDataProxy objects per given SurfaceManager, this map does not prevent contained proxies from being garbage collected. Therefore, ProxyCache can be considered an "owning" container for the SurfaceDataProxy objects, and this map is just a weak mapping for the bookkeeping purposes. | |
| SurfaceManager | back to summary |
|---|---|
| public SurfaceManager() | |
| acceleratedSurfaceLost | back to summary |
|---|---|
| public void acceleratedSurfaceLost() 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. | |
| flush | back to summary |
|---|---|
| public synchronized void flush() 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. | |
| flush | back to summary |
|---|---|
| pack-priv void flush(boolean deaccelerate) | |
| getCapabilities | back to summary |
|---|---|
| public ImageCapabilities getCapabilities(GraphicsConfiguration gc) 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.
| |
| getImageScaleX | back to summary |
|---|---|
| public static double getImageScaleX(final Image img) Returns a horizontal scale factor of the image. This is utility method, which fetches information from the SurfaceData of the image.
| |
| getImageScaleY | back to summary |
|---|---|
| public static double getImageScaleY(final Image img) Returns a vertical scale factor of the image. This is utility method, which fetches information from the SurfaceData of the image.
| |
| getManager | back to summary |
|---|---|
| public static SurfaceManager getManager(Image img) Returns the SurfaceManager object contained within the given Image. | |
| getPrimarySurfaceData | back to summary |
|---|---|
| public abstract SurfaceData getPrimarySurfaceData() 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. | |
| restoreContents | back to summary |
|---|---|
| public abstract SurfaceData restoreContents() 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. | |
| setAccelerationPriority | back to summary |
|---|---|
| public void setAccelerationPriority(float priority) 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. | |
| setImageAccessor | back to summary |
|---|---|
| public static void setImageAccessor(SurfaceManager. | |
| setManager | back to summary |
|---|---|
| public static void setManager(Image img, SurfaceManager mgr) | |
| Modifier and Type | Method and Description |
|---|---|
| public VolatileSurfaceManager | createVolatileManager(SunVolatileImage image, Object context)
Creates a new instance of a VolatileSurfaceManager given a compatible SunVolatileImage. |
| createVolatileManager | back to summary |
|---|---|
| public VolatileSurfaceManager createVolatileManager(SunVolatileImage image, Object context) Creates a new instance of a VolatileSurfaceManager given a compatible SunVolatileImage. An optional context Object can be supplied as a way for the caller to pass pipeline-specific context data to the VolatileSurfaceManager (such as a backbuffer handle, for example). | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| flush | back to summary |
|---|---|
| public boolean flush(boolean deaccelerated) Flush all cached resources. The deaccelerated parameter indicates if the flush is happening because the associated surface is no longer being accelerated (for instance the acceleration priority is set below the threshold needed for acceleration). Returns a boolean that indicates if the cached object is no longer needed and should be removed from the cache. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract SurfaceManager | |
| public abstract void |
| ImageAccessor | back to summary |
|---|---|
| public ImageAccessor() | |
| getSurfaceManager | back to summary |
|---|---|
| public abstract SurfaceManager getSurfaceManager(Image img) | |
| setSurfaceManager | back to summary |
|---|---|
| public abstract void setSurfaceManager(Image img, SurfaceManager mgr) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv GraphicsConfiguration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isAccelerated()
Overrides java. Returns |
| gc | back to summary |
|---|---|
| pack-priv GraphicsConfiguration gc | |
| ImageCapabilitiesGc | back to summary |
|---|---|
| public ImageCapabilitiesGc(GraphicsConfiguration gc) | |
| isAccelerated | back to summary |
|---|---|
| public boolean isAccelerated() Overrides java. Doc from java. Returns | |
| Modifier and Type | Method and Description |
|---|---|
| public SurfaceManager. | getSurfaceDataProxyCache()
Return the cache that destination surfaces created on the given GraphicsConfiguration use to store SurfaceDataProxy objects for their cached copies. |
| getSurfaceDataProxyCache | back to summary |
|---|---|
| public SurfaceManager. Return the cache that destination surfaces created on the given GraphicsConfiguration use to store SurfaceDataProxy objects for their cached copies. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public SurfaceDataProxy | |
| public void | put(SurfaceManager manager, SurfaceDataProxy proxy)
Store a cached SurfaceDataProxy object for a given SurfaceManager. |
| map | back to summary |
|---|---|
| private final Map<SurfaceManager, SurfaceDataProxy> map | |
| ProxyCache | back to summary |
|---|---|
| public ProxyCache() | |
| get | back to summary |
|---|---|
| public SurfaceDataProxy get(SurfaceManager manager) Return a cached SurfaceDataProxy object for a given SurfaceManager. 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. | |
| put | back to summary |
|---|---|
| public void put(SurfaceManager manager, SurfaceDataProxy proxy) Store a cached SurfaceDataProxy object for a given SurfaceManager. See the get() method for notes on tracking the validity of data stored using this mechanism. | |