On Tue, 29 Mar 2022 20:54:16 GMT, Sergey Bylokhov <[email protected]> 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
