Which APIs are supported when hardware acceleration is enabled on Honeycomb?

爷,独闯天下 提交于 2019-12-04 15:48:23

问题


The Honeycomb docs are vague:

When the hardware-accelerated renderer is enabled, most operations in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated.

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.

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.

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.


回答1:


I'm working on getting a complete list published. The features not supported are:

  • clipPath
  • clipRegion
  • clipRect with XOR or Difference op
  • drawPicture
  • drawPoints
  • drawPosText
  • drawTextOnPath
  • drawTextPos
  • drawVertices
  • setMaskFilter
  • setRasterizer

Edit: 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.



来源:https://stackoverflow.com/questions/5215815/which-apis-are-supported-when-hardware-acceleration-is-enabled-on-honeycomb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!