| java.lang.Object sun.java2d.SurfaceData sun.java2d.opengl.OGLSurfaceData
OGLSurfaceData | abstract public class OGLSurfaceData extends SurfaceData (Code) | | This class describes an OpenGL "surface", that is, a region of pixels
managed via OpenGL. An OGLSurfaceData can be tagged with one of three
different SurfaceType objects for the purpose of registering loops, etc.
This diagram shows the hierarchy of OGL SurfaceTypes:
Any
/ \
OpenGLSurface OpenGLTexture
|
OpenGLSurfaceRTT
OpenGLSurface
This kind of surface can be rendered to using OpenGL APIs. It is also
possible to copy an OpenGLSurface to another OpenGLSurface (or to itself).
This is typically accomplished by calling MakeContextCurrent(dstSD, srcSD)
and then calling glCopyPixels() (although there are other techniques to
achieve the same goal).
OpenGLTexture
This kind of surface cannot be rendered to using OpenGL (in the same sense
as in OpenGLSurface). However, it is possible to upload a region of pixels
to an OpenGLTexture object via glTexSubImage2D(). One can also copy a
surface of type OpenGLTexture to an OpenGLSurface by binding the texture
to a quad and then rendering it to the destination surface (this process
is known as "texture mapping").
OpenGLSurfaceRTT
This kind of surface can be thought of as a sort of hybrid between
OpenGLSurface and OpenGLTexture, in that one can render to this kind of
surface as if it were of type OpenGLSurface, but the process of copying
this kind of surface to another is more like an OpenGLTexture. (Note that
"RTT" stands for "render-to-texture".)
In addition to these SurfaceType variants, we have also defined some
constants that describe in more detail the type of underlying OpenGL
surface. This table helps explain the relationships between those
"type" constants and their corresponding SurfaceType:
OGL Type Corresponding SurfaceType
-------- -------------------------
WINDOW OpenGLSurface
PBUFFER OpenGLSurface
TEXTURE OpenGLTexture
FLIP_BACKBUFFER OpenGLSurface
FBOBJECT OpenGLSurfaceRTT
|
Method Summary | |
public boolean | canRenderLCDText(SunGraphics2D sg2d) For now, we can only render LCD text if:
- the fragment shader extension is available, and
- blending is disabled, and
- the source color is opaque
Eventually, we could enhance the native OGL text rendering code
and remove the above restrictions, but that would require significantly
more code just to support a few uncommon cases. | public boolean | copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy) | static void | dispose(long pData, long pConfigInfo) Disposes the native resources associated with the given OGLSurfaceData
(referenced by the pData parameter). | public void | flush() | final OGLContext | getContext() Returns the OGLContext for the GraphicsConfig associated with this
surface. | protected MaskFill | getMaskFill(SunGraphics2D sg2d) | final OGLGraphicsConfig | getOGLGraphicsConfig() Returns the OGLGraphicsConfig associated with this surface. | public Raster | getRaster(int x, int y, int w, int h) | final int | getTextureTarget() If this surface is backed by a texture object, returns the target
for that texture (either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB). | final int | getType() Returns one of the surface type constants defined above. | native protected boolean | initFBObject(long pData, boolean isOpaque, boolean texNonPow2, boolean texRect, int width, int height) | native protected boolean | initFlipBackbuffer(long pData) | abstract protected boolean | initPbuffer(long pData, long pConfigInfo, boolean isOpaque, int width, int height) | protected void | initSurface(int width, int height) Initializes the appropriate OpenGL offscreen surface based on the value
of the type parameter. | native protected boolean | initTexture(long pData, boolean isOpaque, boolean texNonPow2, boolean texRect, int width, int height) | boolean | isTexNonPow2Available() Returns true if OpenGL textures can have non-power-of-two dimensions
when using the basic GL_TEXTURE_2D target. | boolean | isTexRectAvailable() Returns true if OpenGL textures can have non-power-of-two dimensions
when using the GL_TEXTURE_RECTANGLE_ARB target (only available when the
GL_ARB_texture_rectangle extension is present). | public SurfaceDataProxy | makeProxyFor(SurfaceData srcData) | static void | swapBuffers(long window) | public void | validatePipe(SunGraphics2D sg2d) |
FBOBJECT | final public static int FBOBJECT(Code) | | |
FLIP_BACKBUFFER | final public static int FLIP_BACKBUFFER(Code) | | |
PBUFFER | final public static int PBUFFER(Code) | | |
PF_BYTE_GRAY | final public static int PF_BYTE_GRAY(Code) | | |
PF_INT_ARGB | final public static int PF_INT_ARGB(Code) | | Pixel formats
|
PF_INT_ARGB_PRE | final public static int PF_INT_ARGB_PRE(Code) | | |
PF_INT_BGR | final public static int PF_INT_BGR(Code) | | |
PF_INT_BGRX | final public static int PF_INT_BGRX(Code) | | |
PF_INT_RGB | final public static int PF_INT_RGB(Code) | | |
PF_INT_RGBX | final public static int PF_INT_RGBX(Code) | | |
PF_USHORT_555_RGB | final public static int PF_USHORT_555_RGB(Code) | | |
PF_USHORT_555_RGBX | final public static int PF_USHORT_555_RGBX(Code) | | |
PF_USHORT_565_RGB | final public static int PF_USHORT_565_RGB(Code) | | |
PF_USHORT_GRAY | final public static int PF_USHORT_GRAY(Code) | | |
TEXTURE | final public static int TEXTURE(Code) | | |
UNDEFINED | final public static int UNDEFINED(Code) | | OGL-specific surface types
|
WINDOW | final public static int WINDOW(Code) | | |
canRenderLCDText | public boolean canRenderLCDText(SunGraphics2D sg2d)(Code) | | For now, we can only render LCD text if:
- the fragment shader extension is available, and
- blending is disabled, and
- the source color is opaque
Eventually, we could enhance the native OGL text rendering code
and remove the above restrictions, but that would require significantly
more code just to support a few uncommon cases.
|
copyArea | public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy)(Code) | | |
dispose | static void dispose(long pData, long pConfigInfo)(Code) | | Disposes the native resources associated with the given OGLSurfaceData
(referenced by the pData parameter). This method is invoked from
the native Dispose() method from the Disposer thread when the
Java-level OGLSurfaceData object is about to go away. Note that we
also pass a reference to the native GLX/WGLGraphicsConfigInfo
(pConfigInfo) for the purposes of making a context current.
|
flush | public void flush()(Code) | | |
getContext | final OGLContext getContext()(Code) | | Returns the OGLContext for the GraphicsConfig associated with this
surface.
|
getOGLGraphicsConfig | final OGLGraphicsConfig getOGLGraphicsConfig()(Code) | | Returns the OGLGraphicsConfig associated with this surface.
|
getRaster | public Raster getRaster(int x, int y, int w, int h)(Code) | | |
getTextureTarget | final int getTextureTarget()(Code) | | If this surface is backed by a texture object, returns the target
for that texture (either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB).
Otherwise, this method will return zero.
|
getType | final int getType()(Code) | | Returns one of the surface type constants defined above.
|
initFBObject | native protected boolean initFBObject(long pData, boolean isOpaque, boolean texNonPow2, boolean texRect, int width, int height)(Code) | | |
initFlipBackbuffer | native protected boolean initFlipBackbuffer(long pData)(Code) | | |
initPbuffer | abstract protected boolean initPbuffer(long pData, long pConfigInfo, boolean isOpaque, int width, int height)(Code) | | |
initSurface | protected void initSurface(int width, int height)(Code) | | Initializes the appropriate OpenGL offscreen surface based on the value
of the type parameter. If the surface creation fails for any reason,
an OutOfMemoryError will be thrown.
|
initTexture | native protected boolean initTexture(long pData, boolean isOpaque, boolean texNonPow2, boolean texRect, int width, int height)(Code) | | |
isTexNonPow2Available | boolean isTexNonPow2Available()(Code) | | Returns true if OpenGL textures can have non-power-of-two dimensions
when using the basic GL_TEXTURE_2D target.
|
isTexRectAvailable | boolean isTexRectAvailable()(Code) | | Returns true if OpenGL textures can have non-power-of-two dimensions
when using the GL_TEXTURE_RECTANGLE_ARB target (only available when the
GL_ARB_texture_rectangle extension is present).
|
swapBuffers | static void swapBuffers(long window)(Code) | | |
Methods inherited from sun.java2d.SurfaceData | public boolean canRenderLCDText(SunGraphics2D sg2d)(Code)(Java Doc) protected void checkCustomComposite()(Code)(Java Doc) public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy)(Code)(Java Doc) public void flush()(Code)(Java Doc) abstract public Rectangle getBounds()(Code)(Java Doc) final public ColorModel getColorModel()(Code)(Java Doc) abstract public Object getDestination()(Code)(Java Doc) abstract public GraphicsConfiguration getDeviceConfiguration()(Code)(Java Doc) public Object getDisposerReferent()(Code)(Java Doc) protected MaskFill getMaskFill(SunGraphics2D sg2d)(Code)(Java Doc) public long getNativeOps()(Code)(Java Doc) public static SurfaceData getPrimarySurfaceData(Image img)(Code)(Java Doc) abstract public Raster getRaster(int x, int y, int w, int h)(Code)(Java Doc) public RenderLoops getRenderLoops(SunGraphics2D sg2d)(Code)(Java Doc) abstract public SurfaceData getReplacement()(Code)(Java Doc) public SurfaceData getSourceSurfaceData(Image img, int txtype, CompositeType comp, Color bgColor)(Code)(Java Doc) public State getState()(Code)(Java Doc) public StateTracker getStateTracker()(Code)(Java Doc) final public SurfaceType getSurfaceType()(Code)(Java Doc) public int getTransparency()(Code)(Java Doc) public void invalidate()(Code)(Java Doc) public static boolean isNull(SurfaceData sd)(Code)(Java Doc) native protected static boolean isOpaqueGray(IndexColorModel icm)(Code)(Java Doc) public boolean isSurfaceLost()(Code)(Java Doc) final public boolean isValid()(Code)(Java Doc) public SurfaceDataProxy makeProxyFor(SurfaceData srcData)(Code)(Java Doc) public static RenderLoops makeRenderLoops(SurfaceType src, CompositeType comp, SurfaceType dst)(Code)(Java Doc) final public void markDirty()(Code)(Java Doc) public int pixelFor(int rgb)(Code)(Java Doc) public int pixelFor(Color c)(Code)(Java Doc) public static SurfaceData restoreContents(Image img)(Code)(Java Doc) public int rgbFor(int pixel)(Code)(Java Doc) protected void setBlitProxyKey(Object key)(Code)(Java Doc) public void setSurfaceLost(boolean lost)(Code)(Java Doc) public boolean useTightBBoxes()(Code)(Java Doc) public void validatePipe(SunGraphics2D sg2d)(Code)(Java Doc)
|
|
|