Path: blob/master/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c
41159 views
/*1* Copyright (c) 2000, 2018, 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);7071JNIEXPORT jfieldID path2DTypesID;72JNIEXPORT jfieldID path2DNumTypesID;73JNIEXPORT jfieldID path2DWindingRuleID;74JNIEXPORT jfieldID path2DFloatCoordsID;75JNIEXPORT jfieldID sg2dStrokeHintID;76JNIEXPORT jint 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}106CHECK_NULL(RegisterID =107(*env)->GetStaticMethodID(env, GPMgr, RegisterName, RegisterSig));108CHECK_NULL(pNativePrimID = (*env)->GetFieldID(env, GP, "pNativePrim", "J"));109CHECK_NULL(pixelID = (*env)->GetFieldID(env, SG2D, "pixel", "I"));110CHECK_NULL(eargbID = (*env)->GetFieldID(env, SG2D, "eargb", "I"));111CHECK_NULL(clipRegionID =112(*env)->GetFieldID(env, SG2D, "clipRegion", "Lsun/java2d/pipe/Region;"));113CHECK_NULL(compositeID =114(*env)->GetFieldID(env, SG2D, "composite", "Ljava/awt/Composite;"));115CHECK_NULL(lcdTextContrastID =116(*env)->GetFieldID(env, SG2D, "lcdTextContrast", "I"));117CHECK_NULL(getRgbID = (*env)->GetMethodID(env, Color, "getRGB", "()I"));118CHECK_NULL(xorPixelID = (*env)->GetFieldID(env, XORComp, "xorPixel", "I"));119CHECK_NULL(xorColorID =120(*env)->GetFieldID(env, XORComp, "xorColor", "Ljava/awt/Color;"));121CHECK_NULL(alphaMaskID =122(*env)->GetFieldID(env, XORComp, "alphaMask", "I"));123CHECK_NULL(ruleID = (*env)->GetFieldID(env, AlphaComp, "rule", "I"));124CHECK_NULL(extraAlphaID =125(*env)->GetFieldID(env, AlphaComp, "extraAlpha", "F"));126127128CHECK_NULL(m00ID = (*env)->GetFieldID(env, AT, "m00", "D"));129CHECK_NULL(m01ID = (*env)->GetFieldID(env, AT, "m01", "D"));130CHECK_NULL(m02ID = (*env)->GetFieldID(env, AT, "m02", "D"));131CHECK_NULL(m10ID = (*env)->GetFieldID(env, AT, "m10", "D"));132CHECK_NULL(m11ID = (*env)->GetFieldID(env, AT, "m11", "D"));133CHECK_NULL(m12ID = (*env)->GetFieldID(env, AT, "m12", "D"));134135CHECK_NULL(path2DTypesID =136(*env)->GetFieldID(env, Path2D, "pointTypes", "[B"));137CHECK_NULL(path2DNumTypesID =138(*env)->GetFieldID(env, Path2D, "numTypes", "I"));139CHECK_NULL(path2DWindingRuleID =140(*env)->GetFieldID(env, Path2D, "windingRule", "I"));141CHECK_NULL(path2DFloatCoordsID =142(*env)->GetFieldID(env, Path2DFloat, "floatCoords", "[F"));143CHECK_NULL(sg2dStrokeHintID =144(*env)->GetFieldID(env, SG2D, "strokeHint", "I"));145CHECK_NULL(fid =146(*env)->GetStaticFieldID(env, SHints, "INTVAL_STROKE_PURE", "I"));147sunHints_INTVAL_STROKE_PURE = (*env)->GetStaticIntField(env, SHints, fid);148}149150void GrPrim_RefineBounds(SurfaceDataBounds *bounds, jint transX, jint transY,151jfloat *coords, jint maxCoords)152{153jint xmin, ymin, xmax, ymax;154if (maxCoords > 1) {155xmin = xmax = transX + (jint)(*coords++ + 0.5);156ymin = ymax = transY + (jint)(*coords++ + 0.5);157for (;maxCoords > 1; maxCoords -= 2) {158jint x = transX + (jint)(*coords++ + 0.5);159jint y = transY + (jint)(*coords++ + 0.5);160if (xmin > x) xmin = x;161if (ymin > y) ymin = y;162if (xmax < x) xmax = x;163if (ymax < y) ymax = y;164}165if (++xmax < xmin) xmax--;166if (++ymax < ymin) ymax--;167if (bounds->x1 < xmin) bounds->x1 = xmin;168if (bounds->y1 < ymin) bounds->y1 = ymin;169if (bounds->x2 > xmax) bounds->x2 = xmax;170if (bounds->y2 > ymax) bounds->y2 = ymax;171} else {172bounds->x2 = bounds->x1;173bounds->y2 = bounds->y1;174}175}176177/*178* Class: sun_java2d_loops_GraphicsPrimitiveMgr179* Method: registerNativeLoops180* Signature: ()V181*/182JNIEXPORT void JNICALL183Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops184(JNIEnv *env, jclass GPMgr)185{186RegisterFunc RegisterAnyByte;187RegisterFunc RegisterByteBinary1Bit;188RegisterFunc RegisterByteBinary2Bit;189RegisterFunc RegisterByteBinary4Bit;190RegisterFunc RegisterByteIndexed;191RegisterFunc RegisterByteGray;192RegisterFunc RegisterIndex8Gray;193RegisterFunc RegisterIndex12Gray;194RegisterFunc RegisterAnyShort;195RegisterFunc RegisterUshort555Rgb;196RegisterFunc RegisterUshort565Rgb;197RegisterFunc RegisterUshort4444Argb;198RegisterFunc RegisterUshort555Rgbx;199RegisterFunc RegisterUshortGray;200RegisterFunc RegisterUshortIndexed;201RegisterFunc RegisterAny3Byte;202RegisterFunc RegisterThreeByteBgr;203RegisterFunc RegisterAnyInt;204RegisterFunc RegisterIntArgb;205RegisterFunc RegisterIntArgbPre;206RegisterFunc RegisterIntArgbBm;207RegisterFunc RegisterIntRgb;208RegisterFunc RegisterIntBgr;209RegisterFunc RegisterIntRgbx;210RegisterFunc RegisterAny4Byte;211RegisterFunc RegisterFourByteAbgr;212RegisterFunc RegisterFourByteAbgrPre;213214if (!RegisterAnyByte(env) ||215!RegisterByteBinary1Bit(env) ||216!RegisterByteBinary2Bit(env) ||217!RegisterByteBinary4Bit(env) ||218!RegisterByteIndexed(env) ||219!RegisterByteGray(env) ||220!RegisterIndex8Gray(env) ||221!RegisterIndex12Gray(env) ||222!RegisterAnyShort(env) ||223!RegisterUshort555Rgb(env) ||224!RegisterUshort565Rgb(env) ||225!RegisterUshort4444Argb(env) ||226!RegisterUshort555Rgbx(env) ||227!RegisterUshortGray(env) ||228!RegisterUshortIndexed(env) ||229!RegisterAny3Byte(env) ||230!RegisterThreeByteBgr(env) ||231!RegisterAnyInt(env) ||232!RegisterIntArgb(env) ||233!RegisterIntArgbPre(env) ||234!RegisterIntArgbBm(env) ||235!RegisterIntRgb(env) ||236!RegisterIntBgr(env) ||237!RegisterIntRgbx(env) ||238!RegisterAny4Byte(env) ||239!RegisterFourByteAbgr(env) ||240!RegisterFourByteAbgrPre(env))241{242return;243}244}245246#define _StartOf(T) ((T *) (&T##s))247#define _NumberOf(T) (sizeof(T##s) / sizeof(T))248#define _EndOf(T) (_StartOf(T) + _NumberOf(T))249250#define PrimTypeStart _StartOf(PrimitiveType)251#define PrimTypeEnd _EndOf(PrimitiveType)252253#define SurfTypeStart _StartOf(SurfaceType)254#define SurfTypeEnd _EndOf(SurfaceType)255256#define CompTypeStart _StartOf(CompositeType)257#define CompTypeEnd _EndOf(CompositeType)258259/*260* This function initializes the global collection of PrimitiveType261* structures by retrieving the necessary Java Class object and the262* associated methodID of the necessary constructor.263*264* See PrimitiveTypes.* below.265*/266static jboolean InitPrimTypes(JNIEnv *env)267{268jboolean ok = JNI_TRUE;269PrimitiveType *pPrimType;270jclass cl;271272for (pPrimType = PrimTypeStart; pPrimType < PrimTypeEnd; pPrimType++) {273cl = (*env)->FindClass(env, pPrimType->ClassName);274if (cl == NULL) {275ok = JNI_FALSE;276break;277}278pPrimType->ClassObject = (*env)->NewGlobalRef(env, cl);279pPrimType->Constructor =280(*env)->GetMethodID(env, cl, InitName, InitSig);281282(*env)->DeleteLocalRef(env, cl);283if (pPrimType->ClassObject == NULL ||284pPrimType->Constructor == NULL)285{286ok = JNI_FALSE;287break;288}289}290291if (!ok) {292for (pPrimType = PrimTypeStart; pPrimType < PrimTypeEnd; pPrimType++) {293if (pPrimType->ClassObject != NULL) {294(*env)->DeleteGlobalRef(env, pPrimType->ClassObject);295pPrimType->ClassObject = NULL;296}297pPrimType->Constructor = NULL;298}299}300301return ok;302}303304/*305* This function initializes the global collection of SurfaceType306* or CompositeType structures by retrieving the corresponding Java307* object stored as a static field on the Java Class.308*309* See SurfaceTypes.* below.310* See CompositeeTypes.* below.311*/312static jboolean InitSimpleTypes313(JNIEnv *env, jclass SimpleClass, char *SimpleSig,314SurfCompHdr *pStart, SurfCompHdr *pEnd, jsize size)315{316jboolean ok = JNI_TRUE;317SurfCompHdr *pHdr;318jfieldID field;319jobject obj;320321for (pHdr = pStart; pHdr < pEnd; pHdr = PtrAddBytes(pHdr, size)) {322field = (*env)->GetStaticFieldID(env,323SimpleClass,324pHdr->Name,325SimpleSig);326if (field == NULL) {327ok = JNI_FALSE;328break;329}330obj = (*env)->GetStaticObjectField(env, SimpleClass, field);331if (obj == NULL) {332ok = JNI_FALSE;333break;334}335pHdr->Object = (*env)->NewGlobalRef(env, obj);336(*env)->DeleteLocalRef(env, obj);337if (pHdr->Object == NULL) {338ok = JNI_FALSE;339break;340}341}342343if (!ok) {344for (pHdr = pStart; pHdr < pEnd; pHdr = PtrAddBytes(pHdr, size)) {345if (pHdr->Object != NULL) {346(*env)->DeleteGlobalRef(env, pHdr->Object);347pHdr->Object = NULL;348}349}350}351352return ok;353}354355static jboolean InitSurfaceTypes(JNIEnv *env, jclass ST)356{357return InitSimpleTypes(env, ST, "Lsun/java2d/loops/SurfaceType;",358(SurfCompHdr *) SurfTypeStart,359(SurfCompHdr *) SurfTypeEnd,360sizeof(SurfaceType));361}362363static jboolean InitCompositeTypes(JNIEnv *env, jclass CT)364{365return InitSimpleTypes(env, CT, "Lsun/java2d/loops/CompositeType;",366(SurfCompHdr *) CompTypeStart,367(SurfCompHdr *) CompTypeEnd,368sizeof(CompositeType));369}370371/*372* This function registers a set of Java GraphicsPrimitive objects373* based on information stored in an array of NativePrimitive structures.374*/375jboolean RegisterPrimitives(JNIEnv *env,376NativePrimitive *pPrim,377jint NumPrimitives)378{379jarray primitives;380int i;381382primitives = (*env)->NewObjectArray(env, NumPrimitives,383GraphicsPrimitive, NULL);384if (primitives == NULL) {385return JNI_FALSE;386}387388for (i = 0; i < NumPrimitives; i++, pPrim++) {389jint srcflags, dstflags;390jobject prim;391PrimitiveType *pType = pPrim->pPrimType;392SurfaceType *pSrc = pPrim->pSrcType;393CompositeType *pComp = pPrim->pCompType;394SurfaceType *pDst = pPrim->pDstType;395396pPrim->funcs.initializer = pPrim->funcs_c.initializer;397398/*399* Calculate the necessary SurfaceData lock flags for the400* source and destination surfaces based on the information401* stored in the PrimitiveType, SurfaceType, and CompositeType402* structures. The starting point is the values that are403* already stored in the NativePrimitive structure. These404* flags are usually left as 0, but can be filled in by405* native primitive loops that have special needs that are406* not deducible from their declared attributes.407*/408srcflags = pPrim->srcflags;409dstflags = pPrim->dstflags;410srcflags |= pType->srcflags;411dstflags |= pType->dstflags;412dstflags |= pComp->dstflags;413if (srcflags & SD_LOCK_READ) srcflags |= pSrc->readflags;414/* if (srcflags & SD_LOCK_WRITE) srcflags |= pSrc->writeflags; */415if (dstflags & SD_LOCK_READ) dstflags |= pDst->readflags;416if (dstflags & SD_LOCK_WRITE) dstflags |= pDst->writeflags;417pPrim->srcflags = srcflags;418pPrim->dstflags = dstflags;419420prim = (*env)->NewObject(env,421pType->ClassObject,422pType->Constructor,423ptr_to_jlong(pPrim),424pSrc->hdr.Object,425pComp->hdr.Object,426pDst->hdr.Object);427if (prim == NULL) {428break;429}430(*env)->SetObjectArrayElement(env, primitives, i, prim);431(*env)->DeleteLocalRef(env, prim);432if ((*env)->ExceptionCheck(env)) {433break;434}435}436437if (i >= NumPrimitives) {438/* No error - upcall to GraphicsPrimitiveMgr to register the439* new primitives... */440(*env)->CallStaticVoidMethod(env, GraphicsPrimitiveMgr, RegisterID,441primitives);442}443(*env)->DeleteLocalRef(env, primitives);444445return !((*env)->ExceptionCheck(env));446}447448JNIEXPORT NativePrimitive * JNICALL449GetNativePrim(JNIEnv *env, jobject gp)450{451NativePrimitive *pPrim;452453pPrim = (NativePrimitive *) JNU_GetLongFieldAsPtr(env, gp, pNativePrimID);454if (pPrim == NULL) {455JNU_ThrowInternalError(env, "Non-native Primitive invoked natively");456}457458return pPrim;459}460461JNIEXPORT void JNICALL462GrPrim_Sg2dGetCompInfo(JNIEnv *env, jobject sg2d,463NativePrimitive *pPrim, CompositeInfo *pCompInfo)464{465jobject comp;466467comp = (*env)->GetObjectField(env, sg2d, compositeID);468(*pPrim->pCompType->getCompInfo)(env, pCompInfo, comp);469(*env)->DeleteLocalRef(env, comp);470}471472JNIEXPORT jint JNICALL473GrPrim_CompGetXorColor(JNIEnv *env, jobject comp)474{475jobject color;476jint rgb;477478color = (*env)->GetObjectField(env, comp, xorColorID);479rgb = (*env)->CallIntMethod(env, color, getRgbID);480(*env)->DeleteLocalRef(env, color);481482return rgb;483}484485JNIEXPORT void JNICALL486GrPrim_Sg2dGetClip(JNIEnv *env, jobject sg2d, SurfaceDataBounds *bounds)487{488jobject clip = (*env)->GetObjectField(env, sg2d, clipRegionID);489Region_GetBounds(env, clip, bounds);490}491492JNIEXPORT jint JNICALL493GrPrim_Sg2dGetPixel(JNIEnv *env, jobject sg2d)494{495return (*env)->GetIntField(env, sg2d, pixelID);496}497498JNIEXPORT jint JNICALL499GrPrim_Sg2dGetEaRGB(JNIEnv *env, jobject sg2d)500{501return (*env)->GetIntField(env, sg2d, eargbID);502}503504JNIEXPORT jint JNICALL505GrPrim_Sg2dGetLCDTextContrast(JNIEnv *env, jobject sg2d)506{507return (*env)->GetIntField(env, sg2d, lcdTextContrastID);508}509510/*511* Helper function for CompositeTypes.Xor512*/513JNIEXPORT void JNICALL514GrPrim_CompGetXorInfo(JNIEnv *env, CompositeInfo *pCompInfo, jobject comp)515{516pCompInfo->rule = RULE_Xor;517pCompInfo->details.xorPixel = (*env)->GetIntField(env, comp, xorPixelID);518pCompInfo->alphaMask = (*env)->GetIntField(env, comp, alphaMaskID);519}520521/*522* Helper function for CompositeTypes.AnyAlpha523*/524JNIEXPORT void JNICALL525GrPrim_CompGetAlphaInfo(JNIEnv *env, CompositeInfo *pCompInfo, jobject comp)526{527pCompInfo->rule =528(*env)->GetIntField(env, comp, ruleID);529pCompInfo->details.extraAlpha =530(*env)->GetFloatField(env, comp, extraAlphaID);531}532533JNIEXPORT void JNICALL534Transform_GetInfo(JNIEnv *env, jobject txform, TransformInfo *pTxInfo)535{536pTxInfo->dxdx = (*env)->GetDoubleField(env, txform, m00ID);537pTxInfo->dxdy = (*env)->GetDoubleField(env, txform, m01ID);538pTxInfo->tx = (*env)->GetDoubleField(env, txform, m02ID);539pTxInfo->dydx = (*env)->GetDoubleField(env, txform, m10ID);540pTxInfo->dydy = (*env)->GetDoubleField(env, txform, m11ID);541pTxInfo->ty = (*env)->GetDoubleField(env, txform, m12ID);542}543544JNIEXPORT void JNICALL545Transform_transform(TransformInfo *pTxInfo, jdouble *pX, jdouble *pY)546{547jdouble x = *pX;548jdouble y = *pY;549550*pX = pTxInfo->dxdx * x + pTxInfo->dxdy * y + pTxInfo->tx;551*pY = pTxInfo->dydx * x + pTxInfo->dydy * y + pTxInfo->ty;552}553554/*555* External declarations for the pixelFor helper methods for the various556* named surface types. These functions are defined in the various557* files that contain the loop functions for their type.558*/559extern PixelForFunc PixelForByteBinary;560extern PixelForFunc PixelForByteIndexed;561extern PixelForFunc PixelForByteGray;562extern PixelForFunc PixelForIndex8Gray;563extern PixelForFunc PixelForIndex12Gray;564extern PixelForFunc PixelForUshort555Rgb;565extern PixelForFunc PixelForUshort555Rgbx;566extern PixelForFunc PixelForUshort565Rgb;567extern PixelForFunc PixelForUshort4444Argb;568extern PixelForFunc PixelForUshortGray;569extern PixelForFunc PixelForUshortIndexed;570extern PixelForFunc PixelForIntArgbPre;571extern PixelForFunc PixelForIntArgbBm;572extern PixelForFunc PixelForIntBgr;573extern PixelForFunc PixelForIntRgbx;574extern PixelForFunc PixelForFourByteAbgr;575extern PixelForFunc PixelForFourByteAbgrPre;576577/*578* Definition and initialization of the globally accessible PrimitiveTypes.579*/580struct _PrimitiveTypes PrimitiveTypes = {581{ "sun/java2d/loops/Blit", SD_LOCK_READ, SD_LOCK_WRITE, NULL, NULL},582{ "sun/java2d/loops/BlitBg", SD_LOCK_READ, SD_LOCK_WRITE, NULL, NULL},583{ "sun/java2d/loops/ScaledBlit", SD_LOCK_READ, SD_LOCK_WRITE, NULL, NULL},584{ "sun/java2d/loops/FillRect", 0, SD_LOCK_WRITE, NULL, NULL},585{ "sun/java2d/loops/FillSpans", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},586{ "sun/java2d/loops/FillParallelogram", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},587{ "sun/java2d/loops/DrawParallelogram", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},588{ "sun/java2d/loops/DrawLine", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},589{ "sun/java2d/loops/DrawRect", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},590{ "sun/java2d/loops/DrawPolygons", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},591{ "sun/java2d/loops/DrawPath", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},592{ "sun/java2d/loops/FillPath", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL},593{ "sun/java2d/loops/MaskBlit", SD_LOCK_READ, SD_LOCK_RD_WR, NULL, NULL},594{ "sun/java2d/loops/MaskFill", 0, SD_LOCK_RD_WR, NULL, NULL},595{ "sun/java2d/loops/DrawGlyphList", 0, SD_LOCK_PARTIAL_WRITE |596SD_LOCK_FASTEST, NULL, NULL},597{ "sun/java2d/loops/DrawGlyphListAA", 0, SD_LOCK_RD_WR | SD_LOCK_FASTEST, NULL, NULL},598{ "sun/java2d/loops/DrawGlyphListLCD", 0, SD_LOCK_RD_WR | SD_LOCK_FASTEST, NULL, NULL},599{ "sun/java2d/loops/TransformHelper", SD_LOCK_READ, 0, NULL, NULL}600};601602/*603* Definition and initialization of the globally accessible SurfaceTypes.604*/605struct _SurfaceTypes SurfaceTypes = {606{ { "OpaqueColor", NULL}, NULL, 0, 0 },607{ { "AnyColor", NULL}, NULL, 0, 0 },608{ { "AnyByte", NULL}, NULL, 0, 0 },609{ { "ByteBinary1Bit", NULL},610PixelForByteBinary, SD_LOCK_LUT, SD_LOCK_INVCOLOR },611{ { "ByteBinary2Bit", NULL},612PixelForByteBinary, SD_LOCK_LUT, SD_LOCK_INVCOLOR },613{ { "ByteBinary4Bit", NULL},614PixelForByteBinary, SD_LOCK_LUT, SD_LOCK_INVCOLOR },615{ { "ByteIndexed", NULL},616PixelForByteIndexed, SD_LOCK_LUT, SD_LOCK_INVCOLOR },617{ { "ByteIndexedBm", NULL},618PixelForByteIndexed, SD_LOCK_LUT, SD_LOCK_INVCOLOR },619{ { "ByteGray", NULL}, PixelForByteGray, 0, 0},620{ { "Index8Gray", NULL},621PixelForIndex8Gray, SD_LOCK_LUT, SD_LOCK_INVGRAY },622{ { "Index12Gray", NULL},623PixelForIndex12Gray, SD_LOCK_LUT, SD_LOCK_INVGRAY },624{ { "AnyShort", NULL}, NULL, 0, 0 },625{ { "Ushort555Rgb", NULL}, PixelForUshort555Rgb, 0, 0},626{ { "Ushort555Rgbx", NULL}, PixelForUshort555Rgbx, 0, 0},627{ { "Ushort565Rgb", NULL}, PixelForUshort565Rgb, 0, 0 },628{ { "Ushort4444Argb", NULL}, PixelForUshort4444Argb, 0, 0 },629{ { "UshortGray", NULL}, PixelForUshortGray, 0, 0},630{ { "UshortIndexed", NULL},631PixelForUshortIndexed, SD_LOCK_LUT, SD_LOCK_INVCOLOR },632{ { "Any3Byte", NULL}, NULL, 0, 0 },633{ { "ThreeByteBgr", NULL}, NULL, 0, 0 },634{ { "AnyInt", NULL}, NULL, 0, 0 },635{ { "IntArgb", NULL}, NULL, 0, 0 },636{ { "IntArgbPre", NULL}, PixelForIntArgbPre, 0, 0},637{ { "IntArgbBm", NULL}, PixelForIntArgbBm, 0, 0},638{ { "IntRgb", NULL}, NULL, 0, 0 },639{ { "IntBgr", NULL}, PixelForIntBgr, 0, 0},640{ { "IntRgbx", NULL}, PixelForIntRgbx, 0, 0},641{ { "Any4Byte", NULL}, NULL, 0, 0 },642{ { "FourByteAbgr", NULL}, PixelForFourByteAbgr, 0, 0},643{ { "FourByteAbgrPre", NULL}, PixelForFourByteAbgrPre, 0, 0},644};645646/*647* Definition and initialization of the globally accessible CompositeTypes.648*/649struct _CompositeTypes CompositeTypes = {650{ { "SrcNoEa", NULL}, NULL, 0},651{ { "SrcOverNoEa", NULL}, NULL, SD_LOCK_RD_WR },652{ { "SrcOverNoEa", NULL}, NULL, SD_LOCK_PARTIAL_WRITE }, /* SrcOverBmNoEa */653{ { "Src", NULL}, GrPrim_CompGetAlphaInfo, 0},654{ { "SrcOver", NULL}, GrPrim_CompGetAlphaInfo, SD_LOCK_RD_WR },655{ { "Xor", NULL}, GrPrim_CompGetXorInfo, SD_LOCK_RD_WR },656{ { "AnyAlpha", NULL}, GrPrim_CompGetAlphaInfo, SD_LOCK_RD_WR },657};658659660