Android 2.1閃屏問題

來源:互聯網
上載者:User

北福士志小本(MPRC)Android 2.1移植

 

Android 2.1 閃屏

 

移植過程中,小本的核心不支援double framebuffer,導致螢幕不斷在刷。最後通過師兄的方法:

http://hi.baidu.com/aokikyon/blog/item/609ea74530b8f533879473be.html

 

刷屏的現象會好很多,但是開啟程式的時候螢幕還是會閃。

 

後來在gingerbread的hardware/libhardware/modules/gralloc/Android.mk發現了一個新定義的宏:BOARD_NO_PAGE_FLIPPING

 

include $(CLEAR_VARS)<br /> 21 LOCAL_PRELINK_MODULE := false<br /> 22 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw<br /> 23 LOCAL_SHARED_LIBRARIES := liblog libcutils<br /> 24<br /> 25 LOCAL_SRC_FILES := /<br /> 26 gralloc.cpp /<br /> 27 framebuffer.cpp /<br /> 28 mapper.cpp<br /> 29<br /> 30 LOCAL_MODULE := gralloc.default<br /> 31 LOCAL_CFLAGS:= -DLOG_TAG=/"gralloc/"<br /> 32 ifeq ($(BOARD_NO_PAGE_FLIPPING),true)<br /> 33 LOCAL_CFLAGS += -DNO_PAGE_FLIPPING<br /> 34 endif<br /> 35<br /> 36 include $(BUILD_SHARED_LIBRARY) 

 

然後就去找源碼中這個宏的調用,在framebuffer.cpp中:

 

// numbers of buffers for page flipping<br /> 46 #if defined(NO_PAGE_FLIPPING)<br /> 47 // page-flipping is buggy on some devices<br /> 48 #define NUM_BUFFERS 1<br /> 49 #else<br /> 50 #define NUM_BUFFERS 2<br /> 51 #endif 

 

原來2.3中更好的支援了single framebuffer,可以不使用page flipping。

 

最終,我沒有對2.1的代碼作任何修改,直接把gingerbread的gralloc代碼放到2.1的源碼中去編譯。

通過了 ,沒有任何問題。

 

再把產生的gralloc.default.so放到小本上。果然,閃屏現象完全沒了。

 

有空研究下gingerbread究竟做了那些具體的改進。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.