使用hardwareAcceleration标志和Canvas.clipPath [英] Use hardwareAcceleration flag with Canvas.clipPath

查看:230
本文介绍了使用hardwareAcceleration标志和Canvas.clipPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我移植了Galaxy Tab的1,对于Galaxy Tab的2做了一个项目,但APK运行速度很慢,所以我说的hardwareAccelerated标志的新应用程序的Andr​​oidManifest.xml中。

但运行给我以下错误:

  java.lang.UnsupportedOperationException
     在android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287)
     在br.com.iba.view.PageCurlView.drawCurl(PageCurlView.java:284)
     在br.com.iba.view.PageCurlView.onDraw(PageCurlView.java:353)
     在android.view.View.draw(View.java:9291)


解决方案

我有ImageView的类似的问题,这不是支持我的项目硬件加速。我回避了这个问题,这code:

mImageView.setLayerType(View.LAYER_TYPE_SOFTWARE,NULL);

它的工作对我的。

I'm porting a project made for the Galaxy Tab 1, for Galaxy Tab 2, but the apk runs slowly so I added the hardwareAccelerated flag on the AndroidManifest.XML of the new application.

But running give me the following error:

java.lang.UnsupportedOperationException
     at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287)
     at br.com.iba.view.PageCurlView.drawCurl(PageCurlView.java:284)
     at br.com.iba.view.PageCurlView.onDraw(PageCurlView.java:353)
     at android.view.View.draw(View.java:9291)

解决方案

I have similar problem with ImageView which not supports hardware acceleration in my project. I circumvented this problem with this code:

mImageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

It work's for me.

这篇关于使用hardwareAcceleration标志和Canvas.clipPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆