665 srcRow += 3*srcRowBytes;
666 dstRow += dstRowBytes;
667 height -= 3;
668 }
669 }
670
671
672 /*
673 * Class: sun_font_FreetypeFontScaler
674 * Method: getGlyphImageNative
675 * Signature: (Lsun/font/Font2D;JI)J
676 */
677 JNIEXPORT jlong JNICALL
678 Java_sun_font_FreetypeFontScaler_getGlyphImageNative(
679 JNIEnv *env, jobject scaler, jobject font2D,
680 jlong pScalerContext, jlong pScaler, jint glyphCode) {
681
682 int error, imageSize;
683 UInt16 width, height;
684 GlyphInfo *glyphInfo;
685 int renderFlags = FT_LOAD_RENDER, target;
686 FT_GlyphSlot ftglyph;
687
688 FTScalerContext* context =
689 (FTScalerContext*) jlong_to_ptr(pScalerContext);
690 FTScalerInfo *scalerInfo =
691 (FTScalerInfo*) jlong_to_ptr(pScaler);
692
693 if (isNullScalerContext(context) || scalerInfo == NULL) {
694 return ptr_to_jlong(getNullGlyphImage());
695 }
696
697 error = setupFTContext(env, font2D, scalerInfo, context);
698 if (error) {
699 invalidateJavaScaler(env, scaler, scalerInfo);
700 return ptr_to_jlong(getNullGlyphImage());
701 }
702
703 if (!context->useSbits) {
704 renderFlags |= FT_LOAD_NO_BITMAP;
705 }
|
665 srcRow += 3*srcRowBytes;
666 dstRow += dstRowBytes;
667 height -= 3;
668 }
669 }
670
671
672 /*
673 * Class: sun_font_FreetypeFontScaler
674 * Method: getGlyphImageNative
675 * Signature: (Lsun/font/Font2D;JI)J
676 */
677 JNIEXPORT jlong JNICALL
678 Java_sun_font_FreetypeFontScaler_getGlyphImageNative(
679 JNIEnv *env, jobject scaler, jobject font2D,
680 jlong pScalerContext, jlong pScaler, jint glyphCode) {
681
682 int error, imageSize;
683 UInt16 width, height;
684 GlyphInfo *glyphInfo;
685 int renderFlags = FT_LOAD_DEFAULT, target;
686 FT_GlyphSlot ftglyph;
687
688 FTScalerContext* context =
689 (FTScalerContext*) jlong_to_ptr(pScalerContext);
690 FTScalerInfo *scalerInfo =
691 (FTScalerInfo*) jlong_to_ptr(pScaler);
692
693 if (isNullScalerContext(context) || scalerInfo == NULL) {
694 return ptr_to_jlong(getNullGlyphImage());
695 }
696
697 error = setupFTContext(env, font2D, scalerInfo, context);
698 if (error) {
699 invalidateJavaScaler(env, scaler, scalerInfo);
700 return ptr_to_jlong(getNullGlyphImage());
701 }
702
703 if (!context->useSbits) {
704 renderFlags |= FT_LOAD_NO_BITMAP;
705 }
|