RFR: 8355611: Get rid of SurfaceManagerFactory [v2]

Sergey Bylokhov serb at openjdk.org
Sat Apr 26 03:26:49 UTC 2025


On Fri, 25 Apr 2025 14:19:54 GMT, Nikita Gubarkov <ngubarkov at openjdk.org> wrote:

>> `SurfaceManagerFactory` just checks a given `GraphicsConfiguration` against multiple types via `instanceof`, it has 3 platform-specific implementations, which rely on an ugly injection process.
>> 
>> There is no reason to have this class at all, we could just let `GraphicsConfiguration` create a compatible `SurfaceManager` instead.
>> 
>> This would reduce coupling without having to collect all surface manager types in a single place (without real need to do so).
>> And this would also remove dependency on the class initialization sequence by getting rid of the injection process.
>
> Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fixup! 8355611: Get rid of SurfaceManagerFactory

src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java line 440:

> 438:     public VolatileSurfaceManager createVolatileManager(SunVolatileImage image, Object context) {
> 439:         return new WGLVolatileSurfaceManager(image, context);
> 440:     }

Please split long lines to have 80 chars per line, it will be good to split surfaceDataProxyCache line added by the 8339341 as well.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24875#discussion_r2061137119


More information about the client-libs-dev mailing list