JDK-8101073 : New API to select LCD text rendering
Type:Enhancement
Component:javafx
Sub-Component:graphics
Affected Version:fx2.0
Priority:P4
Status:Resolved
Resolution:Fixed
Submitted:2011-03-15
Updated:2015-06-16
Resolved:2012-01-11
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
We (developers, the UI controls) need to be able to specify whether text should be rendered as LCD text or the current unhinted AA.
This will need an API
Comments
On MacOS the regression is much bigger due to this change to LCD.
It is more than 30%, see Controls results in Aurora here:
http://aurora.ru.oracle.com/performance/faces/ChessBoard.xhtml?reportName=FX2-graphics-scrum¶meters=%5BlatestBuild%5D10310%5BprevBuild%5D10281%5Bshownbenchmarks%5D%281%3D1%29%5Bhwclass%5DMac-Mid-Range%5Brefrelease%5D2.1%5Brefbuild%5D10282%5Brefjdkrelease%5D%281%3D1%29%5Brelease%5D2.1%5Bbuild%5D10282%2C10283%2C10284%5Bjdkrelease%5D1.6.0_26&splitting=%5BX+axis%5DfxConf%2C+metricName%5BComplement%5Dbenchmark%2C+os%2C+jdkBuild%2C+jdk%5BZ+axis%5Dhwclass%2C+benchmarkSuite%2C+jdkRelease%5BY+axis%5DbenchmarkName%2C+benchmarkConf%2C+fxRelease%2C+fxBuild&reference=%5BOthers%5DfxRelease%2C+fxBuild%2C+os%2C+jdkRelease%2C+jdkBuild%2C+jdk%2C+benchmarkSuite%2C+benchmarkName%2C+metricName%5BReference+Set%5Dbenchmark%2C+benchmarkConf%2C+fxConf%2C+hwclass&mixReference=false&flags=&significance=empty&hideDataConfiguration=false&calculateSummary=false&showSummaryExpanded=false&showSummaryContents=true&showComplementAttributes=false&compactTables=true&viewStyle=chessboard&filter=
For example running CheckBox-items300-toggle30 in fullspeed mode on my MacBook I am getting:
b282: 24.4 fps
b283: 15.9 fps
17-01-2012
I can't say I would have known what exact cost to expect, but I did expect that part of the
code to be expensive.
12-01-2012
Running JavaPerformanceAnalyzer for RadioButton benchmark in fullspeed mode for 25 seconds I see that 6% of time (3.4 seconds) is spent in BaseShaderGraphics.initLCDSampleRT() function. Phil, is it expected?
and FPS results are:
b282: 72 fps
b283: 55 fps
12-01-2012
This didn't affect GUIMark2.Text but it did lead to ~15% performance degradation for
Controls.CheckBox and Controls.RadioButton benchmarks.
Other Control benchmarks seems to be also impacted by making LCD by default (would be nice to verify for sure).
See Aurora results for builds b282, b283 and b284 here:
http://aurora.ru.oracle.com/performance/faces/ChessBoard.xhtml?reportName=FX2-graphics-scrum
12-01-2012
Now enabled by default on UI controls by using CSS.
Can be enabled on raw Text nodes by calling
Text.setFontSmoothingType(FontSmoothingType.LCD);
11-01-2012
The current theory is that this will require an API so we can be selective about the performance
and other consequences and because there are use cases where you want LCD text and use
cases where you don't.
I expect this to be an enum, not a boolean, to allow for future additions. The initial set of values
will be GRAY and LCD. This will be set as a property on the Text node.
UI Controls will likely all set LCD on their Text nodes. We know this will hit the performance of GUIMark2.Text.
The timing for adding the API will depend on when we complete the underpinning implementation.