lvgl / lv_port_win_codeblocks

Windows PC simulator project for LVGL embedded GUI Library
MIT License
150 stars 86 forks source link

The display is incomplete,when direct_mode = 1 #39

Open jjzqp opened 8 months ago

jjzqp commented 8 months ago

LVGL version

v8.3.11

What happened?

Conditions:

  1. Using the lv_port_win_codeblocks project, the lvgl version is V8.3.11.
  2. 32-bit Color depth
  3. set full_refresh=0 for partial refresh
  4. set direct_mode=1
  5. set background transparency
  6. use the following code in the main function to repeat the problem
lv_obj_t *scr = lv_scr_act();
lv_obj_set_style_bg_opa(scr, LV_OPA_TRANSP, 0); //Full transparent background
lv_example_anim_2();
lv_example_png_1();

Background transparency needs to be set, otherwise the problem cannot be reproduced!

Normal

direct_mode0

Abnormal

direct_mode1

How to reproduce?

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int nCmdShow)
{
    /*Initialize LittlevGL*/
    lv_init();

    /*Initialize the HAL for LittlevGL*/
    lv_win32_init(hInstance, SW_SHOWNORMAL, 854, 480, NULL);

    /*Output prompt information to the console, you can also use printf() to print directly*/
    LV_LOG_USER("LVGL initialization completed!");

/** add my test **/
    lv_obj_t *scr = lv_scr_act();
    lv_obj_set_style_bg_opa(scr, LV_OPA_TRANSP, 0); //Full transparent background
    lv_example_anim_2();
    lv_example_png_1();
/*****************/

    while(!lv_win32_quit_signal) {
        /* Periodically call the lv_task handler.
         * It could be done in a timer interrupt or an OS task too.*/
        lv_task_handler();
        usleep(10000);       /*Just to let the system breath*/
    }
    return 0;
}
kisvegabor commented 8 months ago

Hey,

I don't know immediately what the problem could be, but I would rather update the CodeBlocks repo to LVGL v9. Is it an option for you?

FYI, I transferred the issue to the Codeblocks repo.

jjzqp commented 8 months ago

LVGL v9 is not what I want, I am using v8.3.11. And this problem doesn't just occur under the codeblocks project, it also occurs on my embedded platform. Can you help me fix this on v8.3.11?

Hey,

I don't know immediately what the problem could be, but I would rather update the CodeBlocks repo to LVGL v9. Is it an option for you?

FYI, I transferred the issue to the Codeblocks repo.

kisvegabor commented 8 months ago

I see and I could reproduce the issue in Eclipse with SDL too. I can fix only later next week, but I can show you where the issue is.

Here LVGL clears the whole buffer, but in direct mode only the area where the rendering happens needs to be cleared.

So I would try this:

jjzqp commented 7 months ago

Thank you for your help. I tried your method, but it still didn't work out。Can you take care of this for me?

1 2