Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c
38918 views
/*1* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include "jni_util.h"26#include "jlong.h"2728#include "sun_java2d_loops_GraphicsPrimitiveMgr.h"2930#include "Region.h"31#include "GraphicsPrimitiveMgr.h"32#include "AlphaMacros.h"3334static char *InitName = "<init>";35static char *InitSig = ("(JLsun/java2d/loops/SurfaceType;"36"Lsun/java2d/loops/CompositeType;"37"Lsun/java2d/loops/SurfaceType;)V");3839static char *RegisterName = "register";40static char *RegisterSig = "([Lsun/java2d/loops/GraphicsPrimitive;)V";4142static jclass GraphicsPrimitiveMgr;43static jclass GraphicsPrimitive;4445static jmethodID RegisterID;46static jfieldID pNativePrimID;47static jfieldID pixelID;48static jfieldID eargbID;49static jfieldID clipRegionID;50static jfieldID compositeID;51static jfieldID lcdTextContrastID;52static jfieldID xorPixelID;53static jfieldID xorColorID;54static jfieldID alphaMaskID;55static jfieldID ruleID;56static jfieldID extraAlphaID;5758static jfieldID m00ID;59static jfieldID m01ID;60static jfieldID m02ID;61static jfieldID m10ID;62static jfieldID m11ID;63static jfieldID m12ID;6465static jmethodID getRgbID;6667static jboolean InitPrimTypes(JNIEnv *env);68static jboolean InitSurfaceTypes(JNIEnv *env, jclass SurfaceType);69static jboolean InitCompositeTypes(JNIEnv *env, jclass CompositeType);7071jfieldID path2DTypesID;72jfieldID path2DNumTypesID;73jfieldID path2DWindingRuleID;74jfieldID path2DFloatCoordsID;75jfieldID sg2dStrokeHintID;76jint sunHints_INTVAL_STROKE_PURE;7778/*79* Class: sun_java2d_loops_GraphicsPrimitiveMgr80* Method: initIDs81* Signature: (Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;)V82*/83JNIEXPORT void JNICALL84Java_sun_java2d_loops_GraphicsPrimitiveMgr_initIDs85(JNIEnv *env, jclass GPMgr,86jclass GP, jclass ST, jclass CT,87jclass SG2D, jclass Color, jclass AT,88jclass XORComp, jclass AlphaComp,89jclass Path2D, jclass Path2DFloat,90jclass SHints)91{92jfieldID fid;93initAlphaTables();94GraphicsPrimitiveMgr = (*env)->NewGlobalRef(env, GPMgr);95GraphicsPrimitive = (*env)->NewGlobalRef(env, GP);96if (GraphicsPrimitiveMgr == NULL || GraphicsPrimitive == NULL) {97JNU_ThrowOutOfMemoryError(env, "creating global refs");98return;99}100if (!InitPrimTypes(env) ||101!InitSurfaceTypes(env, ST) ||102!InitCompositeTypes(env, CT))103{104return;105}106107CHECK_NULL(RegisterID =108(*env)->GetStaticMethodID(env, GPMgr, RegisterName, RegisterSig));109CHECK_NULL(pNativePrimID = (*env)->GetFieldID(env, GP, "pNativePrim", "J"));110CHECK_NULL(pixelID = (*env)->GetFieldID(env, SG2D, "pixel", "I"));111CHECK_NULL(eargbID = (*env)->GetFieldID(env, SG2D, "eargb", "I"));112CHECK_NULL(clipRegionID =113(*env)->GetFieldID(env, SG2D, "clipRegion", "Lsun/java2d/pipe/Region;"));114CHECK_NULL(compositeID =115(*env)->GetFieldID(env, SG2D, "composite", "Ljava/awt/Composite;"));116CHECK_NULL(lcdTextContrastID =117(*env)->GetFieldID(env, SG2D, "lcdTextContrast", "I"));118CHECK_NULL(getRgbID = (*env)->GetMethodID(env, Color, "getRGB", "()I"));119CHECK_NULL(xorPixelID = (*env)->GetFieldID(env, XORComp, "xorPixel", "I"));120CHECK_NULL(xorColorID =121(*env)->GetFieldID(env, XORComp, "xorColor", "Ljava/awt/Color;"));122CHECK_NULL(alphaMaskID =123(*env)->GetFieldID(env, XORComp, "alphaMask", "I"));124CHECK_NULL(ruleID = (*env)->GetFieldID(env, AlphaComp, "rule", "I"));125CHECK_NULL(extraAlphaID =126(*env)->GetFieldID(env, AlphaComp, "extraAlpha", "F"));127128129CHECK_NULL(m00ID = (*env)->GetFieldID(env, AT, "m00", "D"));130CHECK_NULL(m01ID = (*env)->GetFieldID(env, AT, "m01", "D"));131CHECK_NULL(m02ID = (*env)->GetFieldID(env, AT, "m02", "D"));132CHECK_NULL(m10ID = (*env)->GetFieldID(env, AT, "m10", "D"));133CHECK_NULL(m11ID = (*env)->GetFieldID(env, AT, "m11", "D"));134CHECK_NULL(m12ID = (*env)->GetFieldID(env, AT, "m12", "D"));135136CHECK_NULL(path2DTypesID =137(*env)->GetFieldID(env, Path2D, "pointTypes", "[B"));138CHECK_NULL(path2DNumTypesID =139(*env)->GetFieldID(env, Path2D, "numTypes", "I"));140CHECK_NULL(path2DWindingRuleID =141(*env)->GetFieldID(env, Path2D, "windingRule", "I"));142CHECK_NULL(path2DFloatCoordsID =143(*env)->GetFieldID(env, Path2DFloat, "floatCoords", "[F"));144CHECK_NULL(sg2dStrokeHintID =145(*env)->GetFieldID(env, SG2D, "strokeHint", "I"));146CHECK_NULL(fid =147(*env)->GetStaticFieldID(env, SHints, "INTVAL_STROKE_PURE", "I"));148sunHints_INTVAL_STROKE_PURE = (*env)->GetStaticIntField(env, SHints, fid);149}150151void GrPrim_RefineBounds(SurfaceDataBounds *bounds, jint transX, jint transY,152jfloat *coords, jint maxCoords)153{154jint xmin, ymin, xmax, ymax;155if (maxCoords > 1) {156xmin = xmax = transX + (jint)(*coords++ + 0.5);157ymin = ymax = transY + (jint)(*coords++ + 0.5);158for (;maxCoords > 1; maxCoords -= 2) {159jint x = transX + (jint)(*coords++ + 0.5);160jint y = transY + (jint)(*coords++ + 0.5);161if (xmin > x) xmin = x;162if (ymin > y) ymin = y;163if (xmax < x) xmax = x;164if (ymax < y) ymax = y;165}166if (++xmax < xmin) xmax--;167if (++ymax < ymin) ymax--;168if (bounds->x1 < xmin) bounds->x1 = xmin;169if (bounds->y1 < ymin) bounds->y1 = ymin;170if (bounds->x2 > xmax) bounds->x2 = xmax;171if (bounds->y2 > ymax) bounds->y2 = ymax;172} else {173bounds->x2 = bounds->x1;174bounds->y2 = bounds->y1;175}176}177178/*179* Class: sun_java2d_loops_GraphicsPrimitiveMgr180* Method: registerNativeLoops181* Signature: ()V182*/183JNIEXPORT void JNICALL184Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops185(JNIEnv *env, jclass GPMgr)186{187RegisterFunc RegisterAnyByte;188RegisterFunc RegisterByteBinary1Bit;189RegisterFunc RegisterByteBinary2Bit;190RegisterFunc RegisterByteBinary4Bit;191RegisterFunc RegisterByteIndexed;192RegisterFunc RegisterByteGray;193RegisterFunc RegisterIndex8Gray;194RegisterFunc RegisterIndex12Gray;195RegisterFunc RegisterAnyShort;196RegisterFunc RegisterUshort555Rgb;197RegisterFunc RegisterUshort565Rgb;198RegisterFunc RegisterUshort4444Argb;199RegisterFunc RegisterUshort555Rgbx;200RegisterFunc RegisterUshortGray;201RegisterFunc RegisterUshortIndexed;202RegisterFunc RegisterAny3Byte;203RegisterFunc RegisterThreeByteBgr;204RegisterFunc RegisterAnyInt;205RegisterFunc RegisterIntArgb;206RegisterFunc RegisterIntArgbPre;207RegisterFunc RegisterIntArgbBm;208RegisterFunc RegisterIntRgb;209RegisterFunc RegisterIntBgr;210RegisterFunc RegisterIntRgbx;211RegisterFunc RegisterAny4Byte;212RegisterFunc RegisterFourByteAbgr;213RegisterFunc RegisterFourByteAbgrPre;214215if (!RegisterAnyByte(env) ||216!RegisterByteBinary1Bit(env) ||217!RegisterByteBinary2Bit(env) ||218!RegisterByteBinary4Bit(env) ||219!RegisterByteIndexed(env) ||220!RegisterByteGray(env) ||221!RegisterIndex8Gray(env) ||222!RegisterIndex12Gray(env) ||223!RegisterAnyShort(env) ||224!RegisterUshort555Rgb(env) ||225!RegisterUshort565Rgb(env) ||226!RegisterUshort4444Argb(env) ||227!RegisterUshort555Rgbx(env) ||228!RegisterUshortGray(env) ||229!RegisterUshortIndexed(env) ||230!RegisterAny3Byte(env) ||231!RegisterThreeByteBgr(env) ||232!RegisterAnyInt(env) ||233!RegisterIntArgb(env) ||234!RegisterIntArgbPre(env) ||235!RegisterIntArgbBm(env) ||236!RegisterIntRgb(env) ||237!RegisterIntBgr(env) ||238!RegisterIntRgbx(env) ||239!RegisterAny4Byte(env) ||240!RegisterFourByteAbgr(env) ||241!RegisterFourByteAbgrPre(env))242{243return;244}245}246247#define _StartOf(T) ((T *) (&T##s))248#define _NumberOf(T) (sizeof(T##s) / sizeof(T))249#define _EndOf(T) (_StartOf(T) + _NumberOf(T))250251#define PrimTypeStart _StartOf(PrimitiveType)252#define PrimTypeEnd _EndOf(PrimitiveType)253254#define SurfTypeStart _StartOf(SurfaceType)255#define SurfTypeEnd _EndOf(SurfaceType)256257#define CompTypeStart _StartOf(CompositeType)258#define CompTypeEnd _EndOf(CompositeType)259260/*261* This function initializes the global collection of PrimitiveType262* structures by retrieving the necessary Java Class object and the263* associated methodID of the necessary constructor.264*265* See PrimitiveTypes.* below.266*/267static jboolean InitPrimTypes(JNIEnv *env)268{269jboolean ok = JNI_TRUE;270PrimitiveType *pPrimType;271jclass cl;272273for (pPrimType = PrimTypeStart; pPrimType < PrimTypeEnd; pPrimType++) {274cl = (*env)->FindClass(env, pPrimType->ClassName);275if (cl == NULL) {276ok = JNI_FALSE;277break;278}279pPrimType->ClassObject = (*env)->NewGlobalRef(env, cl);280pPrimType->Constructor =281(*env)->GetMethodID(env, cl, InitName, InitSig);282283(*env)->DeleteLocalRef(env, cl);284if (pPrimType->ClassObject == NULL ||285pPrimType->Constructor == NULL)286{287ok = JNI_FALSE;288break;289}290}291292if (!ok) {293for (pPrimType = PrimTypeStart; pPrimType < PrimTypeEnd; pPrimType++) {294if (pPrimType->ClassObject != NULL) {295(*env)->DeleteGlobalRef(env, pPrimType->ClassObject);296pPrimType->ClassObject = NULL;297}298pPrimType->Constructor = NULL;299}300}301302return ok;303}304305/*306* This function initializes the global collection of SurfaceType307* or CompositeType structures by retrieving the corresponding Java308* object stored as a static field on the Java Class.309*310* See SurfaceTypes.* below.311* See CompositeeTypes.* below.312*/313static jboolean InitSimpleTypes314(JNIEnv *env, jclass SimpleClass, char *SimpleSig,315SurfCompHdr *pStart, SurfCompHdr *pEnd, jsize size)316{317jboolean ok = JNI_TRUE;318SurfCompHdr *pHdr;319jfieldID field;320jobject obj;321322for (pHdr = pStart; pHdr < pEnd; pHdr = PtrAddBytes(pHdr, size)) {323field = (*env)->GetStaticFieldID(env,324SimpleClass,325pHdr->Name,326SimpleSig);327if (field == NULL) {328ok = JNI_FALSE;329break;330}331obj = (*env)->GetStaticObjectField(env, SimpleClass, field);332if (obj == NULL) {333ok = JNI_FALSE;334break;335}336pHdr->Object = (*env)->NewGlobalRef(env, obj);337(*env)->DeleteLocalRef(env, obj);338339if (pHdr->Object == NULL) {340ok = JNI_FALSE;341break;342}343}344345if (!ok) {346for (pHdr = pStart; pHdr < pEnd; pHdr = PtrAddBytes(pHdr, size)) {347if (pHdr->Object != NULL) {348(*env)->DeleteGlobalRef(env, pHdr->Object);349pHdr->Object = NULL;350}351}352}353354return ok;355}356357static jboolean InitSurfaceTypes(JNIEnv *env, jclass ST)358{359return InitSimpleTypes(env, ST, "Lsun/java2d/loops/SurfaceType;",360(SurfCompHdr *) SurfTypeStart,361(SurfCompHdr *) SurfTypeEnd,362sizeof(SurfaceType));363}364365static jboolean InitCompositeTypes(JNIEnv *env, jclass CT)366{367return InitSimpleTypes(env, CT, "Lsun/java2d/loops/CompositeType;",368(SurfCompHdr *) CompTypeStart,369(SurfCompHdr *) CompTypeEnd,370sizeof(CompositeType));371}372373/*374* This function registers a set of Java GraphicsPrimitive objects375* based on information stored in an array of NativePrimitive structures.376*/377jboolean RegisterPrimitives(JNIEnv *env,378NativePrimitive *pPrim,379jint NumPrimitives)380{381jarray primitives;382int i;383384primitives = (*env)->NewObjectArray(env, NumPrimitives,385GraphicsPrimitive, NULL);386if (primitives == NULL) {387return JNI_FALSE;388}389390for (i = 0; i < NumPrimitives; i++, pPrim++) {391jint srcflags, dstflags;392jobject prim;393PrimitiveType *pType = pPrim->pPrimType;394SurfaceType *pSrc = pPrim->pSrcType;395CompositeType *pComp = pPrim->pCompType;396SurfaceType *pDst = pPrim->pDstType;397398pPrim->funcs.initializer = MapAccelFunction(pPrim->funcs_c.initializer);399400/*401* Calculate the necessary SurfaceData lock flags for the402* source and destination surfaces based on the information403* stored in the PrimitiveType, SurfaceType, and CompositeType404* structures. The starting point is the values that are405* already stored in the NativePrimitive structure. These406* flags are usually left as 0, but can be filled in by407* native primitive loops that have special needs that are408* not deducible from their declared attributes.409*/410srcflags = pPrim->srcflags;411dstflags = pPrim->dstflags;412srcflags |= pType->srcflags;413dstflags |= pType->dstflags;414dstflags |= pComp->dstflags;415if (srcflags & SD_LOCK_READ) srcflags |= pSrc->readflags;416/* if (srcflags & SD_LOCK_WRITE) srcflags |= pSrc->writeflags; */417if (dstflags & SD_LOCK_READ) dstflags |= pDst->readflags;418if (dstflags & SD_LOCK_WRITE) dstflags |= pDst->writeflags;419pPrim->srcflags = srcflags;420pPrim->dstflags = dstflags;421422prim = (*env)->NewObject(env,423pType->ClassObject,424pType->Constructor,425ptr_to_jlong(pPrim),426pSrc->hdr.Object,427pComp->hdr.Object,428pDst->hdr.Object);429if (prim == NULL) {430break;431}432(*env)->SetObjectArrayElement(env, primitives, i, prim);433(*env)->DeleteLocalRef(env, prim);434if ((*env)->ExceptionCheck(env)) {435break;436}437}438439if (i >= NumPrimitives) {440/* No error - upcall to GraphicsPrimitiveMgr to register the441* new primitives... */442(*env)->CallStaticVoidMethod(env, GraphicsPrimitiveMgr, RegisterID,443primitives);444}445(*env)->DeleteLocalRef(env, primitives);446447return !((*env)->ExceptionCheck(env));448}449450JNIEXPORT NativePrimitive * JNICALL451GetNativePrim(JNIEnv *env, jobject gp)452{453NativePrimitive *pPrim;454455pPrim = (NativePrimitive *) JNU_GetLongFieldAsPtr(env, gp, pNativePrimID);456if (pPrim == NULL) {457JNU_ThrowInternalError(env, "Non-native Primitive invoked natively");458}459460return pPrim;461}462463JNIEXPORT void JNICALL464GrPrim_Sg2dGetCompInfo(JNIEnv *env, jobject sg2d,465NativePrimitive *pPrim, CompositeInfo *pCompInfo)466{467jobject comp;468469comp = (*env)->GetObjectField(env, sg2d, compositeID);470(*pPrim->pCompType->getCompInfo)(env, pCompInfo, comp);471(*env)->DeleteLocalRef(env, comp);472}473474JNIEXPORT jint JNICALL475GrPrim_CompGetXorColor(JNIEnv *env, jobject comp)476{477jobject color;478jint rgb;479480color = (*env)->GetObjectField(env, comp, xorColorID);481rgb = (*env)->CallIntMethod(env, color, getRgbID);482(*env)->DeleteLocalRef(env, color);483484return rgb;485}486487JNIEXPORT void JNICALL488GrPrim_Sg2dGetClip(JNIEnv *env, jobject sg2d, SurfaceDataBounds *bounds)489{490jobject clip = (*env)->GetObjectField(env, sg2d, clipRegionID);491Region_GetBounds(env, clip, bounds);492}493494JNIEXPORT jint JNICALL495GrPrim_Sg2dGetPixel(JNIEnv *env, jobject sg2d)496{497return (*env)->GetIntField(env, sg2d, pixelID);498}499500JNIEXPORT jint JNICALL501GrPrim_Sg2dGetEaRGB(JNIEnv *env, jobject sg2d)502{503return (*env)->GetIntField(env, sg2d, eargbID);504}505506JNIEXPORT jint JNICALL507GrPrim_Sg2dGetLCDTextContrast(JNIEnv *env, jobject sg2d)508{509return (*env)->GetIntField(env, sg2d, lcdTextContrastID);510}511512/*513* Helper function for CompositeTypes.Xor514*/515JNIEXPORT void JNICALL516GrPrim_CompGetXorInfo(JNIEnv *env, CompositeInfo *pCompInfo, jobject comp)517{518pCompInfo->rule = RULE_Xor;519pCompInfo->details.xorPixel = (*env)->GetIntField(env, comp, xorPixelID);520pCompInfo->alphaMask = (*env)->GetIntField(env, comp, alphaMaskID);521}522523/*524* Helper function for CompositeTypes.AnyAlpha525*/526JNIEXPORT void JNICALL527GrPrim_CompGetAlphaInfo(JNIEnv *env, CompositeInfo *pCompInfo, jobject comp)528{529pCompInfo->rule =530(*env)->GetIntField(env, comp, ruleID);531pCompInfo->details.extraAlpha =532(*env)->GetFloatField(env, comp, extraAlphaID);533}534535JNIEXPORT void JNICALL536Transform_GetInfo(JNIEnv *env, jobject txform, TransformInfo *pTxInfo)537{538pTxInfo->dxdx = (*env)->GetDoubleField(env, txform, m00ID);539pTxInfo->dxdy = (*env)->GetDoubleField(env, txform, m01ID);540pTxInfo->tx = (*env)->GetDoubleField(env, txform, m02ID);541pTxInfo->dydx = (*env)->GetDoubleField(env, txform, m10ID);542pTxInfo->dydy = (*env)->GetDoubleField(env, txform, m11ID);543pTxInfo->ty = (*env)->GetDoubleField(env, txform, m12ID);544}545546JNIEXPORT void JNICALL547Transform_transform(TransformInfo *pTxInfo, jdouble *pX, jdouble *pY)548{549jdouble x = *pX;550jdouble y = *pY;551552*pX = pTxInfo->dxdx * x + pTxInfo->dxdy * y + pTxInfo->tx;553*pY = pTxInfo->dydx * x + pTxInfo->dydy * y + pTxInfo->ty;554}555556/*557* External declarations for the pixelFor helper methods for the various558* named surface types. These functions are defined in the various559* files that contain the loop functions for their type.560*/561extern PixelForFunc PixelForByteBinary;562extern PixelForFunc PixelForByteIndexed;563extern PixelForFunc PixelForByteGray;564extern PixelForFunc PixelForIndex8Gray;565extern PixelForFunc PixelForIndex12Gray;566extern PixelForFunc PixelForUshort555Rgb;567extern PixelForFunc PixelForUshort555Rgbx;568extern PixelForFunc PixelForUshort565Rgb;569extern PixelForFunc PixelForUshort4444Argb;570extern PixelForFunc PixelForUshortGray;571extern PixelForFunc PixelForUshortIndexed;572extern PixelForFunc PixelForIntArgbPre;573extern PixelForFunc PixelForIntArgbBm;574extern PixelForFunc PixelForIntBgr;575extern PixelForFunc PixelForIntRgbx;576extern PixelForFunc PixelForFourByteAbgr;577extern PixelForFunc PixelForFourByteAbgrPre;578579/*580* Definition and initialization of the globally accessible PrimitiveTypes.581*/582struct _PrimitiveTypes PrimitiveTypes = {583{ "sun/java2d/loops/Blit", SD_LOCK_READ, SD_LOCK_WRITE, NULL, NULL},584{ "sun/java2d/loops/BlitBg", SD_LOCK_READ, SD_LOCK_WRITE, NULL, NULL},585{ "sun/java2d/loops/ScaledBlit", SD_LOCK_READ, SD_LOCK_WRITE, NULL, NULL},586{ "sun/java2d/loops/FillRect", 0, SD_LOCK_WRITE, NULL, NULL},587{ "sun/java2d/loops/FillSpans", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},588{ "sun/java2d/loops/FillParallelogram", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},589{ "sun/java2d/loops/DrawParallelogram", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},590{ "sun/java2d/loops/DrawLine", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},591{ "sun/java2d/loops/DrawRect", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},592{ "sun/java2d/loops/DrawPolygons", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},593{ "sun/java2d/loops/DrawPath", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},594{ "sun/java2d/loops/FillPath", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},595{ "sun/java2d/loops/MaskBlit", SD_LOCK_READ, SD_LOCK_RD_WR, NULL, NULL},596{ "sun/java2d/loops/MaskFill", 0, SD_LOCK_RD_WR, NULL, NULL},597{ "sun/java2d/loops/DrawGlyphList", 0, SD_LOCK_PARTIAL_WRITE |598SD_LOCK_FASTEST, NULL, NULL},599{ "sun/java2d/loops/DrawGlyphListAA", 0, SD_LOCK_RD_WR | SD_LOCK_FASTEST, NULL, NULL},600{ "sun/java2d/loops/DrawGlyphListLCD", 0, SD_LOCK_RD_WR | SD_LOCK_FASTEST, NULL, NULL},601{ "sun/java2d/loops/TransformHelper", SD_LOCK_READ, 0, NULL, NULL}602};603604/*605* Definition and initialization of the globally accessible SurfaceTypes.606*/607struct _SurfaceTypes SurfaceTypes = {608{ { "OpaqueColor", NULL}, NULL, 0, 0 },609{ { "AnyColor", NULL}, NULL, 0, 0 },610{ { "AnyByte", NULL}, NULL, 0, 0 },611{ { "ByteBinary1Bit", NULL},612PixelForByteBinary, SD_LOCK_LUT, SD_LOCK_INVCOLOR },613{ { "ByteBinary2Bit", NULL},614PixelForByteBinary, SD_LOCK_LUT, SD_LOCK_INVCOLOR },615{ { "ByteBinary4Bit", NULL},616PixelForByteBinary, SD_LOCK_LUT, SD_LOCK_INVCOLOR },617{ { "ByteIndexed", NULL},618PixelForByteIndexed, SD_LOCK_LUT, SD_LOCK_INVCOLOR },619{ { "ByteIndexedBm", NULL},620PixelForByteIndexed, SD_LOCK_LUT, SD_LOCK_INVCOLOR },621{ { "ByteGray", NULL}, PixelForByteGray, 0, 0},622{ { "Index8Gray", NULL},623PixelForIndex8Gray, SD_LOCK_LUT, SD_LOCK_INVGRAY },624{ { "Index12Gray", NULL},625PixelForIndex12Gray, SD_LOCK_LUT, SD_LOCK_INVGRAY },626{ { "AnyShort", NULL}, NULL, 0, 0 },627{ { "Ushort555Rgb", NULL}, PixelForUshort555Rgb, 0, 0},628{ { "Ushort555Rgbx", NULL}, PixelForUshort555Rgbx, 0, 0},629{ { "Ushort565Rgb", NULL}, PixelForUshort565Rgb, 0, 0 },630{ { "Ushort4444Argb", NULL}, PixelForUshort4444Argb, 0, 0 },631{ { "UshortGray", NULL}, PixelForUshortGray, 0, 0},632{ { "UshortIndexed", NULL},633PixelForUshortIndexed, SD_LOCK_LUT, SD_LOCK_INVCOLOR },634{ { "Any3Byte", NULL}, NULL, 0, 0 },635{ { "ThreeByteBgr", NULL}, NULL, 0, 0 },636{ { "AnyInt", NULL}, NULL, 0, 0 },637{ { "IntArgb", NULL}, NULL, 0, 0 },638{ { "IntArgbPre", NULL}, PixelForIntArgbPre, 0, 0},639{ { "IntArgbBm", NULL}, PixelForIntArgbBm, 0, 0},640{ { "IntRgb", NULL}, NULL, 0, 0 },641{ { "IntBgr", NULL}, PixelForIntBgr, 0, 0},642{ { "IntRgbx", NULL}, PixelForIntRgbx, 0, 0},643{ { "Any4Byte", NULL}, NULL, 0, 0 },644{ { "FourByteAbgr", NULL}, PixelForFourByteAbgr, 0, 0},645{ { "FourByteAbgrPre", NULL}, PixelForFourByteAbgrPre, 0, 0},646};647648/*649* Definition and initialization of the globally accessible CompositeTypes.650*/651struct _CompositeTypes CompositeTypes = {652{ { "SrcNoEa", NULL}, NULL, 0},653{ { "SrcOverNoEa", NULL}, NULL, SD_LOCK_RD_WR },654{ { "SrcOverNoEa", NULL}, NULL, SD_LOCK_PARTIAL_WRITE }, /* SrcOverBmNoEa */655{ { "Src", NULL}, GrPrim_CompGetAlphaInfo, 0},656{ { "SrcOver", NULL}, GrPrim_CompGetAlphaInfo, SD_LOCK_RD_WR },657{ { "Xor", NULL}, GrPrim_CompGetXorInfo, SD_LOCK_RD_WR },658{ { "AnyAlpha", NULL}, GrPrim_CompGetAlphaInfo, SD_LOCK_RD_WR },659};660661662