码迷,mamicode.com
首页 > 其他好文 > 详细

Hardware Acceleration

时间:2014-09-02 15:45:54      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   color   os   io   ar   for   

硬件加速学习:

参考: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);

判断是否打开了硬件加速:

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

标签:android   style   blog   http   color   os   io   ar   for   

原文地址:http://www.cnblogs.com/androidstudy/p/3951518.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!