问题描述
蜂窝文档是模糊的:
在硬件加速渲染器 启用后,在画布大多数操作, 油漆,Xfermode,ColorFilter,着色器, 和照相机被加速。
有没有确切的API是(和不)时启用硬件加速支持的最终名单?有些方法有例外快速失败,而其他功能根本不同的渲染加速时启用。
Is there a definitive list of the exact APIs that are (and are not) supported when hardware acceleration is enabled? Some methods fail fast with exceptions, while other features simply render differently when acceleration is enabled.
例如,Canvas.clipPath(...)快速失败并抛出异常。虽然 clipPath API 没有提到这一点,这是很容易确定真正的硬件测试时。
For example, Canvas.clipPath(...) fails fast with an exception. Though the clipPath API makes no mention of this, it is easy enough to determine when testing on real hardware.
其他功能还使无不当引发异常,导致困难和耗时的移植工作。例如,我有一个使用ComposeShader组成的的RadialGradient和的LinearGradient,采用PorterDuff.Mode.SRC_IN屏幕。它看上去很美没有加速,而是完全错误的,当加速功能。
Other features render improperly without throwing exceptions, leading to difficult and time-consuming porting efforts. For example, I have a screen that uses a ComposeShader consisting of a RadialGradient and LinearGradient, using PorterDuff.Mode.SRC_IN. It looks beautiful without acceleration, but completely wrong when acceleration is enabled.
推荐答案
我工作的得到发表的完整列表。不支持的功能有:
I'm working on getting a complete list published. The features not supported are:
- clipPath
- 在CLI pregion
- 在CLI preCT与异或运算差
- drawPicture
- drawPoints
- drawPosText
- drawTextOnPath
- drawTextPos
- drawVertices
- setMaskFilter
- setRasterizer
- clipPath
- clipRegion
- clipRect with XOR or Difference op
- drawPicture
- drawPoints
- drawPosText
- drawTextOnPath
- drawTextPos
- drawVertices
- setMaskFilter
- setRasterizer
编辑:阅读这文章知道一切有了解硬件加速的Android 3.0。
Read this article to know everything there is to know about hardware acceleration in Android 3.0.
不过,你描述的应该只是罚款。所有的梯度都支持,以及所有混合模式。请报告错误与可重复的测试案例为您遇到任何问题,我会得到他们固定的。
However, what you are describing should work just fine. All gradients are supported, as well as all blending modes. Please report bugs with reproducible test cases for any issue you encounter and I'll get them fixed.
这篇关于哪些API时,硬件加速的蜂窝启用的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!