Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
f9545178
Commit
f9545178
authored
Jul 30, 2021
by
Nikolay Igotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unneeded complexity.
parent
55d72a8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
19 deletions
+2
-19
MetalRedrawer.mm
skiko/src/jvmMain/objectiveC/macos/MetalRedrawer.mm
+2
-19
No files found.
skiko/src/jvmMain/objectiveC/macos/MetalRedrawer.mm
View file @
f9545178
...
...
@@ -3,9 +3,6 @@
#import <jawt.h>
#import <jawt_md.h>
#include <dlfcn.h>
#import <Cocoa/Cocoa.h>
#import <QuartzCore/QuartzCore.h>
#import <Metal/Metal.h>
...
...
@@ -113,32 +110,18 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_makeMeta
return (jlong) renderTarget;
}
static void* objc_library() {
void* result = dlopen("/usr/lib/libobjc.dylib", RTLD_LAZY | RTLD_LOCAL);
return result != NULL ? result : RTLD_DEFAULT;
}
extern "C" void* objc_autoreleasePoolPush(void);
extern "C" void objc_autoreleasePoolPop(void*);
JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_startRendering(
JNIEnv * env, jobject redrawer)
{
typedef void* (*objc_autoreleasePoolPush_t)(void);
static objc_autoreleasePoolPush_t objc_autoreleasePoolPush = NULL;
if (objc_autoreleasePoolPush == NULL) {
objc_autoreleasePoolPush = (objc_autoreleasePoolPush_t)dlsym(objc_library(), "objc_autoreleasePoolPush");
assert(objc_autoreleasePoolPush != NULL);
}
return (jlong)objc_autoreleasePoolPush();
}
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_endRendering(
JNIEnv * env, jobject redrawer, jlong handle)
{
typedef void (*objc_autoreleasePoolPop_t)(void*);
static objc_autoreleasePoolPop_t objc_autoreleasePoolPop = NULL;
if (objc_autoreleasePoolPop == NULL) {
objc_autoreleasePoolPop = (objc_autoreleasePoolPop_t)dlsym(objc_library(), "objc_autoreleasePoolPop");
assert(objc_autoreleasePoolPop != NULL);
}
objc_autoreleasePoolPop((void*)handle);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment