gpt4 book ai didi

Android、Skia 和硬件加速图形

转载 作者:太空狗 更新时间:2023-10-29 16:38:51 26 4
gpt4 key购买 nike

本页http://source.android.com/devices/graphics.html说:

Prior to Android 3.0, Canvas used the Skia 2D drawing library to draw, which could not take advantage of hardware acceleration. Introduced in Android 3.0, hardware acceleration for Canvas APIs uses a new drawing library called OpenGLRenderer that translates Canvas operations to OpenGL operations so that they can execute on the GPU.

但是,Skia 页面 http://code.google.com/p/skia/说 Skia 可以支持 OpenGL。

此外,这个 Skia FAQ https://sites.google.com/site/skiadocs/user-documentation/faq说:“SkGLCanvas 被编写为将其绘图调用定向到 OpenGL。”

所以我想知道,Android 不简单地使用 Skia 支持 OpenGL 来获得硬件加速图形是否有特殊原因?(也许是 OpenGL 和 OpenGL ES 之间的区别?)

最佳答案

他们显然打算让 Skia 被某种东西加速,但它从未真正发生过。 PixelFlinger 和 libagl 看起来也很像 OpenGL 的早期版本,但实际上也从未加速过。

最大的颠覆是 OpenGL ES 的 2.0 版本。它的大部分功能在于它的着色语言,并且没有直接的方法通过 Skia 来利用它。 ICS 确实是一次重大的重新设计,他们放弃了 Skia,转而使用 OpenGL ES 2.0——具有所有 GLSL 功能。

他们还迫切需要在 2.0 中改进对 FBO 的支持。它是新的 TextureView 和 VideoView 类的基础。

同样重要的是,超过 99% 的 Android 设备现在都具有 OpenGL ES 2.0 加速。有关他们如何将 GLSL 暴露给 ICS 中的 Canvas API 的示例,请查看 Effects 类。

关于Android、Skia 和硬件加速图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21464693/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com