APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.java2d

public abstract Class SurfaceData

extends Object
implements Transparency, DisposerTarget, StateTrackable, Surface
Class Inheritance
All Implemented Interfaces
sun.java2d.Surface, sun.java2d.StateTrackable, sun.java2d.DisposerTarget, java.awt.Transparency
Known Direct Subclasses
sun.java2d.opengl.OGLSurfaceData, sun.java2d.x11.XSurfaceData, sun.awt.image.BufImgSurfaceData, sun.font.ColorGlyphSurfaceData, sun.java2d.NullSurfaceData
Imports
java.awt.Color, .Rectangle, .Transparency, .GraphicsConfiguration, .Image, java.awt.image.ColorModel, .IndexColorModel, .Raster, sun.font.FontUtilities, sun.java2d.loops.RenderCache, .RenderLoops, .CompositeType, .SurfaceType, .MaskFill, .DrawLine, .FillRect, .DrawRect, .DrawPolygons, .DrawPath, .FillPath, .FillSpans, .FillParallelogram, .DrawParallelogram, .FontInfo, .DrawGlyphList, .DrawGlyphListAA, .DrawGlyphListLCD, .DrawGlyphListColor, sun.java2d.pipe.LoopPipe, .ShapeDrawPipe, .ParallelogramPipe, .CompositePipe, .GeneralCompositePipe, .SpanClipRenderer, .SpanShapeRenderer, .AAShapePipe, .AlphaPaintPipe, .AlphaColorPipe, .PixelToShapeConverter, .PixelToParallelogramConverter, .TextPipe, .TextRenderer, .AATextRenderer, .LCDTextRenderer, .SolidTextRenderer, .OutlineTextRenderer, .DrawImagePipe, .DrawImage, .LoopBasedPipe, sun.awt.SunHints, sun.awt.image.SurfaceManager

This class provides various pieces of information relevant to a particular drawing surface. The information obtained from this object describes the pixels of a particular instance of a drawing surface and can only be shared among the various graphics objects that target the same BufferedImage or the same screen Component.

Each SurfaceData object holds a StateTrackableDelegate object which tracks both changes to the content of the pixels of this surface and changes to the overall state of the pixels - such as becoming invalid or losing the surface. The delegate is marked "dirty" whenever the setSurfaceLost() or invalidate() methods are called and should also be marked "dirty" by the rendering pipelines whenever they modify the pixels of this SurfaceData.

If you get a StateTracker from a SurfaceData and it reports that it is still "current", then you can trust that the pixels have not changed and that the SurfaceData is still valid and has not lost its underlying storage (surfaceLost) since you retrieved the tracker.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
protected static final AAShapePipe
protected static final PixelToParallelogramConverter
protected static final AAShapePipe
protected static final PixelToParallelogramConverter
protected static final AAShapePipe
protected static final PixelToParallelogramConverter
protected static final AAShapePipe
protected static final PixelToParallelogramConverter
protected static final PixelToParallelogramConverter
protected static final AAShapePipe
protected static final PixelToParallelogramConverter
protected static final AAShapePipe
protected static final PixelToParallelogramConverter
public static final TextPipe
private SurfaceManager.ProxyCache
protected static final CompositePipe
protected static final TextPipe
protected static final CompositePipe
protected static final TextPipe
protected static final CompositePipe
protected static final TextPipe
private ColorModel
protected static final AlphaColorPipe
protected static final LoopPipe
protected static final TextPipe
protected static final PixelToParallelogramConverter
protected static final PixelToShapeConverter
protected static final CompositePipe
protected static final SpanShapeRenderer
protected static final TextPipe
protected static final PixelToShapeConverter
private Object
pack-priv int
pack-priv int
pack-priv int
protected static final DrawImagePipe
public static final TextPipe
pack-priv static final int
pack-priv static final int
pack-priv static final int
private static RenderCache
public static final TextPipe
protected static final CompositePipe
protected static final SpanShapeRenderer
protected static final TextPipe
protected static final PixelToShapeConverter
private long
public static final TextPipe
private StateTrackableDelegate
private boolean
private SurfaceType
private boolean

Constructor Summary

AccessConstructor and Description
protected
protected
protected
protected

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public static <T> T
convertTo(Class<T> surfaceDataClass, SurfaceData surfaceData)

Converts surfaceData to the particular subclass or throws InvalidPipeException

public boolean
copyArea(SunGraphics2D sg2d, int
the x coordinate of the area in device space
x
,
int
the y coordinate of the area in device space
y
,
int
the width of the area in device space
w
,
int
the height of the area in device space
h
,
int dx, int dy)

Performs a copyarea within this surface.

public void
flush()

Synchronously releases resources associated with this surface.

public abstract Rectangle
getBounds()

Returns the bounds of the destination surface.

public final ColorModel
getColorModel()

Return the ColorModel for the destination surface.

public double
getDefaultScaleX()

Returns default horizontal scale factor of the destination surface.

public double
getDefaultScaleY()

Returns default vertical scale factor of the destination surface.

public abstract Object
getDestination()

Returns destination associated with this SurfaceData.

public abstract GraphicsConfiguration
getDeviceConfiguration()

Return the GraphicsConfiguration object that describes this destination surface.

public Object
getDisposerReferent()

Implements sun.java2d.DisposerTarget.getDisposerReferent.

Returns an object which will be used as the referent in the ReferenceQueue

private static CompositeType
protected MaskFill
getMaskFill(SunGraphics2D sg2d)

Returns a MaskFill object that can be used on this destination with the source (paint) and composite types determined by the given SunGraphics2D, or null if no such MaskFill object can be located.

public long
private static SurfaceType
public static SurfaceData
getPrimarySurfaceData(Image img)

Extracts the SurfaceManager from the given Image, and then returns the SurfaceData object that would best be suited as the destination surface in some rendering operation.

public abstract Raster
getRaster(int x, int y, int w, int h)

Return a readable Raster which contains the pixels for the specified rectangular region of the destination surface.

public RenderLoops
getRenderLoops(SunGraphics2D sg2d)

Return a RenderLoops object containing all of the basic GraphicsPrimitive objects for rendering to the destination surface with the current attributes of the given SunGraphics2D.

public abstract SurfaceData
getReplacement()

Certain changes in the configuration of a surface require the invalidation of existing associated SurfaceData objects and the creation of brand new ones.

public SurfaceData
getSourceSurfaceData(Image img, int txtype, CompositeType comp, Color bgColor)

This method is called on a destination SurfaceData to choose the best SurfaceData from a source Image for an imaging operation, with help from its SurfaceManager.

public StateTrackable.State
getState()

Implements sun.java2d.StateTrackable.getState.

Returns the general state of the complex data held by this object.

public StateTracker
getStateTracker()

Implements sun.java2d.StateTrackable.getStateTracker.

Returns an object which can track future changes to the complex data stored in this object.

public final SurfaceType
getSurfaceType()

Return the SurfaceType object that describes the destination surface.

private TextPipe
getTextPipe(SunGraphics2D sg2d, boolean aaHintIsOn)

public int

Returns:

the field type of this Transparency, which is either OPAQUE, BITMASK or TRANSLUCENT.
getTransparency
()

Implements java.awt.Transparency.getTransparency.

Returns the type of this Transparency.

private static native void
public void
invalidate()

Sets this SurfaceData object to the invalid state.

public static boolean
isNull(SurfaceData sd)

For our purposes null and NullSurfaceData are the same as they represent a disposed surface.

protected static native boolean
isOpaqueGray(IndexColorModel icm)

Fetches private field IndexColorModel.allgrayopaque which is true when all palette entries in the color model are gray and opaque.

public boolean
public final boolean
isValid()

Returns a boolean indicating whether or not this SurfaceData is valid.

private static PixelToParallelogramConverter
private static PixelToParallelogramConverter
public SurfaceDataProxy
makeProxyFor(SurfaceData srcData)

This method is called on a destination SurfaceData to choose a proper SurfaceDataProxy subclass for a source SurfaceData to use to control when and with what surface to override a given image operation.

public static RenderLoops
makeRenderLoops(SurfaceType src, CompositeType comp, SurfaceType dst)

Construct and return a RenderLoops object containing all of the basic GraphicsPrimitive objects for rendering to the destination surface with the given source, destination, and composite types.

public final void
markDirty()

Marks this surface as dirty.

public int
pixelFor(int rgb)

Returns the pixel data for the specified Argb value packed into an integer for easy storage and conveyance.

public int
pixelFor(Color c)

Returns the pixel data for the specified color packed into an integer for easy storage and conveyance.

public static SurfaceData
restoreContents(Image img)

Restores the contents of the given Image and then returns the new SurfaceData object in use by the Image's SurfaceManager.

public int
rgbFor(int pixel)

Returns the Argb representation for the specified integer value which is packed in the format of the associated ColorModel.

protected void
setBlitProxyCache(SurfaceManager.ProxyCache cache)

Subclasses can set a "blit proxy cache" which will be used along with the SurfaceManager to store acceleration-compatible cached copies of source images.

public void
setSurfaceLost(boolean lost)

Sets the value of the surfaceLost variable, which indicates whether something has happened to the rendering surface such that it needs to be restored and re-rendered.

public boolean
useTightBBoxes()

Does the pixel accessibility of the destination surface suggest that rendering algorithms might want to take extra time to calculate a more accurate bounding box for the operation being performed?

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AAClipColorShapeback to summary
protected static final AAShapePipe AAClipColorShape
AAClipColorViaShapeback to summary
protected static final PixelToParallelogramConverter AAClipColorViaShape
AAClipCompShapeback to summary
protected static final AAShapePipe AAClipCompShape
AAClipCompViaShapeback to summary
protected static final PixelToParallelogramConverter AAClipCompViaShape
AAClipPaintShapeback to summary
protected static final AAShapePipe AAClipPaintShape
AAClipPaintViaShapeback to summary
protected static final PixelToParallelogramConverter AAClipPaintViaShape
AAColorShapeback to summary
protected static final AAShapePipe AAColorShape
AAColorViaPgramback to summary
protected static final PixelToParallelogramConverter AAColorViaPgram
AAColorViaShapeback to summary
protected static final PixelToParallelogramConverter AAColorViaShape
AACompShapeback to summary
protected static final AAShapePipe AACompShape
AACompViaShapeback to summary
protected static final PixelToParallelogramConverter AACompViaShape
AAPaintShapeback to summary
protected static final AAShapePipe AAPaintShape
AAPaintViaShapeback to summary
protected static final PixelToParallelogramConverter AAPaintViaShape
aaTextRendererback to summary
public static final TextPipe aaTextRenderer
blitProxyCacheback to summary
private SurfaceManager.ProxyCache blitProxyCache
clipColorPipeback to summary
protected static final CompositePipe clipColorPipe
clipColorTextback to summary
protected static final TextPipe clipColorText
clipCompPipeback to summary
protected static final CompositePipe clipCompPipe
clipCompTextback to summary
protected static final TextPipe clipCompText
clipPaintPipeback to summary
protected static final CompositePipe clipPaintPipe
clipPaintTextback to summary
protected static final TextPipe clipPaintText
colorModelback to summary
private ColorModel colorModel
colorPipeback to summary
protected static final AlphaColorPipe colorPipe
colorPrimitivesback to summary
protected static final LoopPipe colorPrimitives
colorTextback to summary
protected static final TextPipe colorText
colorViaPgramback to summary
protected static final PixelToParallelogramConverter colorViaPgram
colorViaShapeback to summary
protected static final PixelToShapeConverter colorViaShape
compPipeback to summary
protected static final CompositePipe compPipe
compShapeback to summary
protected static final SpanShapeRenderer compShape
compTextback to summary
protected static final TextPipe compText
compViaShapeback to summary
protected static final PixelToShapeConverter compViaShape
disposerReferentback to summary
private Object disposerReferent
haveLCDLoopback to summary
pack-priv int haveLCDLoop
havePgramSolidLoopback to summary
pack-priv int havePgramSolidLoop
havePgramXORLoopback to summary
pack-priv int havePgramXORLoop
imagepipeback to summary
protected static final DrawImagePipe imagepipe
lcdTextRendererback to summary
public static final TextPipe lcdTextRenderer
LOOP_FOUNDback to summary
pack-priv static final int LOOP_FOUND
LOOP_NOTFOUNDback to summary
pack-priv static final int LOOP_NOTFOUND
LOOP_UNKNOWNback to summary
pack-priv static final int LOOP_UNKNOWN
loopcacheback to summary
private static RenderCache loopcache
outlineTextRendererback to summary
public static final TextPipe outlineTextRenderer
paintPipeback to summary
protected static final CompositePipe paintPipe
paintShapeback to summary
protected static final SpanShapeRenderer paintShape
paintTextback to summary
protected static final TextPipe paintText
paintViaShapeback to summary
protected static final PixelToShapeConverter paintViaShape
pDataback to summary
private long pData
solidTextRendererback to summary
public static final TextPipe solidTextRenderer
stateDelegateback to summary
private StateTrackableDelegate stateDelegate
surfaceLostback to summary
private boolean surfaceLost
surfaceTypeback to summary
private SurfaceType surfaceType
validback to summary
private boolean valid

Constructor Detail

SurfaceDataback to summary
protected SurfaceData(SurfaceType surfaceType, ColorModel cm)
SurfaceDataback to summary
protected SurfaceData(StateTrackable.State state, SurfaceType surfaceType, ColorModel cm)
SurfaceDataback to summary
protected SurfaceData(StateTrackableDelegate trackable, SurfaceType surfaceType, ColorModel cm)
SurfaceDataback to summary
protected SurfaceData(StateTrackable.State state)

Method Detail

canRenderLCDTextback to summary
public boolean canRenderLCDText(SunGraphics2D sg2d)
canRenderParallelogramsback to summary
public boolean canRenderParallelograms(SunGraphics2D sg2d)
convertToback to summary
public static <T> T convertTo(Class<T> surfaceDataClass, SurfaceData surfaceData)

Converts surfaceData to the particular subclass or throws InvalidPipeException

copyAreaback to summary
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy)

Performs a copyarea within this surface. Returns false if there is no algorithm to perform the copyarea given the current settings of the SunGraphics2D.

Parameters
x:int

the x coordinate of the area in device space

y:int

the y coordinate of the area in device space

w:int

the width of the area in device space

h:int

the height of the area in device space

flushback to summary
public void flush()

Synchronously releases resources associated with this surface.

getBoundsback to summary
public abstract Rectangle getBounds()

Returns the bounds of the destination surface.

getColorModelback to summary
public final ColorModel getColorModel()

Return the ColorModel for the destination surface.

getDefaultScaleXback to summary
public double getDefaultScaleX()

Returns default horizontal scale factor of the destination surface. Scale factor describes the mapping between virtual and physical coordinates of the SurfaceData. If the scale is 2 then virtual pixel coordinates need to be doubled for physical pixels.

getDefaultScaleYback to summary
public double getDefaultScaleY()

Returns default vertical scale factor of the destination surface. Scale factor describes the mapping between virtual and physical coordinates of the SurfaceData. If the scale is 2 then virtual pixel coordinates need to be doubled for physical pixels.

getDestinationback to summary
public abstract Object getDestination()

Returns destination associated with this SurfaceData. This could be either an Image or a Component; subclasses of SurfaceData are responsible for returning the appropriate object.

getDeviceConfigurationback to summary
public abstract GraphicsConfiguration getDeviceConfiguration()

Return the GraphicsConfiguration object that describes this destination surface.

getDisposerReferentback to summary
public Object getDisposerReferent()

Implements sun.java2d.DisposerTarget.getDisposerReferent.

Doc from sun.java2d.DisposerTarget.getDisposerReferent.

Returns an object which will be used as the referent in the ReferenceQueue

getFillCompositeTypeback to summary
private static CompositeType getFillCompositeType(SunGraphics2D sg2d)
getMaskFillback to summary
protected MaskFill getMaskFill(SunGraphics2D sg2d)

Returns a MaskFill object that can be used on this destination with the source (paint) and composite types determined by the given SunGraphics2D, or null if no such MaskFill object can be located. Subclasses can override this method if they wish to filter other attributes (such as the hardware capabilities of the destination surface) before returning a specific MaskFill object.

getNativeOpsback to summary
public long getNativeOps()
getPaintSurfaceTypeback to summary
private static SurfaceType getPaintSurfaceType(SunGraphics2D sg2d)
getPrimarySurfaceDataback to summary
public static SurfaceData getPrimarySurfaceData(Image img)

Extracts the SurfaceManager from the given Image, and then returns the SurfaceData object that would best be suited as the destination surface in some rendering operation.

getRasterback to summary
public abstract Raster getRaster(int x, int y, int w, int h)

Return a readable Raster which contains the pixels for the specified rectangular region of the destination surface. The coordinate origin of the returned Raster is the same as the device space origin of the destination surface. In some cases the returned Raster might also be writeable. In most cases, the returned Raster might contain more pixels than requested.

See Also
useTightBBoxes
getRenderLoopsback to summary
public RenderLoops getRenderLoops(SunGraphics2D sg2d)

Return a RenderLoops object containing all of the basic GraphicsPrimitive objects for rendering to the destination surface with the current attributes of the given SunGraphics2D.

getReplacementback to summary
public abstract SurfaceData getReplacement()

Certain changes in the configuration of a surface require the invalidation of existing associated SurfaceData objects and the creation of brand new ones. These changes include size, ColorModel, or SurfaceType. Existing Graphics objects which are directed at such surfaces, however, must continue to render to them even after the change occurs underneath the covers. The getReplacement() method is called from SunGraphics2D.revalidateAll() when the associated SurfaceData is found to be invalid so that a Graphics object can continue to render to the surface in its new configuration. Such changes only tend to happen to window based surfaces since most image based surfaces never change size or pixel format. Even VolatileImage objects never change size and they only change their pixel format when manually validated against a new GraphicsConfiguration, at which point old Graphics objects are no longer expected to render to them after the validation step. Thus, only window based surfaces really need to deal with this form of replacement.

getSourceSurfaceDataback to summary
public SurfaceData getSourceSurfaceData(Image img, int txtype, CompositeType comp, Color bgColor)

This method is called on a destination SurfaceData to choose the best SurfaceData from a source Image for an imaging operation, with help from its SurfaceManager. The method may determine that the default SurfaceData was really the best choice in the first place, or it may decide to use a cached surface. Some general decisions about whether acceleration is enabled are made by this method, but any decision based on the type of the source image is made in the makeProxyFor method below when it comes up with the appropriate SurfaceDataProxy instance. The parameters describe the type of imaging operation being performed.

If a blitProxyCache was supplied by the subclass then it is used to potentially override the choice of source SurfaceData. The outline of this process is:

  1. Image pipeline asks destSD to find an appropriate srcSD for a given source Image object.
  2. destSD gets the SurfaceManager of the source Image and first retrieves the default SD from it using getPrimarySurfaceData()
  3. destSD uses its "blit proxy cache" (if set) to look for some cached data corresponding to the the source SurfaceManager
  4. If the cached data is null then makeProxyFor() is used to create some cached data which is stored back in the source SurfaceManager under the same key for future uses.
  5. The cached data will be a SurfaceDataProxy object.
  6. The SurfaceDataProxy object is then consulted to return a replacement SurfaceData object (typically a cached copy if appropriate, or the original if not).
getStateback to summary
public StateTrackable.State getState()

Implements sun.java2d.StateTrackable.getState.

Doc from sun.java2d.StateTrackable.getState.

Returns the general state of the complex data held by this object. This return value can be used to determine if it makes strategic sense to try and cache information about the current contents of this object. The StateTracker returned from the getStateTracker() method will further aid in determining when the data has been changed so that the caches can be verified upon future uses.

getStateTrackerback to summary
public StateTracker getStateTracker()

Implements sun.java2d.StateTrackable.getStateTracker.

Doc from sun.java2d.StateTrackable.getStateTracker.

Returns an object which can track future changes to the complex data stored in this object. If an external agent caches information about the complex data of this object, it should first get a StateTracker object from this method so that it can check if such information is current upon future uses. Note that a valid StateTracker will always be returned regardless of the return value of getState(), but in some cases the StateTracker may be a trivial implementation which always returns the same value from its isCurrent method.

  • If the current state is IMMUTABLE, this StateTracker and any future StateTracker objects returned from this method will always indicate that the state has not changed.
  • If the current state is UNTRACKABLE, this StateTracker and any future StateTracker objects returned from this method will always indicate that the state has changed.
  • If the current state is DYNAMIC, this StateTracker may always indicate that the current state has changed, but another StateTracker returned from this method in the future when the state has changed to STABLE will correctly track changes.
  • Otherwise the current state is STABLE and this StateTracker will indicate whether or not the data has changed since the time at which it was fetched from the object.
getSurfaceTypeback to summary
public final SurfaceType getSurfaceType()

Return the SurfaceType object that describes the destination surface.

getTextPipeback to summary
private TextPipe getTextPipe(SunGraphics2D sg2d, boolean aaHintIsOn)
getTransparencyback to summary
public int getTransparency()

Implements java.awt.Transparency.getTransparency.

Returns the type of this Transparency.

Returns:int

the field type of this Transparency, which is either OPAQUE, BITMASK or TRANSLUCENT.

initIDsback to summary
private static native void initIDs()
invalidateback to summary
public void invalidate()

Sets this SurfaceData object to the invalid state. All Graphics objects must get a new SurfaceData object via the refresh method and revalidate their pipelines before continuing.

isNullback to summary
public static boolean isNull(SurfaceData sd)

For our purposes null and NullSurfaceData are the same as they represent a disposed surface.

isOpaqueGrayback to summary
protected static native boolean isOpaqueGray(IndexColorModel icm)

Fetches private field IndexColorModel.allgrayopaque which is true when all palette entries in the color model are gray and opaque.

isSurfaceLostback to summary
public boolean isSurfaceLost()
isValidback to summary
public final boolean isValid()

Returns a boolean indicating whether or not this SurfaceData is valid.

makeConverterback to summary
private static PixelToParallelogramConverter makeConverter(AAShapePipe renderer, ParallelogramPipe pgrampipe)
makeConverterback to summary
private static PixelToParallelogramConverter makeConverter(AAShapePipe renderer)
makeProxyForback to summary
public SurfaceDataProxy makeProxyFor(SurfaceData srcData)

This method is called on a destination SurfaceData to choose a proper SurfaceDataProxy subclass for a source SurfaceData to use to control when and with what surface to override a given image operation. The argument is the default SurfaceData for the source Image.

The type of the return object is chosen based on the acceleration capabilities of this SurfaceData and the type of the given source SurfaceData object.

In some cases the original SurfaceData will always be the best choice to use to blit to this SurfaceData. This can happen if the source image is a hardware surface of the same type as this one and so acceleration will happen without any caching. It may also be the case that the source image can never be accelerated on this SurfaceData - for example because it is translucent and there are no accelerated translucent image ops for this surface.

In those cases there is a special SurfaceDataProxy.UNCACHED instance that represents a NOP for caching purposes - it always returns the original sourceSD object as the replacement copy so no caching is ever performed.

makeRenderLoopsback to summary
public static RenderLoops makeRenderLoops(SurfaceType src, CompositeType comp, SurfaceType dst)

Construct and return a RenderLoops object containing all of the basic GraphicsPrimitive objects for rendering to the destination surface with the given source, destination, and composite types.

markDirtyback to summary
public final void markDirty()

Marks this surface as dirty.

pixelForback to summary
public int pixelFor(int rgb)

Returns the pixel data for the specified Argb value packed into an integer for easy storage and conveyance.

pixelForback to summary
public int pixelFor(Color c)

Returns the pixel data for the specified color packed into an integer for easy storage and conveyance. This method will use the getRGB() method of the Color object and defer to the pixelFor(int rgb) method if not overridden. For now this is a convenience function, but for cases where the highest quality color conversion is requested, this method should be overridden in those cases so that a more direct conversion of the color to the destination color space can be done using the additional information in the Color object.

restoreContentsback to summary
public static SurfaceData restoreContents(Image img)

Restores the contents of the given Image and then returns the new SurfaceData object in use by the Image's SurfaceManager.

rgbForback to summary
public int rgbFor(int pixel)

Returns the Argb representation for the specified integer value which is packed in the format of the associated ColorModel.

setBlitProxyCacheback to summary
protected void setBlitProxyCache(SurfaceManager.ProxyCache cache)

Subclasses can set a "blit proxy cache" which will be used along with the SurfaceManager to store acceleration-compatible cached copies of source images. The getSourceSurfaceData() method uses this cache to manage copies of a source image as described below.

The cache used should be as unique as it needs to be to ensure that multiple acceleratible destinations can each store their cached copies separately into different caches without interfering with each other or getting back the wrong cached copy.

Many GraphicsConfiguration implementations have their own cache as the GC object is typically unique to a given screen and pixel format, but other rendering destinations may have more or less stringent sharing requirements. For instance, X11 pixmaps can be shared on a given screen by any GraphicsConfiguration that has the same depth and SurfaceType. Multiple such GCs with the same depth and SurfaceType can exist per screen so storing a different cached proxy for each would be a waste. One can imagine platforms where a single cached copy can be created and shared across all screens and pixel formats - such implementations could use a single heavily shared cache object.

setSurfaceLostback to summary
public void setSurfaceLost(boolean lost)

Sets the value of the surfaceLost variable, which indicates whether something has happened to the rendering surface such that it needs to be restored and re-rendered.

useTightBBoxesback to summary
public boolean useTightBBoxes()

Does the pixel accessibility of the destination surface suggest that rendering algorithms might want to take extra time to calculate a more accurate bounding box for the operation being performed? The typical case when this will be true is when a copy of the pixels has to be made when doing a getRaster. The fewer pixels copied, the faster the operation will go.

See Also
getRaster
validatePipeback to summary
public void validatePipe(SunGraphics2D sg2d)
sun.java2d back to summary

pack-priv Class SurfaceData.PixelToPgramLoopConverter

extends PixelToParallelogramConverter
implements LoopBasedPipe
Class Inheritance
All Implemented Interfaces
sun.java2d.pipe.LoopBasedPipe

Constructor Summary

AccessConstructor and Description
public
PixelToPgramLoopConverter(ShapeDrawPipe shapepipe, ParallelogramPipe pgrampipe, double minPenSize, double normPosition, boolean adjustfill)

Method Summary

Inherited from sun.java2d.pipe.PixelToParallelogramConverter:
drawdrawGeneralLinedrawLinedrawRectdrawRectanglefillfillOuterParallelogramfillRectfillRectangle

Constructor Detail

PixelToPgramLoopConverterback to summary
public PixelToPgramLoopConverter(ShapeDrawPipe shapepipe, ParallelogramPipe pgrampipe, double minPenSize, double normPosition, boolean adjustfill)
sun.java2d back to summary

pack-priv Class SurfaceData.PixelToShapeLoopConverter

extends PixelToShapeConverter
implements LoopBasedPipe
Class Inheritance
All Implemented Interfaces
sun.java2d.pipe.LoopBasedPipe

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from sun.java2d.pipe.PixelToShapeConverter:
drawArcdrawLinedrawOvaldrawPolygondrawPolylinedrawRectdrawRoundRectfillArcfillOvalfillPolygonfillRectfillRoundRect

Constructor Detail

PixelToShapeLoopConverterback to summary
public PixelToShapeLoopConverter(ShapeDrawPipe pipe)