Fix brightness
authorMateusz Majewski <m.majewski2@samsung.com>
Wed, 3 Jul 2024 06:28:12 +0000 (08:28 +0200)
committerMateusz Majewski <m.majewski2@samsung.com>
Wed, 3 Jul 2024 06:28:12 +0000 (08:28 +0200)
Change-Id: I9be37fe32b89a573c0bf586184a16075adf3632c

tizen/src/hw/pci/maru_brightness.c
tizen/src/ui/qt5.c
tizen/src/ui/qt5_supplement.cpp
tizen/src/ui/qt5_supplement.h

index 225fa77d89f52201e990ee501d0dcfcf3173b68b..9e4c7b6d13e348b212b23643c96b886610947fea 100644 (file)
@@ -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,
index cbec6f8e7a09ac8a54411a16c1345c0985a736d6..91ae8f5aa57526618ae0571a351b979287d545d8 100644 (file)
@@ -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,
index 9c6314e1140b0465210b00a815f69c9da5bf44ef..13abcc49accde47e3a6f3a14fe38e4f8dad08f46 100644 (file)
@@ -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
index b5ec02a8c0ee11c36f41330d30bb39681ba073d8..b3431674efbdedc19145d29219447f46499aa34d 100644 (file)
@@ -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