Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-23 12:11:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-23 13:04:24 +0300
commitf18e53745151eee946dcc01bc4b526994971daef (patch)
tree4694ed04ee9c9a4a509e6850ca1b65370c9a8444 /source/blender/editors/interface
parent846cac94db56ec1a51dea9f9e6d3138840741952 (diff)
Cleanup: GPU: Use explicit clear value in GPU_clear* commands
This replace `GPU_clear()` by `GPU_clear_color()` and `GPU_clear_depth()`. Since we always set the clear value before clearing, it is unecessary to track the clear color state. Moreover, it makes it clearer what we clear the framebuffer to.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_panel.c4
-rw-r--r--source/blender/editors/interface/interface_region_hud.c3
-rw-r--r--source/blender/editors/interface/resources.c7
3 files changed, 1 insertions, 13 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 812aa25568a..4f3c36c0b3b 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1442,10 +1442,6 @@ void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y)
void UI_panels_draw(const bContext *C, ARegion *region)
{
- if (region->alignment != RGN_ALIGN_FLOAT) {
- UI_ThemeClearColor(TH_BACK);
- }
-
/* Draw panels, selected on top. Also in reverse order, because
* UI blocks are added in reverse order and we need child panels
* to draw on top. */
diff --git a/source/blender/editors/interface/interface_region_hud.c b/source/blender/editors/interface/interface_region_hud.c
index 1773a7b3057..204653f047d 100644
--- a/source/blender/editors/interface/interface_region_hud.c
+++ b/source/blender/editors/interface/interface_region_hud.c
@@ -217,8 +217,7 @@ static void hud_region_draw(const bContext *C, ARegion *region)
{
UI_view2d_view_ortho(&region->v2d);
wmOrtho2_region_pixelspace(region);
- GPU_clear_color(0, 0, 0, 0.0f);
- GPU_clear(GPU_COLOR_BIT);
+ GPU_clear_color(0.0f, 0.0f, 0.0f, 0.0f);
if ((region->flag & RGN_FLAG_HIDDEN) == 0) {
ui_draw_menu_back(NULL,
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 84fe3e13426..4c2b71514a4 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1474,13 +1474,6 @@ void UI_ThemeClearColor(int colorid)
GPU_clear_color(col[0], col[1], col[2], 1.0f);
}
-void UI_ThemeClearColorAlpha(int colorid, float alpha)
-{
- float col[3];
- UI_GetThemeColor3fv(colorid, col);
- GPU_clear_color(col[0], col[1], col[2], alpha);
-}
-
int UI_ThemeMenuShadowWidth(void)
{
bTheme *btheme = UI_GetTheme();