18
18
19
19
#if defined(__linux__)
20
20
std::unique_ptr<Hook> native_hook{nullptr };
21
- std::unique_ptr<Hook> opengl_hook {nullptr };
22
- std::unique_ptr<Hook> flush_buffer_hook {nullptr };
21
+ std::unique_ptr<Hook> opengl_blit_hook {nullptr };
22
+ std::unique_ptr<Hook> opengl_flush_buffer_hook {nullptr };
23
23
24
24
bool can_render (jint srctype, jint width, jint height)
25
25
{
@@ -220,9 +220,9 @@ void JavaNativeOGLBlit(JNIEnv *env, void *oglc, jlong pSrcOps, jlong pDstOps, jb
220
220
221
221
if (!srcOps || width <= 0 || height <= 0 || !can_render (srctype, width, height))
222
222
{
223
- if (opengl_hook )
223
+ if (opengl_blit_hook )
224
224
{
225
- return opengl_hook ->call <void , decltype (JavaNativeOGLBlit)>(env, oglc, pSrcOps, pDstOps, xform, hint, srctype, texture, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2);
225
+ return opengl_blit_hook ->call <void , decltype (JavaNativeOGLBlit)>(env, oglc, pSrcOps, pDstOps, xform, hint, srctype, texture, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2);
226
226
}
227
227
return ;
228
228
}
@@ -298,9 +298,9 @@ void JavaNativeOGLBlit(JNIEnv *env, void *oglc, jlong pSrcOps, jlong pDstOps, jb
298
298
}
299
299
}
300
300
301
- if (opengl_hook )
301
+ if (opengl_blit_hook )
302
302
{
303
- return opengl_hook ->call <void , decltype (JavaNativeOGLBlit)>(env, oglc, pSrcOps, pDstOps, xform, hint, srctype, texture, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2);
303
+ return opengl_blit_hook ->call <void , decltype (JavaNativeOGLBlit)>(env, oglc, pSrcOps, pDstOps, xform, hint, srctype, texture, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2);
304
304
}
305
305
}
306
306
@@ -372,7 +372,7 @@ void JavaNativeOGLRenderQueueFlushBuffer(JNIEnv *env, jobject oglrq, jlong buf,
372
372
}
373
373
}
374
374
375
- return flush_buffer_hook ->call <void , decltype (JavaNativeOGLRenderQueueFlushBuffer)>(env, oglrq, original_buffer, limit);
375
+ return opengl_flush_buffer_hook ->call <void , decltype (JavaNativeOGLRenderQueueFlushBuffer)>(env, oglrq, original_buffer, limit);
376
376
}
377
377
#endif
378
378
@@ -571,7 +571,7 @@ extern "C" [[gnu::visibility("default")]] void glXSwapBuffers(Display* dpy, GLXD
571
571
}
572
572
573
573
#if defined(USE_DETOURS)
574
- return opengl_hook ->call <void , decltype (glXSwapBuffers)>(dpy, drawable);
574
+ return opengl_blit_hook ->call <void , decltype (glXSwapBuffers)>(dpy, drawable);
575
575
#else
576
576
static decltype (glXSwapBuffers)* o_glXSwapBuffers = reinterpret_cast <decltype (glXSwapBuffers)*>(dlsym (RTLD_NEXT, " glXSwapBuffers" ));
577
577
return o_glXSwapBuffers (dpy, drawable);
@@ -596,16 +596,16 @@ void InitialiseHooks() noexcept
596
596
blit = dlsym (RTLD_DEFAULT, " OGLBlitLoops_Blit" );
597
597
if (blit)
598
598
{
599
- opengl_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(JavaNativeOGLBlit));
600
- opengl_hook ->apply ();
599
+ opengl_blit_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(JavaNativeOGLBlit));
600
+ opengl_blit_hook ->apply ();
601
601
}
602
602
else
603
603
{
604
604
blit = dlsym (RTLD_DEFAULT, " Java_sun_java2d_opengl_OGLRenderQueue_flushBuffer" );
605
605
if (blit)
606
606
{
607
- flush_buffer_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(JavaNativeOGLRenderQueueFlushBuffer));
608
- flush_buffer_hook ->apply ();
607
+ opengl_flush_buffer_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(JavaNativeOGLRenderQueueFlushBuffer));
608
+ opengl_flush_buffer_hook ->apply ();
609
609
}
610
610
}
611
611
@@ -614,16 +614,16 @@ void InitialiseHooks() noexcept
614
614
blit = dlsym (RTLD_DEFAULT, " glXSwapBuffers" );
615
615
if (blit)
616
616
{
617
- opengl_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(glXSwapBuffersHook));
618
- opengl_hook ->apply ();
617
+ opengl_blit_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(glXSwapBuffersHook));
618
+ opengl_blit_hook ->apply ();
619
619
}
620
620
}
621
621
#else
622
622
blit = dlsym (RTLD_NEXT, " glXSwapBuffers" );
623
623
if (blit)
624
624
{
625
- opengl_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(glXSwapBuffersHook));
626
- opengl_hook ->apply ();
625
+ opengl_blit_hook = std::make_unique<Hook>(reinterpret_cast <void *>(blit), reinterpret_cast <void *>(glXSwapBuffersHook));
626
+ opengl_blit_hook ->apply ();
627
627
}
628
628
#endif
629
629
#endif
0 commit comments