+1
−0
libs/hwui/ColorArea.cpp
0 → 100644
+111
−0
libs/hwui/ColorArea.h
0 → 100644
+112
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
Added the ColorArea class to track the app's overall polarity (i.e. dark or light theme) by counting the areas of backgrounds and their colors. This is used to determine if we should force invert the app, for instance if the user prefers dark theme but this app is mainly light. The idea is that we count the fill colors of any background-type draw calls: drawRect(), drawColor(), etc. If the area of light fills drawn to the screen is greater than the area of dark fills drawn to the screen, we can reasonably guess that the app is light theme, and vice-versa. Bug: 372558459 Flag: android.view.accessibility.force_invert_color Test: atest hwui_unit_tests Change-Id: I524c3f5cde0a65cad4087aeefdec8eb0477a7971