为了账号安全,请及时绑定邮箱和手机立即绑定

什么是 sun.awt.image.BufImgSurfaceData?

什么是 sun.awt.image.BufImgSurfaceData?

慕森王 2023-05-10 17:24:02
试图追踪潜在的与图形相关的性能问题,通过 JVisualVM 执行了堆转储。在 Eclipse Memory Analyzer 中打开转储,其中一个“问题嫌疑人”显示如下:搜索代码,没有直接引用正在使用的 BufImgSurfaceData。进行谷歌搜索也不会透露有关该课程的太多信息。在哪里可以找到有关此类的信息?
查看完整描述

1 回答

?
慕沐林林

TA贡献2016条经验 获得超9个赞

在哪里可以找到有关此类的信息?


通过阅读 OpenJDK 源代码……任何人都可以免费下载。(以下内容来自Java 8源码。)


该类的注释最少,但它扩展了sun.java2d.SurfaceDatawhose javadoc 注释块这样说:


/**

 * This class provides various pieces of information relevant to a

 * particular drawing surface.  The information obtained from this

 * object describes the pixels of a particular instance of a drawing

 * surface and can only be shared among the various graphics objects

 * that target the same BufferedImage or the same screen Component.

 * <p>

 * Each SurfaceData object holds a StateTrackableDelegate object

 * which tracks both changes to the content of the pixels of this

 * surface and changes to the overall state of the pixels - such

 * as becoming invalid or losing the surface.  The delegate is

 * marked "dirty" whenever the setSurfaceLost() or invalidate()

 * methods are called and should also be marked "dirty" by the

 * rendering pipelines whenever they modify the pixels of this

 * SurfaceData.

 * <p>

 * If you get a StateTracker from a SurfaceData and it reports

 * that it is still "current", then you can trust that the pixels

 * have not changed and that the SurfaceData is still valid and

 * has not lost its underlying storage (surfaceLost) since you

 * retrieved the tracker.

 */

由此看来,似乎sun.awt.image.BufImgSurfaceData涉及到对一个BufferedImage对象进行绘制操作,以及相关联的东西。


(这是相当高的水平,但它应该足以让您弄清楚这是否与您的性能问题相关。我怀疑它不是,除非有很多对象的“流失”。BufferedImage)


查看完整回答
反对 回复 2023-05-10
  • 1 回答
  • 0 关注
  • 68 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信