Bitmap too large to be uploaded into a texture,Hardware accelerated
来源:互联网 发布:主宰西游装备进阶数据 编辑:程序博客网 时间:2024/05/15 11:32
原文链接:http://www.csdn123.com/itweb.php?url=aHR0cDovL3d3dy5jbmJsb2dzLmNvbS9nZnFGaWdodGluZy9hcmNoaXZlLzIwMTMvMDkvMTcvMzMyNjM2My5odG1s
Android的硬件加速及可能导致的问题
问题
在Android 4.0的某些设备上,在View
刷新时会出现花屏和屏幕上的某些View错位的现象。 经过调查后发现adb logcat
中出现很多OpenGLRenderer: 0x501
的错位:
从这个日志,初步怀疑是硬件加速导致的问题。 经过分析发现使用了比较复杂的自定义View
,可能会导致硬件加速渲染出错。
硬件加速的优点与缺点
硬件加速能使用GPU来加速2D图像的渲染速度,但是硬件加速并不能完全支持所有的渲染操作, 针对自定义的View,硬件加速可能导致渲染出现错误。 如果有自定义的View,需要在硬件加速的设备上进行测试,如果出现渲染的问题,需要关闭硬件加速。
开启和关闭硬件加速
对硬件加速的开关可以在不同的级别进行控制:
- Application
- Activity
- Windows
- View
Application级别
在Applciation级别控制硬件加速的开关:
Activity级别
可以对单个的Activity
控制是否启用硬件加速:
Window级别
View级别
在指定的View上关闭硬件加速:
或者使用android:layerType="software"
来关闭硬件加速:
如何判断一个View是否启用了硬件加速
View.isHardwareAccelerated()
returns true if the View is attached to a hardware accelerated window.Canvas.isHardwareAccelerated()
returns true if the Canvas is hardware accelerated
参考
- http://developer.android.com/guide/topics/graphics/hardware-accel.html
0 0
- Bitmap too large to be uploaded into a texture,Hardware accelerated
- Bitmap too large to be uploaded into a texture
- Bitmap too large to be uploaded into a texture 解决方法
- Bitmap too large to be uploaded into a texture exception
- Bitmap too large to be uploaded into a texture
- Bitmap too large to be uploaded into a texture
- Bitmap too large to be uploaded into a texture
- Bitmap too large to be uploaded into a texture
- Bitmap too large to be uploaded into a texture 解决方案
- Bitmap too large to be uploaded into a texture 解决方法
- Bitmap too large to be uploaded into a texture
- 解决:Bitmap too large to be uploaded into a texture exception
- 解决:Bitmap too large to be uploaded into a texture exception
- 关于使用ImageLoader出现的Bitmap too large to be uploaded into a texture
- 解决:Bitmap too large to be uploaded into a texture exception
- 解决:Bitmap too large to be uploaded into a texture exception
- Bitmap too large to be uploaded into a texture问题的解决方法
- 解决:Bitmap too large to be uploaded into a texture exception
- 怎样花两年时间去面试一个人
- oracle 创建用户名 密码 授权
- NSIS ERROR解决方法
- Java反射机制
- 'IDispatchEx' : redefinition 对应duilib
- Bitmap too large to be uploaded into a texture,Hardware accelerated
- 邮件营销避免进入垃圾箱技巧分享
- 基于CodeMirror&TernJS的汉语Javascript编辑器(和翻译器)
- 112_leetcode_Binary Tree Maximum Path
- 实现基于DNS的负载均衡
- 000:以NotePad++作为Python IDE
- poj 3204 Ikki's Story I - Road Reconstruction && zoj 2532 Internship 网络流关键边
- [LeetCode] Valid Number
- Apache AB 第一个测试案例及测试结果解释