OpenGlRenderer 0x506 solution to screen display problems caused by hardware acceleration, openglrenderer
(150114_17:08:32.461)I/dalvikvm-heap( 850): Grow heap (frag case) to 10.342MB for 2457616-byte allocation (150114_17:08:32.542)D/dalvikvm( 850): GC_FOR_ALLOC freed 20K, 25% free 10530K/14040K, paused 34ms, total 34ms (150114_17:08:32.551)D/dalvikvm( 850): GC_CONCURRENT freed 7K, 26% free 10524K/14040K, paused 1ms+5ms, total 24ms (150114_17:08:32.551)D/OpenGLRenderer( 850): GL error from OpenGLRenderer: 0x506
Android custom Launcher may cause problems such as rendering the entire application as a screen, a black screen, or a font as a square.
Solution:
When View calls destroyLayer () to determine if the current hardware acceleration is unavailable, call the safelyRun of mHardwareRenderer to delete mHardwareLayer resources.
Modify View. java destroyLayer (boolean valid)
boolean destroyLayer(boolean valid) { if (mHardwareLayer != null) { AttachInfo info = mAttachInfo; if (info != null && info.mHardwareRenderer != null && info.mHardwareRenderer.isEnabled() && (valid || info.mHardwareRenderer.validate())) { info.mHardwareRenderer.cancelLayerUpdate(mHardwareLayer); mHardwareLayer.destroy(); mHardwareLayer = null; invalidate(true); invalidateParentCaches(); } else if(info != null && info.mHardwareRenderer != null) { info.mHardwareRenderer.safelyRun(new Runnable() {@Overridepublic void run() {// TODO Auto-generated method stubmHardwareLayer.destroy();mHardwareLayer = null;if (mDisplayList != null) mDisplayList.reset(); invalidate(true); invalidateParentCaches(); }}); } return true; } return false; }
Attached code optimization solution http://zuiniuwang.blog.51cto.com/3709988/721798/