首页 > 代码库 > Hardware Acceleration
Hardware Acceleration
硬件加速学习:
参考:http://blog.csdn.net/thinkinwm/article/details/8854649
硬件加速的级别:
Application:
可以打开和关闭硬件加速
<application android:hardwareAccelerated="true" ...>
Activity:
可以打开和关闭硬件加速
<application android:hardwareAccelerated="true"> <activity ... /> <activity android:hardwareAccelerated="false" /></application>
Window:
只能打开,不能关闭
1 getWindow().setFlags(2 WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,3 WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
View:
只能关闭,不能打开
myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
判断是否打开了硬件加速:
View.isHardwareAccelerated()
returnstrue
if theView
is attached to a hardware accelerated window.Canvas.isHardwareAccelerated()
returnstrue
if theCanvas
is hardware accelerated
If you must do this check in your drawing code, use Canvas.isHardwareAccelerated()
instead ofView.isHardwareAccelerated()
when possible. When a view is attached to a hardware accelerated window, it can still be drawn using a non-hardware accelerated Canvas. This happens, for instance, when drawing a view into a bitmap for caching purposes.
Hardware Acceleration
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。