<AWT Dev> RFR: 8226384: Implement a better logic to switch between OpenGL and Metal pipeline [v2]
serb at openjdk.java.net
Fri May 7 20:00:19 UTC 2021
On Wed, 5 May 2021 07:34:12 GMT, Jayathirth D V <jdv at openjdk.org> wrote:
>> src/java.desktop/macosx/classes/sun/java2d/opengl/CGLLayer.java line 60:
>>> 58: return ptr;
>>> 59: }
>> dispose and getBounds(probably some others) seems to have the same implementation in both classes?
> In dispose() we call validate which internally calls corresponding RenderQueue's of OpenGL/Metal, thats why it is not moved to CFLayer.
> For other getters since initialization of peer was happening in individual subclasses(which in turn calls OpenGL/Metal native initialization) i had kept getters also in subclasses, but we can move getters to CFLayer. I have updated the PR.
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.
More information about the awt-dev