< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m

Print this page

        

*** 589,599 **** * CoreText path... */ static inline GlyphInfo * CGGI_CreateImageForUnicode (CGGI_GlyphCanvas *canvas, const AWTStrike *strike, ! const CGGI_RenderingMode *mode, const UniChar uniChar) { // save the state of the world CGContextSaveGState(canvas->context); // get the glyph, measure it using CG --- 589,599 ---- * CoreText path... */ static inline GlyphInfo * CGGI_CreateImageForUnicode (CGGI_GlyphCanvas *canvas, const AWTStrike *strike, ! const CGGI_RenderingMode *mode, const UnicodeScalarValue uniChar) { // save the state of the world CGContextSaveGState(canvas->context); // get the glyph, measure it using CG
*** 666,676 **** static void CGGI_FillImagesForGlyphsWithSizedCanvas(CGGI_GlyphCanvas *canvas, const AWTStrike *strike, const CGGI_RenderingMode *mode, jlong glyphInfos[], ! const UniChar uniChars[], const CGGlyph glyphs[], const CFIndex len) { CGContextSetTextMatrix(canvas->context, strike->fAltTx); --- 666,676 ---- static void CGGI_FillImagesForGlyphsWithSizedCanvas(CGGI_GlyphCanvas *canvas, const AWTStrike *strike, const CGGI_RenderingMode *mode, jlong glyphInfos[], ! const UnicodeScalarValue uniChars[], const CGGlyph glyphs[], const CFIndex len) { CGContextSetTextMatrix(canvas->context, strike->fAltTx);
*** 718,728 **** * the glyphs, and destroy it. */ static inline void CGGI_FillImagesForGlyphs(jlong *glyphInfos, const AWTStrike *strike, const CGGI_RenderingMode *mode, ! const UniChar uniChars[], const CGGlyph glyphs[], const size_t maxWidth, const size_t maxHeight, const CFIndex len) { if (maxWidth*maxHeight*CGGI_GLYPH_CANVAS_SLACK*CGGI_GLYPH_CANVAS_SLACK > CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_SLACK*CGGI_GLYPH_CANVAS_SLACK) --- 718,728 ---- * the glyphs, and destroy it. */ static inline void CGGI_FillImagesForGlyphs(jlong *glyphInfos, const AWTStrike *strike, const CGGI_RenderingMode *mode, ! const UnicodeScalarValue uniChars[], const CGGlyph glyphs[], const size_t maxWidth, const size_t maxHeight, const CFIndex len) { if (maxWidth*maxHeight*CGGI_GLYPH_CANVAS_SLACK*CGGI_GLYPH_CANVAS_SLACK > CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_SLACK*CGGI_GLYPH_CANVAS_SLACK)
*** 765,775 **** * The image immediately follows the struct physically in memory. */ static inline void CGGI_CreateGlyphInfos(jlong *glyphInfos, const AWTStrike *strike, const CGGI_RenderingMode *mode, ! const UniChar uniChars[], const CGGlyph glyphs[], CGSize advances[], CGRect bboxes[], const CFIndex len) { AWTFont *font = strike->fAWTFont; CGAffineTransform tx = strike->fTx; JRSFontRenderingStyle bboxCGMode = JRSFontAlignStyleForFractionalMeasurement(strike->fStyle); --- 765,775 ---- * The image immediately follows the struct physically in memory. */ static inline void CGGI_CreateGlyphInfos(jlong *glyphInfos, const AWTStrike *strike, const CGGI_RenderingMode *mode, ! const UnicodeScalarValue uniChars[], const CGGlyph glyphs[], CGSize advances[], CGRect bboxes[], const CFIndex len) { AWTFont *font = strike->fAWTFont; CGAffineTransform tx = strike->fTx; JRSFontRenderingStyle bboxCGMode = JRSFontAlignStyleForFractionalMeasurement(strike->fStyle);
*** 815,825 **** static void CGGI_CreateGlyphsAndScanForComplexities(jlong *glyphInfos, const AWTStrike *strike, const CGGI_RenderingMode *mode, jint rawGlyphCodes[], ! UniChar uniChars[], CGGlyph glyphs[], CGSize advances[], CGRect bboxes[], const CFIndex len) { CFIndex i; for (i = 0; i < len; i++) { --- 815,825 ---- static void CGGI_CreateGlyphsAndScanForComplexities(jlong *glyphInfos, const AWTStrike *strike, const CGGI_RenderingMode *mode, jint rawGlyphCodes[], ! UnicodeScalarValue uniChars[], CGGlyph glyphs[], CGSize advances[], CGRect bboxes[], const CFIndex len) { CFIndex i; for (i = 0; i < len; i++) {
*** 858,888 **** if (len < MAX_STACK_ALLOC_GLYPH_BUFFER_SIZE) { CGRect bboxes[len]; CGSize advances[len]; CGGlyph glyphs[len]; ! UniChar uniChars[len]; CGGI_CreateGlyphsAndScanForComplexities(glyphInfos, strike, &mode, rawGlyphCodes, uniChars, glyphs, advances, bboxes, len); return; } // just do one malloc, and carve it up for all the buffers void *buffer = malloc(sizeof(CGRect) * sizeof(CGSize) * ! sizeof(CGGlyph) * sizeof(UniChar) * len); if (buffer == NULL) { [[NSException exceptionWithName:NSMallocException reason:@"Failed to allocate memory for the temporary glyph strike and measurement buffers." userInfo:nil] raise]; } CGRect *bboxes = (CGRect *)(buffer); CGSize *advances = (CGSize *)(bboxes + sizeof(CGRect) * len); CGGlyph *glyphs = (CGGlyph *)(advances + sizeof(CGGlyph) * len); ! UniChar *uniChars = (UniChar *)(glyphs + sizeof(UniChar) * len); CGGI_CreateGlyphsAndScanForComplexities(glyphInfos, strike, &mode, rawGlyphCodes, uniChars, glyphs, advances, bboxes, len); --- 858,888 ---- if (len < MAX_STACK_ALLOC_GLYPH_BUFFER_SIZE) { CGRect bboxes[len]; CGSize advances[len]; CGGlyph glyphs[len]; ! UnicodeScalarValue uniChars[len]; CGGI_CreateGlyphsAndScanForComplexities(glyphInfos, strike, &mode, rawGlyphCodes, uniChars, glyphs, advances, bboxes, len); return; } // just do one malloc, and carve it up for all the buffers void *buffer = malloc(sizeof(CGRect) * sizeof(CGSize) * ! sizeof(CGGlyph) * sizeof(UnicodeScalarValue) * len); if (buffer == NULL) { [[NSException exceptionWithName:NSMallocException reason:@"Failed to allocate memory for the temporary glyph strike and measurement buffers." userInfo:nil] raise]; } CGRect *bboxes = (CGRect *)(buffer); CGSize *advances = (CGSize *)(bboxes + sizeof(CGRect) * len); CGGlyph *glyphs = (CGGlyph *)(advances + sizeof(CGGlyph) * len); ! UnicodeScalarValue *uniChars = (UnicodeScalarValue *)(glyphs + sizeof(UnicodeScalarValue) * len); CGGI_CreateGlyphsAndScanForComplexities(glyphInfos, strike, &mode, rawGlyphCodes, uniChars, glyphs, advances, bboxes, len);
< prev index next >