/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef OGLContext_h_Included
#define OGLContext_h_Included
#include "sun_java2d_pipe_BufferedContext.h"
#include "sun_java2d_opengl_OGLContext.h"
#include "j2d_md.h"
#include "OGLSurfaceData.h"
/**
* The OGLBlendRule structure encapsulates the two enumerated values that
* comprise a given Porter-Duff blending (compositing) rule. For example,
* the "SrcOver" rule can be represented by:
* rule.src = GL_ONE;
* rule.dst = GL_ONE_MINUS_SRC_ALPHA;
*
* GLenum src;
* The constant representing the source factor in this Porter-Duff rule.
*
* GLenum dst;
* The constant representing the destination factor in this Porter-Duff rule.
*/
typedef struct {
} OGLBlendRule;
/**
* The OGLContext structure contains cached state relevant to the native
* OpenGL context stored within the native ctxInfo field. Each Java-level
* OGLContext object is associated with a native-level OGLContext structure.
* The caps field is a bitfield that expresses the capabilities of the
* GraphicsConfig associated with this context (see OGLContext.java for
* the definitions of each capability bit). The other fields are
* simply cached values of various elements of the context state, typically
* used in the OGLContext.set*() methods.
*
* Note that the textureFunction field is implicitly set to zero when the
* OGLContext is created. The acceptable values (e.g. GL_MODULATE,
* GL_REPLACE) for this field are never zero, which means we will always
* validate the texture function state upon the first call to the
* OGLC_UPDATE_TEXTURE_FUNCTION() macro.
*/
typedef struct {
void *ctxInfo;
jubyte r;
jubyte g;
jubyte b;
jubyte a;
} OGLContext;
/**
* See BufferedContext.java for more on these flags...
*/
#define OGLC_NO_CONTEXT_FLAGS \
#define OGLC_SRC_IS_OPAQUE \
#define OGLC_USE_MASK \
/**
* See OGLContext.java for more on these flags.
*/
#define CAPS_EMPTY \
#define CAPS_RT_PLAIN_ALPHA \
#define CAPS_RT_TEXTURE_ALPHA \
#define CAPS_RT_TEXTURE_OPAQUE \
#define CAPS_MULTITEXTURE \
#define CAPS_TEXNONPOW2 \
#define CAPS_TEXNONSQUARE \
#define CAPS_PS20 \
#define CAPS_PS30 \
#define LAST_SHARED_CAP \
#define CAPS_EXT_FBOBJECT \
#define CAPS_STORED_ALPHA \
#define CAPS_DOUBLEBUFFERED \
#define CAPS_EXT_LCD_SHADER \
#define CAPS_EXT_BIOP_SHADER \
#define CAPS_EXT_GRAD_SHADER \
#define CAPS_EXT_TEXRECT \
/**
* Evaluates to true if the given capability bitmask is present for the
* given OGLContext. Note that only the constant name needs to be passed as
* a parameter, as this macro will automatically prepend the full package
* and class name to the constant name.
*/
/**
* At startup we will embed one of the following values in the caps field
* of OGLContext. Later we can use this information to select
* the codepath that offers the best performance for that vendor's
*/
#define OGLC_VENDOR_OTHER 0
/**
* This constant determines the size of the shared tile texture used
* by a number of image rendering methods. For example, the blit tile texture
* will have dimensions with width OGLC_BLIT_TILE_SIZE and height
* OGLC_BLIT_TILE_SIZE (the tile will always be square).
*/
/**
* Helper macros that update the current texture function state only when
* it needs to be changed, which helps reduce overhead for small texturing
* operations. The filter state is set on a per-context (not per-texture)
* basis; for example, if we apply one texture using GL_MODULATE followed by
* another texture using GL_MODULATE (under the same context), there is no
* need to set the texture function the second time, as that would be
* redundant.
*/
do { \
} while (0)
do { \
} \
} while (0)
/**
* Exported methods.
*/
#endif /* OGLContext_h_Included */