Skip to content
欢迎扫码关注公众号

JEP 265: Marlin Graphics Renderer | Marlin 图形渲染器

摘要

将 Java 2D 更新为使用 Marlin 渲染器作为默认的图形光栅化器。

成功指标

Marlin 渲染器必须始终至少与当前的图形光栅化器 Pisces 在质量和准确性上表现相等或更好,并在大多数基准测试中显著优于 Pisces。它应该证明多线程可扩展性优于 Pisces。开发版已经实现了这些目标。额外的目标是,在单线程性能方面等同或优于闭源的 Ductus 光栅化器,并在质量和准确性方面与其匹配。Marlin 已经证明在 MT 情况下比 Ductus 具有更好的可扩展性。

动机

JDK 目前使用名为 Pisces 的图形光栅化器。它用于抗锯齿渲染(除字体之外),因此其性能对于许多图形密集型应用程序至关重要,但其性能远不如 Oracle 提供的闭源的 Ductus 光栅化器。因此,一种更高性能的光栅化器对于采用非常重要。

描述

图形光栅化器是 Java 2D 使用的实现库。它实现了与 AWT 和 Java 2D 子系统通信的内部接口,但没有任何针对 Java 开发人员的外部可见 API。Marlin 完全是 Java 代码(迄今为止),是 Pisces 光栅化器的一个分支。尽管它长期以来一直是独立托管的,但现在正在通过继续 OpenJDK graphics-rasterizer 项目进行开发,该项目最初专注于 Pisces。Marlin 已经基本完成并且已经过现场测试,同时也经过了 Oracle 内部测试。它将逐步进一步开发,并作为 Pisces 和可能的 Ductus 替代品集成到 JDK 中。

测试

这不需要任何新的测试开发,因为没有 API 可用。但是,如果我们发现存在漏洞,我们预计会针对现有的 J2DBench 或其他测试套件开发额外的测试场景来检查 MT 性能。测试执行将是现有的功能和合规性测试以及现有的性能测试,例如 J2DBench。Marlin 的当前版本已经通过了 JDK 9 中由 Oracle SQE 组运行的所有功能、回归和合规性(JCK)测试。

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.