<AWT Dev> RFR: 8226384: Implement a better logic to switch between OpenGL and Metal pipeline [v2]
Jayathirth D V
jdv at openjdk.java.net
Mon May 10 10:36:57 UTC 2021
On Mon, 10 May 2021 10:14:40 GMT, Jayathirth D V <jdv at openjdk.org> wrote:
>> You can add a new abstract method to the parent class: getRenderQueue(), and override it in subclasses to call MTLRenderQueue/OGL.getInstance(); In this way, you can push to the parent more methods by calling just this new getRenderQueue().
>>
>> I think the only methods which cannot be pushe dto the parent is replaceSurfaceData() due to insets usage.
>
> I tried making this change.
> Moved all methods except replaceSurfaceData() to CFLayer.java. Moved the jni native declaration also to CFlayer.java.
> For this to link i need to change native JNI signatures also to map to CFLayer. But this will result in duplicate JNI symbols. If i change name of these native JNI calls to something like nativeMTL/CGLSetScale, i again have to use if/else check to verify which signature to call. Introducing a common native interface between MTLLayer.m and CGLLayer.m would not help because their implementation is different(Also it is out of scope of this PR).
>
> I am not finding ways to move methods accessing native JNI calls to common CFLayer.
I will push this PR. If we find appropriate way to move more methods to CFLayer.java i will handle it in a separate bug.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3851
More information about the awt-dev
mailing list