OpenGlRenderer 0x506 solution to screen display problems caused by hardware acceleration, openglrenderer

Source: Internet
Author: User

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/


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.