8338570: sun/font/HBShaper - mismatch in return type of FFM upcall function description and native invocation

Reviewed-by: serb, aivanov
This commit is contained in:
Phil Race 2024-10-21 18:23:13 +00:00
parent 71583222eb
commit e0c6480cd3
3 changed files with 6 additions and 8 deletions

View File

@ -187,7 +187,6 @@ public class HBShaper {
dispose_face_handle = tmp3; dispose_face_handle = tmp3;
FunctionDescriptor shapeDesc = FunctionDescriptor.ofVoid( FunctionDescriptor shapeDesc = FunctionDescriptor.ofVoid(
//JAVA_INT, // return type
JAVA_FLOAT, // ptSize JAVA_FLOAT, // ptSize
ADDRESS, // matrix ADDRESS, // matrix
ADDRESS, // face ADDRESS, // face
@ -470,7 +469,7 @@ public class HBShaper {
MemorySegment matrix = arena.allocateFrom(JAVA_FLOAT, mat); MemorySegment matrix = arena.allocateFrom(JAVA_FLOAT, mat);
MemorySegment chars = arena.allocateFrom(JAVA_CHAR, text); MemorySegment chars = arena.allocateFrom(JAVA_CHAR, text);
/*int ret =*/ jdk_hb_shape_handle.invokeExact( jdk_hb_shape_handle.invokeExact(
ptSize, matrix, hbface, chars, text.length, ptSize, matrix, hbface, chars, text.length,
script, offset, limit, script, offset, limit,
baseIndex, startX, startY, flags, slot, baseIndex, startX, startY, flags, slot,

View File

@ -63,7 +63,7 @@ static float euclidianDistance(float a, float b)
#define TYPO_LIGA 0x00000002 #define TYPO_LIGA 0x00000002
#define TYPO_RTL 0x80000000 #define TYPO_RTL 0x80000000
JDKEXPORT int jdk_hb_shape( JDKEXPORT void jdk_hb_shape(
float ptSize, float ptSize,
float *matrix, float *matrix,
void* pFace, void* pFace,
@ -92,7 +92,6 @@ JDKEXPORT int jdk_hb_shape(
int featureCount = 0; int featureCount = 0;
char* kern = (flags & TYPO_KERN) ? "kern" : "-kern"; char* kern = (flags & TYPO_KERN) ? "kern" : "-kern";
char* liga = (flags & TYPO_LIGA) ? "liga" : "-liga"; char* liga = (flags & TYPO_LIGA) ? "liga" : "-liga";
int ret;
unsigned int buflen; unsigned int buflen;
float devScale = 1.0f; float devScale = 1.0f;
@ -132,7 +131,7 @@ JDKEXPORT int jdk_hb_shape(
glyphInfo = hb_buffer_get_glyph_infos(buffer, 0); glyphInfo = hb_buffer_get_glyph_infos(buffer, 0);
glyphPos = hb_buffer_get_glyph_positions(buffer, &buflen); glyphPos = hb_buffer_get_glyph_positions(buffer, &buflen);
ret = (*store_layout_results_fn) (*store_layout_results_fn)
(slot, baseIndex, offset, startX, startY, devScale, (slot, baseIndex, offset, startX, startY, devScale,
charCount, glyphCount, glyphInfo, glyphPos); charCount, glyphCount, glyphInfo, glyphPos);
@ -141,5 +140,5 @@ JDKEXPORT int jdk_hb_shape(
if (features != NULL) { if (features != NULL) {
free(features); free(features);
} }
return ret; return;
} }

View File

@ -56,13 +56,13 @@ hb_font_t* jdk_font_create_hbp(
hb_font_funcs_t* font_funcs); hb_font_funcs_t* font_funcs);
typedef int (*store_layoutdata_func_t) typedef void (*store_layoutdata_func_t)
(int slot, int baseIndex, int offset, (int slot, int baseIndex, int offset,
float startX, float startY, float devScale, float startX, float startY, float devScale,
int charCount, int glyphCount, int charCount, int glyphCount,
hb_glyph_info_t *glyphInfo, hb_glyph_position_t *glyphPos); hb_glyph_info_t *glyphInfo, hb_glyph_position_t *glyphPos);
JDKEXPORT int jdk_hb_shape( JDKEXPORT void jdk_hb_shape(
float ptSize, float ptSize,
float *matrix, float *matrix,