RFR: 8283794: CCE in XRTextRenderer.drawGlyphList and XRMaskFill.MaskFill
Alexey Ushakov
avu at openjdk.java.net
Wed Mar 30 20:04:33 UTC 2022
On Tue, 29 Mar 2022 20:54:16 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> Since this is the third cast-related issue then probably it will be useful to create a method to convert the `surfaceData `to the (XRSurfaceData) and throw `InvalidPipeException `if needed? We have many other places where we use the same casts.
Yes, agree. Also, I think we need to update similar cases in MTLRenderer, MTLMaskFill, OGLMaskFill, OGLRenderer, XRPMBlitLoops, D3DMaskFill, D3DRenderer, GDIRenderer.
The conversion can be done using generics in SurfaceData:
SurfaceData.convertTo(XRSurfaceData.class, sg2d.surfaceData);
or by providing separate conversion methods for each SurfaceData subclass
XRSurfaceData x11sd = XRSurfaceData.toXRSurfaceData(sData);
-------------
PR: https://git.openjdk.java.net/jdk/pull/8015
More information about the client-libs-dev
mailing list