< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m

Print this page

        

*** 273,283 **** PRINT(" contextQuartzLinearGradientPath"); CGContextRef cgRef = qsdo->cgRef; StateGradientInfo *gradientInfo = qsdo->gradientInfo; ! CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); size_t num_locations = gradientInfo->fractionsLength; CGFloat *locations = (CGFloat *) malloc(sizeof(CGFloat) * num_locations); int i = 0; size_t component_size = num_locations * 4; --- 273,283 ---- PRINT(" contextQuartzLinearGradientPath"); CGContextRef cgRef = qsdo->cgRef; StateGradientInfo *gradientInfo = qsdo->gradientInfo; ! CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); size_t num_locations = gradientInfo->fractionsLength; CGFloat *locations = (CGFloat *) malloc(sizeof(CGFloat) * num_locations); int i = 0; size_t component_size = num_locations * 4;
*** 287,305 **** for (i = 0; i < num_locations; i++) { locations[i] = gradientInfo->fractionsdata[i]; } for (i = 0; i < component_size; i++) { components[i] = gradientInfo->colordata[i]; ! } CGContextSaveGState(cgRef); gradient = CGGradientCreateWithColorComponents(colorspace, components, locations, num_locations); if (qsdo->isEvenOddFill) { CGContextEOClip(cgRef); } else { CGContextClip(cgRef); } ! CGContextDrawLinearGradient(cgRef, gradient, gradientInfo->start, gradientInfo->end, kCGGradientDrawsAfterEndLocation); CGContextRestoreGState(cgRef); CGColorSpaceRelease(colorspace); CGGradientRelease(gradient); free(locations); --- 287,305 ---- for (i = 0; i < num_locations; i++) { locations[i] = gradientInfo->fractionsdata[i]; } for (i = 0; i < component_size; i++) { components[i] = gradientInfo->colordata[i]; ! } CGContextSaveGState(cgRef); gradient = CGGradientCreateWithColorComponents(colorspace, components, locations, num_locations); if (qsdo->isEvenOddFill) { CGContextEOClip(cgRef); } else { CGContextClip(cgRef); } ! CGContextDrawLinearGradient(cgRef, gradient, gradientInfo->start, gradientInfo->end, kCGGradientDrawsAfterEndLocation); CGContextRestoreGState(cgRef); CGColorSpaceRelease(colorspace); CGGradientRelease(gradient); free(locations);
*** 312,322 **** PRINT(" contextQuartzRadialGradientPath"); CGContextRef cgRef = qsdo->cgRef; StateGradientInfo *gradientInfo = qsdo->gradientInfo; ! CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); size_t num_locations = gradientInfo->fractionsLength; CGFloat *locations = (CGFloat *) malloc(sizeof(CGFloat) * num_locations); int i = 0; size_t component_size = num_locations * 4; --- 312,322 ---- PRINT(" contextQuartzRadialGradientPath"); CGContextRef cgRef = qsdo->cgRef; StateGradientInfo *gradientInfo = qsdo->gradientInfo; ! CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); size_t num_locations = gradientInfo->fractionsLength; CGFloat *locations = (CGFloat *) malloc(sizeof(CGFloat) * num_locations); int i = 0; size_t component_size = num_locations * 4;
*** 328,347 **** for (i = 0; i < num_locations; i++) { locations[i] = gradientInfo->fractionsdata[i]; } for (i = 0; i < component_size; i++) { components[i] = gradientInfo->colordata[i]; ! } CGContextSaveGState(cgRef); gradient = CGGradientCreateWithColorComponents(colorspace, components, locations, num_locations); if (qsdo->isEvenOddFill) { CGContextEOClip(cgRef); } else { CGContextClip(cgRef); } ! CGContextDrawRadialGradient(cgRef, gradient, gradientInfo->start, 0, gradientInfo->end, endRadius, kCGGradientDrawsAfterEndLocation); ! CGContextRestoreGState(cgRef); CGColorSpaceRelease(colorspace); CGGradientRelease(gradient); free(locations); free(gradientInfo->colordata); --- 328,347 ---- for (i = 0; i < num_locations; i++) { locations[i] = gradientInfo->fractionsdata[i]; } for (i = 0; i < component_size; i++) { components[i] = gradientInfo->colordata[i]; ! } CGContextSaveGState(cgRef); gradient = CGGradientCreateWithColorComponents(colorspace, components, locations, num_locations); if (qsdo->isEvenOddFill) { CGContextEOClip(cgRef); } else { CGContextClip(cgRef); } ! CGContextDrawRadialGradient(cgRef, gradient, gradientInfo->start, 0, gradientInfo->end, endRadius, kCGGradientDrawsAfterEndLocation); ! CGContextRestoreGState(cgRef); CGColorSpaceRelease(colorspace); CGGradientRelease(gradient); free(locations); free(gradientInfo->colordata);
*** 349,359 **** } static inline void contextGradientPath(QuartzSDOps* qsdo) { PRINT(" ContextGradientPath") ! CGContextRef cgRef = qsdo->cgRef; StateShadingInfo* shadingInfo = qsdo->shadingInfo; CGRect bounds = CGContextGetClipBoundingBox(cgRef); --- 349,359 ---- } static inline void contextGradientPath(QuartzSDOps* qsdo) { PRINT(" ContextGradientPath") ! CGContextRef cgRef = qsdo->cgRef; StateShadingInfo* shadingInfo = qsdo->shadingInfo; CGRect bounds = CGContextGetClipBoundingBox(cgRef);
*** 923,933 **** qsdo->gradientInfo->start.x = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColorx1Index]; qsdo->gradientInfo->start.y = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColory1Index]; qsdo->gradientInfo->end.x = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColorx2Index]; qsdo->gradientInfo->end.y = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColory2Index]; ! jobject colorArray = ((*env)->GetObjectArrayElement(env, qsdo->javaGraphicsStatesObjects, sun_java2d_OSXSurfaceData_kColorArrayIndex)); if (colorArray != NULL) { jint length = (*env)->GetArrayLength(env, colorArray); jint* jcolorData = (jint*)(*env)->GetPrimitiveArrayCritical(env, colorArray, NULL); --- 923,933 ---- qsdo->gradientInfo->start.x = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColorx1Index]; qsdo->gradientInfo->start.y = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColory1Index]; qsdo->gradientInfo->end.x = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColorx2Index]; qsdo->gradientInfo->end.y = javaFloatGraphicsStates[sun_java2d_OSXSurfaceData_kColory2Index]; ! jobject colorArray = ((*env)->GetObjectArrayElement(env, qsdo->javaGraphicsStatesObjects, sun_java2d_OSXSurfaceData_kColorArrayIndex)); if (colorArray != NULL) { jint length = (*env)->GetArrayLength(env, colorArray); jint* jcolorData = (jint*)(*env)->GetPrimitiveArrayCritical(env, colorArray, NULL);
*** 947,957 **** qsdo->gradientInfo->colordata[i*4+3] = ((jcolorData[i]>>24)&0xff)*kColorConversionMultiplier; } } (*env)->ReleasePrimitiveArrayCritical(env, colorArray, jcolorData, 0); } ! jobject fractionsArray = ((*env)->GetObjectArrayElement(env, qsdo->javaGraphicsStatesObjects, sun_java2d_OSXSurfaceData_kFractionsArrayIndex)); if (fractionsArray != NULL) { jint length = (*env)->GetArrayLength(env, fractionsArray); qsdo->gradientInfo->fractionsLength = length; --- 947,957 ---- qsdo->gradientInfo->colordata[i*4+3] = ((jcolorData[i]>>24)&0xff)*kColorConversionMultiplier; } } (*env)->ReleasePrimitiveArrayCritical(env, colorArray, jcolorData, 0); } ! jobject fractionsArray = ((*env)->GetObjectArrayElement(env, qsdo->javaGraphicsStatesObjects, sun_java2d_OSXSurfaceData_kFractionsArrayIndex)); if (fractionsArray != NULL) { jint length = (*env)->GetArrayLength(env, fractionsArray); qsdo->gradientInfo->fractionsLength = length;
*** 965,975 **** { qsdo->gradientInfo->fractionsdata[i] = jfractionsData[i]; } (*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, jfractionsData, 0); } ! } } SDRenderType SetUpPaint(JNIEnv *env, QuartzSDOps *qsdo, SDRenderType renderType) { CGContextRef cgRef = qsdo->cgRef; --- 965,975 ---- { qsdo->gradientInfo->fractionsdata[i] = jfractionsData[i]; } (*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, jfractionsData, 0); } ! } } SDRenderType SetUpPaint(JNIEnv *env, QuartzSDOps *qsdo, SDRenderType renderType) { CGContextRef cgRef = qsdo->cgRef;
< prev index next >