[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    properties for Prism and Glass
From:       Johan Vos <johan.vos () gluonhq ! com>
Date:       2019-02-22 12:31:49
Message-ID: CABxFH2GK6LSL2rtmmKkSEfNZQj60YtZnH52dQPuxu=VrWn3dEA () mail ! gmail ! com
[Download RAW message or body]

Both Prism and Glass provide a top-level API and rely on specific
implementations. On desktop, the specific implementations do not require
properties to be set, as the defaults are obtained from properties like "
os.name" etc. However, they can be overruled.

On embedded, it is more likely that users have to specify the properties.

For example, on the Raspberry Pi one would typically use
-Dembedded=monocle -Dglass.platform=Monocle
(note the lowercase monocle versus Monocle)


Currently, there are inconsistencies in how the properties for Glass and
Prism are obtained.

Prism: the base class for determining properties is
com.sun.javafx.PlatformUtil, in the javafx.base module. A property named
"embeddedType" is used to determine which native library to load (e.g.
prism_es2_monocle) and to determine which GLFactory has to be used (e.g.
com.sun.prism.es2.X11GLFactory).

Glass: the base class for determining properties is
com.sun.glass.ui.Platform, in the javafx.graphics module. The return value
of determinePlatform() (which can be macosx, windows, linux, gtk, ios or
anything user-specified defined via a property named "glass.platform" e.g.
Monocle) is used to determine which class implements the PlatformFactory
(e.g. com.sun.glass.ui.monocle.MonoclePlatformFactory).

While Glass and Prism are clearly 2 different things, I think the
properties that ultimately decides which factories and native libs to be
loaded could belong in the same module (instead of javafx.base AND
javafx.graphics)
Further, I think it would be good to be more consistent in the naming and
use for example "prism.platform" .

Thoughts,

- Johan
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic