How to check if a canvas function supports hardware acceleration on a given device?
<p>I have a custom AdapterView that overrides drawChild to clip the child views during a canvas animation.</p>

<p>This seems to work fine on honeycomb, but dies a fiery death once loaded onto an Android 4.0 tablet.  I suspect this is because Android 4.0 turns hardware acceleration on by default, and one or more of the canvas methods I am using doesnt support hardware acceleration on the specific device I am using (Acer A100 with ICS 4.0.3)</p>

<p>Here is my drawChild method (from my NinjaMenu.java class):</p>

<pre><code>@Override
    protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
        final int top = child.getTop();
        final int left = child.getLeft();
        Bitmap bitmap = child.getDrawingCache();
        if (bitmap == null) {
            child.setDrawingCacheEnabled(true);
            child.buildDrawingCache();
            bitmap = child.getDrawingCache();
        }
        if (mCutPath != null) {
            // clip child views so that they partially show
            // as menu is expanded
            canvas.clipPath(mCutPath);
            canvas.drawBitmap(bitmap, left, top, null);
        }

        return false;
    }
</code></pre>

<p>mCutPath is a Path object created elsewhere in the code (not important to this issue).</p>

<p>Here is the exception that occurs as soon as the AdapterView attempts to draw a child:</p>

<pre><code>FATAL EXCEPTION: main
java.lang.UnsupportedOperationException
    at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:408)
    at com.phunware.funimation.android.views.NinjaMenu.drawChild(NinjaMenu.java:529)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
    at android.view.View.draw(View.java:10986)
    at android.view.View.getDisplayList(View.java:10422)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
    at android.view.View.getDisplayList(View.java:10420)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
    at android.view.View.draw(View.java:10986)
    at android.widget.FrameLayout.draw(FrameLayout.java:450)
    at android.view.View.getDisplayList(View.java:10422)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
    at android.view.View.getDisplayList(View.java:10420)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
    at android.view.View.getDisplayList(View.java:10420)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
    at android.view.View.getDisplayList(View.java:10420)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
    at android.view.View.draw(View.java:10986)
    at android.widget.FrameLayout.draw(FrameLayout.java:450)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2152)
    at android.view.View.getDisplayList(View.java:10422)
    at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:852)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:1910)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1634)
    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4424)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>Other than disabling hardware acceleration completely, is there a way to check if a given canvas function supports hardware acceleration and if it doesnt turn it off?</p>
