From: Mateusz Majewski Date: Wed, 3 Jul 2024 06:28:12 +0000 (+0200) Subject: Fix brightness X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5325a88afe9f44b15cca8728c7d37ffb04094819;p=sdk%2Femulator%2Fqemu.git Fix brightness Change-Id: I9be37fe32b89a573c0bf586184a16075adf3632c --- diff --git a/tizen/src/hw/pci/maru_brightness.c b/tizen/src/hw/pci/maru_brightness.c index 225fa77d89..9e4c7b6d13 100644 --- a/tizen/src/hw/pci/maru_brightness.c +++ b/tizen/src/hw/pci/maru_brightness.c @@ -38,6 +38,7 @@ #include "hw/maru_device_ids.h" #include "maru_brightness.h" #include "debug_ch.h" +#include "qt5_supplement.h" MULTI_DEBUG_CHANNEL(tizen, brightness); @@ -137,7 +138,12 @@ static void maru_pixman_image_set_alpha(uint8_t value) level_color.alpha = value << 8; brightness_image = pixman_image_create_solid_fill(&level_color); - graphic_hw_invalidate(NULL); +#ifdef CONFIG_OPENGL + if (display_opengl) + qt5_gl_display_force_redraw(); + else +#endif + graphic_hw_invalidate(NULL); } static void brightness_reg_write(void *opaque, diff --git a/tizen/src/ui/qt5.c b/tizen/src/ui/qt5.c index cbec6f8e7a..91ae8f5aa5 100644 --- a/tizen/src/ui/qt5.c +++ b/tizen/src/ui/qt5.c @@ -153,6 +153,9 @@ static void qt5_gl_update(DisplayChangeListener *dcl, qt5_gl_make_context_current_internal(con->ctx); surface_gl_update_texture(con->gls, con->surface, x, y, w, h); con->updated = true; + + /* Note that, unlike non-GL, we do not call composite_brightness_image. + * In this case, brightness rendering is the responsibility of the display. */ } static void qt5_gl_switch(DisplayChangeListener *dcl, diff --git a/tizen/src/ui/qt5_supplement.cpp b/tizen/src/ui/qt5_supplement.cpp index 9c6314e114..13abcc49ac 100644 --- a/tizen/src/ui/qt5_supplement.cpp +++ b/tizen/src/ui/qt5_supplement.cpp @@ -686,4 +686,11 @@ void *qt5_gl_get_current_context_internal() { return QOpenGLContext::currentContext(); } + +void qt5_gl_display_force_redraw() +{ + if (mainwindow) { + ((DisplayGLWidget *)mainwindow->getDisplay())->update(); + } +} #endif diff --git a/tizen/src/ui/qt5_supplement.h b/tizen/src/ui/qt5_supplement.h index b5ec02a8c0..b3431674ef 100644 --- a/tizen/src/ui/qt5_supplement.h +++ b/tizen/src/ui/qt5_supplement.h @@ -69,6 +69,7 @@ void *qt5_gl_create_context_internal(int major, int minor); void qt5_gl_destroy_context_internal(void *); int qt5_gl_make_context_current_internal(void *_ctx); void *qt5_gl_get_current_context_internal(void); +void qt5_gl_display_force_redraw(void); #endif #ifdef __cplusplus