zoukankan      html  css  js  c++  java
  • 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);

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

    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.

  • 相关阅读:
    命令[46]
    命令[53]
    命令[48]
    命令[43]
    命令[52]
    命令[55]
    命令[41]
    MYSQL[02]大小写问题
    hdu 1811
    hdu 1829
  • 原文地址:https://www.cnblogs.com/androidstudy/p/3951518.html
Copyright © 2011-2022 走看看