Skip to content

Commit 9e73ff1

Browse files
authored
Revert 0.8.22 changes: remove PictureFilterCanvas (#1013)
That approach worked but had performance issues. Also, `SkPicture` is immutable by design, so we shouldn't try to change that. #1014 is a more correct and efficient way to implement it
1 parent 555dcff commit 9e73ff1

File tree

8 files changed

+0
-286
lines changed

8 files changed

+0
-286
lines changed

skiko/src/commonMain/kotlin/org/jetbrains/skia/PictureFilterCanvas.kt

Lines changed: 0 additions & 48 deletions
This file was deleted.

skiko/src/commonTest/kotlin/org/jetbrains/skia/PictureFilterCanvasTest.kt

Lines changed: 0 additions & 45 deletions
This file was deleted.

skiko/src/jvmMain/cpp/common/PictureFilterCanvas.cc

Lines changed: 0 additions & 38 deletions
This file was deleted.

skiko/src/jvmMain/cpp/common/interop.cc

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -653,39 +653,6 @@ namespace skija {
653653
}
654654
}
655655

656-
namespace PictureFilterCanvas {
657-
JavaVM* _vm;
658-
jmethodID onDrawPictureId;
659-
660-
void onLoad(JNIEnv* env) {
661-
env->GetJavaVM(&_vm);
662-
jclass local = env->FindClass("org/jetbrains/skia/PictureFilterCanvas");
663-
onDrawPictureId = env->GetMethodID(local, "onDrawPicture", "(JJJ)Z");
664-
}
665-
666-
void onUnload(JNIEnv* env) {
667-
}
668-
669-
bool onDrawPicture(jobject obj, const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) {
670-
JNIEnv *env;
671-
_vm->AttachCurrentThread(AS_JNI_ENV_PTR(&env), NULL);
672-
jboolean result = env->CallBooleanMethod(obj, onDrawPictureId, reinterpret_cast<jlong>(picture), reinterpret_cast<jlong>(matrix), reinterpret_cast<jlong>(paint));
673-
_vm->DetachCurrentThread();
674-
return result;
675-
}
676-
677-
jobject attach(JNIEnv* env, jobject obj) {
678-
return env->NewGlobalRef(obj);
679-
}
680-
681-
void detach(jobject obj) {
682-
JNIEnv *env;
683-
_vm->AttachCurrentThread(AS_JNI_ENV_PTR(&env), NULL);
684-
env->DeleteGlobalRef(obj);
685-
_vm->DetachCurrentThread();
686-
}
687-
}
688-
689656
namespace Rect {
690657
jclass cls;
691658
jmethodID makeLTRB;
@@ -930,7 +897,6 @@ namespace skija {
930897
PathSegment::onLoad(env);
931898
Point::onLoad(env);
932899
PaintFilterCanvas::onLoad(env);
933-
PictureFilterCanvas::onLoad(env);
934900
Rect::onLoad(env);
935901
RRect::onLoad(env);
936902
RSXform::onLoad(env);
@@ -943,7 +909,6 @@ namespace skija {
943909
RRect::onUnload(env);
944910
Rect::onUnload(env);
945911
PaintFilterCanvas::onUnload(env);
946-
PictureFilterCanvas::onUnload(env);
947912
Point::onUnload(env);
948913
PathSegment::onUnload(env);
949914
Path::onUnload(env);

skiko/src/jvmMain/cpp/common/interop.hh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,6 @@ namespace skija {
272272
void detach(jobject obj);
273273
}
274274

275-
namespace PictureFilterCanvas {
276-
extern jmethodID onDrawPictureId;
277-
void onLoad(JNIEnv* env);
278-
void onUnload(JNIEnv* env);
279-
bool onDrawPicture(jobject obj, const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint);
280-
jobject attach(JNIEnv* env, jobject obj);
281-
void detach(jobject obj);
282-
}
283-
284275
namespace Rect {
285276
extern jclass cls;
286277
extern jmethodID makeLTRB;

skiko/src/jvmMain/kotlin/org/jetbrains/skia/PictureFilterCanvas.jvm.kt

Lines changed: 0 additions & 9 deletions
This file was deleted.

skiko/src/nativeJsMain/cpp/PictureFilterCanvas.cc

Lines changed: 0 additions & 68 deletions
This file was deleted.

skiko/src/nativeJsMain/kotlin/org/jetbrains/skia/PictureFilterCanvas.nativeJs.kt

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)