You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement Canvas.scale() for skia and GtkSnapshot
This commit is contained in:
@@ -121,3 +121,9 @@ JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1destroy_1canvas(JNIE
|
||||
sk_canvas_t *canvas = (sk_canvas_t *)_PTR(skia_canvas);
|
||||
sk_canvas_destroy(canvas);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1scale(JNIEnv *env, jclass class, jlong skia_canvas, jfloat sx, jfloat sy)
|
||||
{
|
||||
sk_canvas_t *canvas = (sk_canvas_t *)_PTR(skia_canvas);
|
||||
sk_canvas_scale(canvas, sx, sy);
|
||||
}
|
||||
|
||||
@@ -97,6 +97,14 @@ JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawPath
|
||||
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1destroy_1canvas
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: android_graphics_Canvas
|
||||
* Method: native_scale
|
||||
* Signature: (JFF)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1scale
|
||||
(JNIEnv *, jclass, jlong, jfloat, jfloat);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -89,6 +89,14 @@ JNIEXPORT void JNICALL Java_android_graphics_GskCanvas_native_1drawText
|
||||
JNIEXPORT void JNICALL Java_android_graphics_GskCanvas_native_1drawRoundRect
|
||||
(JNIEnv *, jobject, jlong, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jint, jfloat, jint);
|
||||
|
||||
/*
|
||||
* Class: android_graphics_GskCanvas
|
||||
* Method: native_scale
|
||||
* Signature: (JFF)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_android_graphics_GskCanvas_native_1scale
|
||||
(JNIEnv *, jobject, jlong, jfloat, jfloat);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -154,3 +154,9 @@ JNIEXPORT void JNICALL Java_android_graphics_GskCanvas_native_1drawRoundRect(JNI
|
||||
gtk_snapshot_append_border(snapshot, &round_rect, widths, gdk_color);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_android_graphics_GskCanvas_native_1scale(JNIEnv *env, jclass this_class, jlong snapshot_ptr, jfloat x, jfloat y)
|
||||
{
|
||||
GdkSnapshot *snapshot = GTK_SNAPSHOT(_PTR(snapshot_ptr));
|
||||
gtk_snapshot_scale(snapshot, x, y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user