0N/A/*
3261N/A * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#ifndef GraphicsPrimitiveMgr_h_Included
0N/A#define GraphicsPrimitiveMgr_h_Included
0N/A
0N/A#ifdef __cplusplus
0N/Aextern "C" {
0N/A#endif
0N/A
0N/A#include "java_awt_AlphaComposite.h"
0N/A
0N/A#include "SurfaceData.h"
0N/A#include "SpanIterator.h"
0N/A
0N/A#include "j2d_md.h"
0N/A
0N/A#include "AlphaMath.h"
0N/A#include "GlyphImageRef.h"
0N/A
0N/A/*
0N/A * This structure contains all of the information about a particular
0N/A * type of GraphicsPrimitive, such as a FillRect, a MaskFill, or a Blit.
0N/A *
0N/A * A global collection of these structures is declared and initialized
0N/A * to contain the necessary Java (JNI) information so that appropriate
0N/A * Java GraphicsPrimitive objects can be quickly constructed for a set
0N/A * of native loops simply by referencing the necessary entry from that
0N/A * collection for the type of primitive being registered.
0N/A *
0N/A * See PrimitiveTypes.{Blit,BlitBg,FillRect,...} below.
0N/A */
0N/Atypedef struct _PrimitiveType {
0N/A char *ClassName;
0N/A jint srcflags;
0N/A jint dstflags;
0N/A jclass ClassObject;
0N/A jmethodID Constructor;
0N/A} PrimitiveType;
0N/A
0N/A/* The integer constants to identify the compositing rule being defined. */
0N/A#define RULE_Xor (java_awt_AlphaComposite_MIN_RULE - 1)
0N/A#define RULE_Clear java_awt_AlphaComposite_CLEAR
0N/A#define RULE_Src java_awt_AlphaComposite_SRC
0N/A#define RULE_SrcOver java_awt_AlphaComposite_SRC_OVER
0N/A#define RULE_DstOver java_awt_AlphaComposite_DST_OVER
0N/A#define RULE_SrcIn java_awt_AlphaComposite_SRC_IN
0N/A#define RULE_DstIn java_awt_AlphaComposite_DST_IN
0N/A#define RULE_SrcOut java_awt_AlphaComposite_SRC_OUT
0N/A#define RULE_DstOut java_awt_AlphaComposite_DST_OUT
0N/A
0N/A/*
0N/A * This structure holds the information retrieved from a Java
0N/A * Composite object for easy transfer to various C functions
0N/A * that implement the inner loop for a native primitive.
0N/A *
0N/A * Currently only AlphaComposite and XORComposite are supported.
0N/A */
0N/Atypedef struct _CompositeInfo {
0N/A jint rule; /* See RULE_* constants above */
0N/A union {
0N/A jfloat extraAlpha; /* from AlphaComposite */
0N/A jint xorPixel; /* from XORComposite */
0N/A } details;
0N/A juint alphaMask; /* from XORComposite */
0N/A} CompositeInfo;
0N/A
0N/A/*
0N/A * This structure is the common header for the two native structures
0N/A * that hold information about a particular SurfaceType or CompositeType.
0N/A *
0N/A * A global collection of these structures is declared and initialized
0N/A * to contain the necessary Java (JNI) information so that appropriate
0N/A * Java GraphicsPrimitive objects can be quickly constructed for a set
0N/A * of native loops simply by referencing the necessary entry from that
0N/A * collection for the type of composite or surface being implemented.
0N/A *
0N/A * See SurfaceTypes.{OpaqueColor,IntArgb,ByteGray,...} below.
0N/A * See CompositeTypes.{Xor,AnyAlpha,...} below.
0N/A */
0N/Atypedef struct _SurfCompHdr {
0N/A char *Name;
0N/A jobject Object;
0N/A} SurfCompHdr;
0N/A
0N/A/*
0N/A * The definitions for the SurfaceType structure described above.
0N/A */
0N/A
0N/A/*
0N/A * The signature for a function that returns the specific integer
0N/A * format pixel for a given ARGB color value for a particular
0N/A * SurfaceType implementation.
0N/A * This function is valid only after GetRasInfo call for the
0N/A * associated surface.
0N/A */
0N/Atypedef jint (PixelForFunc)(SurfaceDataRasInfo *pRasInfo, jint rgb);
0N/A
0N/A/*
0N/A * The additional information needed to manipulate a surface:
0N/A * - The pixelFor function for translating ARGB values.
0N/A * Valid only after GetRasInfo call for this surface.
0N/A * - The additional flags needed when reading from this surface.
0N/A * - The additional flags needed when writing to this surface.
0N/A */
0N/Atypedef struct _SurfaceType {
0N/A SurfCompHdr hdr;
0N/A PixelForFunc *pixelFor;
0N/A jint readflags;
0N/A jint writeflags;
0N/A} SurfaceType;
0N/A
0N/A/*
0N/A * The definitions for the CompositeType structure described above.
0N/A */
0N/A
0N/A/*
0N/A * The signature for a function that fills in a CompositeInfo
0N/A * structure from the information present in a given Java Composite
0N/A * object.
0N/A */
0N/Atypedef JNIEXPORT void (JNICALL CompInfoFunc)(JNIEnv *env,
0N/A CompositeInfo *pCompInfo,
0N/A jobject Composite);
0N/A
0N/A/*
0N/A * The additional information needed to implement a primitive that
0N/A * performs a particular composite operation:
0N/A * - The getCompInfo function for filling in a CompositeInfo structure.
0N/A * - The additional flags needed for locking the destination surface.
0N/A */
0N/Atypedef struct _CompositeType {
0N/A SurfCompHdr hdr;
0N/A CompInfoFunc *getCompInfo;
0N/A jint dstflags;
0N/A} CompositeType;
0N/A
0N/A/*
0N/A * The signature of the native functions that register a set of
0N/A * related native GraphicsPrimitive functions.
0N/A */
0N/Atypedef jboolean (RegisterFunc)(JNIEnv *env);
0N/A
0N/Astruct _NativePrimitive; /* forward reference for function typedefs */
0N/A
0N/A/*
0N/A * This empty function signature represents an "old pre-ANSI style"
0N/A * function declaration which makes no claims about the argument list
0N/A * other than that the types of the arguments will undergo argument
0N/A * promotion in the calling conventions.
0N/A * (See section A7.3.2 in K&R 2nd edition.)
0N/A *
0N/A * When trying to statically initialize the function pointer field of
0N/A * a NativePrimitive structure, which is a union of all possible
0N/A * inner loop function signatures, the initializer constant must be
0N/A * compatible with the first field in the union. This generic function
0N/A * type allows us to assign any function pointer to that union as long
0N/A * as it meets the requirements specified above (i.e. all arguments
0N/A * are compatible with their promoted values according to the old
0N/A * style argument promotion calling semantics).
0N/A *
0N/A * Note: This means that you cannot define an argument to any of
0N/A * these native functions which is a byte or a short as that value
0N/A * would not be passed in the same way for an ANSI-style full prototype
0N/A * calling convention and an old-style argument promotion calling
0N/A * convention.
0N/A */
0N/Atypedef void (AnyFunc)();
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "Blit".
0N/A */
0N/Atypedef void (BlitFunc)(void *pSrc, void *pDst,
0N/A juint width, juint height,
0N/A SurfaceDataRasInfo *pSrcInfo,
0N/A SurfaceDataRasInfo *pDstInfo,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "BlitBg".
0N/A */
0N/Atypedef void (BlitBgFunc)(void *pSrc, void *pDst,
0N/A juint width, juint height, jint bgpixel,
0N/A SurfaceDataRasInfo *pSrcInfo,
0N/A SurfaceDataRasInfo *pDstInfo,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "ScaleBlit".
0N/A */
0N/Atypedef void (ScaleBlitFunc)(void *pSrc, void *pDst,
0N/A juint dstwidth, juint dstheight,
0N/A jint sxloc, jint syloc,
0N/A jint sxinc, jint syinc, jint scale,
0N/A SurfaceDataRasInfo *pSrcInfo,
0N/A SurfaceDataRasInfo *pDstInfo,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "FillRect".
0N/A */
0N/Atypedef void (FillRectFunc)(SurfaceDataRasInfo *pRasInfo,
0N/A jint lox, jint loy,
0N/A jint hix, jint hiy,
0N/A jint pixel, struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "FillSpans".
0N/A */
0N/Atypedef void (FillSpansFunc)(SurfaceDataRasInfo *pRasInfo,
0N/A SpanIteratorFuncs *pSpanFuncs, void *siData,
0N/A jint pixel, struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "DrawLine".
0N/A * Note that this same inner loop is used for native DrawRect
0N/A * and DrawPolygons primitives.
0N/A */
0N/Atypedef void (DrawLineFunc)(SurfaceDataRasInfo *pRasInfo,
0N/A jint x1, jint y1, jint pixel,
0N/A jint steps, jint error,
0N/A jint bumpmajormask, jint errmajor,
0N/A jint bumpminormask, jint errminor,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "MaskFill".
0N/A */
0N/Atypedef void (MaskFillFunc)(void *pRas,
0N/A unsigned char *pMask, jint maskOff, jint maskScan,
0N/A jint width, jint height,
0N/A jint fgColor,
0N/A SurfaceDataRasInfo *pRasInfo,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "MaskBlit".
0N/A */
0N/Atypedef void (MaskBlitFunc)(void *pDst, void *pSrc,
0N/A unsigned char *pMask, jint maskOff, jint maskScan,
0N/A jint width, jint height,
0N/A SurfaceDataRasInfo *pDstInfo,
0N/A SurfaceDataRasInfo *pSrcInfo,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A/*
0N/A * The signature of the inner loop function for a "DrawGlyphList".
0N/A */
0N/Atypedef void (DrawGlyphListFunc)(SurfaceDataRasInfo *pRasInfo,
0N/A ImageRef *glyphs,
0N/A jint totalGlyphs,
0N/A jint fgpixel, jint fgcolor,
0N/A jint cx1, jint cy1,
0N/A jint cx2, jint cy2,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "DrawGlyphListAA".
0N/A */
0N/Atypedef void (DrawGlyphListAAFunc)(SurfaceDataRasInfo *pRasInfo,
0N/A ImageRef *glyphs,
0N/A jint totalGlyphs,
0N/A jint fgpixel, jint fgcolor,
0N/A jint cx1, jint cy1,
0N/A jint cx2, jint cy2,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop function for a "DrawGlyphListLCD".
0N/A * rgbOrder is a jint rather than a jboolean so that this typedef matches
0N/A * AnyFunc which is the first element in a union in NativePrimitive's
0N/A * initialiser. See the comments alongside declaration of the AnyFunc type for
0N/A * a full explanation.
0N/A */
0N/Atypedef void (DrawGlyphListLCDFunc)(SurfaceDataRasInfo *pRasInfo,
0N/A ImageRef *glyphs,
0N/A jint totalGlyphs,
0N/A jint fgpixel, jint fgcolor,
0N/A jint cx1, jint cy1,
0N/A jint cx2, jint cy2,
0N/A jint rgbOrder,
0N/A unsigned char *gammaLut,
0N/A unsigned char *invGammaLut,
0N/A struct _NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/A
0N/A/*
0N/A * The signature of the inner loop functions for a "TransformHelper".
0N/A */
0N/Atypedef void (TransformHelperFunc)(SurfaceDataRasInfo *pSrcInfo,
0N/A jint *pRGB, jint numpix,
0N/A jlong xlong, jlong dxlong,
0N/A jlong ylong, jlong dylong);
0N/A
0N/Atypedef struct {
0N/A TransformHelperFunc *nnHelper;
0N/A TransformHelperFunc *blHelper;
0N/A TransformHelperFunc *bcHelper;
0N/A} TransformHelperFuncs;
0N/A
0N/Atypedef void (TransformInterpFunc)(jint *pRGBbase, jint numpix,
0N/A jint xfract, jint dxfract,
0N/A jint yfract, jint dyfract);
0N/A
0N/A/*
3172N/A * The signature of the inner loop function for a "FillParallelogram"
3172N/A * Note that this same inner loop is used for native DrawParallelogram
3172N/A * primitives.
3172N/A * Note that these functions are paired with equivalent DrawLine
3172N/A * inner loop functions to facilitate nicer looking and faster thin
3172N/A * transformed drawrect calls.
3172N/A */
3172N/Atypedef void (FillParallelogramFunc)(SurfaceDataRasInfo *pRasInfo,
3172N/A jint lox, jint loy, jint hix, jint hiy,
3172N/A jlong leftx, jlong dleftx,
3172N/A jlong rightx, jlong drightx,
3172N/A jint pixel, struct _NativePrimitive *pPrim,
3172N/A CompositeInfo *pCompInfo);
3172N/A
3172N/Atypedef struct {
3172N/A FillParallelogramFunc *fillpgram;
3172N/A DrawLineFunc *drawline;
3172N/A} DrawParallelogramFuncs;
3172N/A
3172N/A/*
0N/A * This structure contains all information for defining a single
0N/A * native GraphicsPrimitive, including:
0N/A * - The information about the type of the GraphicsPrimitive subclass.
0N/A * - The information about the type of the source surface.
0N/A * - The information about the type of the compositing operation.
0N/A * - The information about the type of the destination surface.
0N/A * - A pointer to the function that performs the actual inner loop work.
0N/A * - Extra flags needed for locking the source and destination surfaces
0N/A * above and beyond the flags specified in the Primitive, Composite
0N/A * and SurfaceType structures. (For most native primitives these
0N/A * flags can be calculated automatically from information stored in
0N/A * the PrimitiveType, SurfaceType, and CompositeType structures.)
0N/A */
0N/Atypedef struct _NativePrimitive {
0N/A PrimitiveType *pPrimType;
0N/A SurfaceType *pSrcType;
0N/A CompositeType *pCompType;
0N/A SurfaceType *pDstType;
0N/A /* See declaration of AnyFunc type above for comments explaining why
0N/A * only AnyFunc is used by the initializers for these union fields
0N/A * and consequent type restrictions.
0N/A */
0N/A union {
0N/A AnyFunc *initializer;
0N/A BlitFunc *blit;
0N/A BlitBgFunc *blitbg;
0N/A ScaleBlitFunc *scaledblit;
0N/A FillRectFunc *fillrect;
0N/A FillSpansFunc *fillspans;
3172N/A FillParallelogramFunc *fillparallelogram;
3172N/A DrawParallelogramFuncs *drawparallelogram;
0N/A DrawLineFunc *drawline;
0N/A MaskFillFunc *maskfill;
0N/A MaskBlitFunc *maskblit;
0N/A DrawGlyphListFunc *drawglyphlist;
0N/A DrawGlyphListFunc *drawglyphlistaa;
0N/A DrawGlyphListLCDFunc *drawglyphlistlcd;
0N/A TransformHelperFuncs *transformhelpers;
0N/A } funcs, funcs_c;
0N/A jint srcflags;
0N/A jint dstflags;
0N/A} NativePrimitive;
0N/A
0N/A/*
0N/A * This function should be defined to return a pointer to
0N/A * an accelerated version of a primitive function 'func_c'
0N/A * if it exists and to return a copy of the input parameter
0N/A * otherwise.
0N/A */
0N/Aextern AnyFunc* MapAccelFunction(AnyFunc *func_c);
0N/A
0N/A/*
0N/A * The global collection of all primitive types. Specific NativePrimitive
0N/A * structures can be statically initialized by pointing to these structures.
0N/A */
0N/Aextern struct _PrimitiveTypes {
0N/A PrimitiveType Blit;
0N/A PrimitiveType BlitBg;
0N/A PrimitiveType ScaledBlit;
0N/A PrimitiveType FillRect;
0N/A PrimitiveType FillSpans;
3172N/A PrimitiveType FillParallelogram;
3172N/A PrimitiveType DrawParallelogram;
0N/A PrimitiveType DrawLine;
0N/A PrimitiveType DrawRect;
0N/A PrimitiveType DrawPolygons;
0N/A PrimitiveType DrawPath;
0N/A PrimitiveType FillPath;
0N/A PrimitiveType MaskBlit;
0N/A PrimitiveType MaskFill;
0N/A PrimitiveType DrawGlyphList;
0N/A PrimitiveType DrawGlyphListAA;
0N/A PrimitiveType DrawGlyphListLCD;
0N/A PrimitiveType TransformHelper;
0N/A} PrimitiveTypes;
0N/A
0N/A/*
0N/A * The global collection of all surface types. Specific NativePrimitive
0N/A * structures can be statically initialized by pointing to these structures.
0N/A */
0N/Aextern struct _SurfaceTypes {
0N/A SurfaceType OpaqueColor;
0N/A SurfaceType AnyColor;
0N/A SurfaceType AnyByte;
0N/A SurfaceType ByteBinary1Bit;
0N/A SurfaceType ByteBinary2Bit;
0N/A SurfaceType ByteBinary4Bit;
0N/A SurfaceType ByteIndexed;
0N/A SurfaceType ByteIndexedBm;
0N/A SurfaceType ByteGray;
0N/A SurfaceType Index8Gray;
0N/A SurfaceType Index12Gray;
0N/A SurfaceType AnyShort;
0N/A SurfaceType Ushort555Rgb;
0N/A SurfaceType Ushort555Rgbx;
0N/A SurfaceType Ushort565Rgb;
0N/A SurfaceType Ushort4444Argb;
0N/A SurfaceType UshortGray;
0N/A SurfaceType UshortIndexed;
0N/A SurfaceType Any3Byte;
0N/A SurfaceType ThreeByteBgr;
0N/A SurfaceType AnyInt;
0N/A SurfaceType IntArgb;
0N/A SurfaceType IntArgbPre;
0N/A SurfaceType IntArgbBm;
0N/A SurfaceType IntRgb;
0N/A SurfaceType IntBgr;
0N/A SurfaceType IntRgbx;
0N/A SurfaceType Any4Byte;
0N/A SurfaceType FourByteAbgr;
0N/A SurfaceType FourByteAbgrPre;
0N/A} SurfaceTypes;
0N/A
0N/A/*
0N/A * The global collection of all composite types. Specific NativePrimitive
0N/A * structures can be statically initialized by pointing to these structures.
0N/A */
0N/Aextern struct _CompositeTypes {
0N/A CompositeType SrcNoEa;
0N/A CompositeType SrcOverNoEa;
0N/A CompositeType SrcOverBmNoEa;
0N/A CompositeType Src;
0N/A CompositeType SrcOver;
0N/A CompositeType Xor;
0N/A CompositeType AnyAlpha;
0N/A} CompositeTypes;
0N/A
0N/A#define ArraySize(A) (sizeof(A) / sizeof(A[0]))
0N/A
0N/A#define PtrAddBytes(p, b) ((void *) (((intptr_t) (p)) + (b)))
0N/A#define PtrCoord(p, x, xinc, y, yinc) PtrAddBytes(p, (y)*(yinc) + (x)*(xinc))
0N/A
0N/A/*
0N/A * The function to call with an array of NativePrimitive structures
0N/A * to register them with the Java GraphicsPrimitiveMgr.
0N/A */
0N/Aextern jboolean RegisterPrimitives(JNIEnv *env,
0N/A NativePrimitive *pPrim,
0N/A jint NumPrimitives);
0N/A
0N/A/*
0N/A * The utility function to retrieve the NativePrimitive structure
0N/A * from a given Java GraphicsPrimitive object.
0N/A */
0N/Aextern JNIEXPORT NativePrimitive * JNICALL
0N/AGetNativePrim(JNIEnv *env, jobject gp);
0N/A
0N/A/*
0N/A * Utility functions to get values from a Java SunGraphics2D or Color object.
0N/A */
0N/Aextern JNIEXPORT void JNICALL
0N/AGrPrim_Sg2dGetCompInfo(JNIEnv *env, jobject sg2d,
0N/A NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo);
0N/Aextern JNIEXPORT jint JNICALL
0N/AGrPrim_CompGetXorColor(JNIEnv *env, jobject comp);
0N/Aextern JNIEXPORT void JNICALL
0N/AGrPrim_CompGetXorInfo(JNIEnv *env, CompositeInfo *pCompInfo, jobject comp);
0N/Aextern JNIEXPORT void JNICALL
0N/AGrPrim_CompGetAlphaInfo(JNIEnv *env, CompositeInfo *pCompInfo, jobject comp);
0N/A
0N/Aextern JNIEXPORT void JNICALL
0N/AGrPrim_Sg2dGetClip(JNIEnv *env, jobject sg2d,
0N/A SurfaceDataBounds *bounds);
0N/A
0N/Aextern JNIEXPORT jint JNICALL
0N/AGrPrim_Sg2dGetPixel(JNIEnv *env, jobject sg2d);
0N/Aextern JNIEXPORT jint JNICALL
0N/AGrPrim_Sg2dGetEaRGB(JNIEnv *env, jobject sg2d);
0N/Aextern JNIEXPORT jint JNICALL
0N/AGrPrim_Sg2dGetLCDTextContrast(JNIEnv *env, jobject sg2d);
0N/A
0N/A/*
0N/A * Data structure and functions to retrieve and use
0N/A * AffineTransform objects from the native level.
0N/A */
0N/Atypedef struct {
0N/A jdouble dxdx; /* dx in dest space for each dx in src space */
0N/A jdouble dxdy; /* dx in dest space for each dy in src space */
0N/A jdouble tx;
0N/A jdouble dydx; /* dy in dest space for each dx in src space */
0N/A jdouble dydy; /* dy in dest space for each dy in src space */
0N/A jdouble ty;
0N/A} TransformInfo;
0N/A
0N/Aextern JNIEXPORT void JNICALL
0N/ATransform_GetInfo(JNIEnv *env, jobject txform, TransformInfo *pTxInfo);
0N/Aextern JNIEXPORT void JNICALL
0N/ATransform_transform(TransformInfo *pTxInfo, jdouble *pX, jdouble *pY);
0N/A
0N/Avoid GrPrim_RefineBounds(SurfaceDataBounds *bounds, jint transX, jint transY,
0N/A jfloat *coords, jint maxCoords);
0N/A
0N/Aextern jfieldID path2DTypesID;
0N/Aextern jfieldID path2DNumTypesID;
0N/Aextern jfieldID path2DWindingRuleID;
0N/Aextern jfieldID path2DFloatCoordsID;
0N/Aextern jfieldID sg2dStrokeHintID;
0N/Aextern jint sunHints_INTVAL_STROKE_PURE;
0N/A
0N/A/*
0N/A * Macros for using jlong variables as 32bits.32bits fractional values
0N/A */
0N/A#define LongOneHalf (((jlong) 1) << 31)
0N/A#define IntToLong(i) (((jlong) (i)) << 32)
0N/A#define DblToLong(d) ((jlong) ((d) * IntToLong(1)))
3172N/A#define LongToDbl(l) (((jdouble) l) / IntToLong(1))
0N/A#define WholeOfLong(l) ((jint) ((l) >> 32))
0N/A#define FractOfLong(l) ((jint) (l))
0N/A#define URShift(i, n) (((juint) (i)) >> (n))
0N/A
0N/A/*
0N/A * Macros to help in defining arrays of NativePrimitive structures.
0N/A *
0N/A * These macros are the very base macros. More specific macros are
0N/A * defined in LoopMacros.h.
0N/A *
0N/A * Note that the DrawLine, DrawRect, and DrawPolygons primitives are
0N/A * all registered together from a single shared native function pointer.
0N/A */
0N/A
0N/A#define REGISTER_PRIMITIVE(TYPE, SRC, COMP, DST, FUNC) \
0N/A { \
0N/A & PrimitiveTypes.TYPE, \
0N/A & SurfaceTypes.SRC, \
0N/A & CompositeTypes.COMP, \
0N/A & SurfaceTypes.DST, \
0N/A {FUNC}, \
0N/A {FUNC}, \
0N/A 0, \
0N/A 0 \
0N/A }
0N/A
0N/A#define REGISTER_PRIMITIVE_FLAGS(TYPE, SRC, COMP, DST, FUNC, SFLAGS, DFLAGS) \
0N/A { \
0N/A & PrimitiveTypes.TYPE, \
0N/A & SurfaceTypes.SRC, \
0N/A & CompositeTypes.COMP, \
0N/A & SurfaceTypes.DST, \
0N/A {FUNC}, \
0N/A {FUNC}, \
0N/A SFLAGS, \
0N/A DFLAGS, \
0N/A }
0N/A
0N/A#define REGISTER_BLIT(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(Blit, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_BLIT_FLAGS(SRC, COMP, DST, FUNC, SFLAGS, DFLAGS) \
0N/A REGISTER_PRIMITIVE_FLAGS(Blit, SRC, COMP, DST, FUNC, SFLAGS, DFLAGS)
0N/A
0N/A#define REGISTER_SCALEBLIT(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(ScaledBlit, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_SCALEBLIT_FLAGS(SRC, COMP, DST, FUNC, SFLAGS, DFLAGS) \
0N/A REGISTER_PRIMITIVE_FLAGS(ScaledBlit, SRC, COMP, DST, FUNC, SFLAGS, DFLAGS)
0N/A
0N/A#define REGISTER_BLITBG(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(BlitBg, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_FILLRECT(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(FillRect, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_FILLSPANS(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(FillSpans, SRC, COMP, DST, FUNC)
0N/A
3172N/A#define REGISTER_FILLPGRAM(SRC, COMP, DST, FUNC) \
3172N/A REGISTER_PRIMITIVE(FillParallelogram, SRC, COMP, DST, FUNC), \
3172N/A REGISTER_PRIMITIVE(DrawParallelogram, SRC, COMP, DST, FUNC)
3172N/A
0N/A#define REGISTER_LINE_PRIMITIVES(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(DrawLine, SRC, COMP, DST, FUNC), \
0N/A REGISTER_PRIMITIVE(DrawRect, SRC, COMP, DST, FUNC), \
0N/A REGISTER_PRIMITIVE(DrawPolygons, SRC, COMP, DST, FUNC), \
0N/A REGISTER_PRIMITIVE(DrawPath, SRC, COMP, DST, FUNC), \
0N/A REGISTER_PRIMITIVE(FillPath, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_MASKBLIT(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(MaskBlit, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_MASKFILL(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(MaskFill, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_DRAWGLYPHLIST(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(DrawGlyphList, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_DRAWGLYPHLISTAA(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(DrawGlyphListAA, SRC, COMP, DST, FUNC)
0N/A
0N/A#define REGISTER_DRAWGLYPHLISTLCD(SRC, COMP, DST, FUNC) \
0N/A REGISTER_PRIMITIVE(DrawGlyphListLCD, SRC, COMP, DST, FUNC)
0N/A
0N/A#ifdef __cplusplus
0N/A};
0N/A#endif
0N/A
0N/A#endif /* GraphicsPrimitiveMgr_h_Included */