Android如何做硬體圖學、3D/2D繪圖加速 ( Manifest 設定 )



請在Android Manifest.xml當中,你所需要使用硬體加速的<activity>標籤中,加入android:hardwareAccelerated。以下是Google Android Developer中的原文解釋,詮釋得非常好,我也不多加贅述了。但是,他真正的重點是 Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera 這幾的class method,才會是發揮這項OpenGL加速功能的重點項目,下面也說不是所有的2D方式都是有透過這項硬體加速的加持,所以不要天真的以為ImageView在loading的時候可以加速喔!!

android:hardwareAccelerated

Whether or not hardware-accelerated rendering should be enabled for this Activity — "true" if it should be enabled, and "false" if not. The default value is "false".
Starting from Android 3.0, a hardware-accelerated OpenGL renderer is available to applications, to improve performance for many common 2D graphics operations. When the hardware-accelerated renderer is enabled, most operations in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated. This results in smoother animations, smoother scrolling, and improved responsiveness overall, even for applications that do not explicitly make use the framework's OpenGL libraries. Because of the increased resources required to enable hardware acceleration, your app will consume more RAM.
Note that not all of the OpenGL 2D operations are accelerated. If you enable the hardware-accelerated renderer, test your application to ensure that it can make use of the renderer without errors.

留言

這個網誌中的熱門文章

7-ELEVEN 電子發票明細查詢方式

Java 使用 regular expression 正則表達,過濾特殊字元,反斜線處理重點

Ubuntu GUI中,無法啟動WIFI連結解決方法