diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/screen/area.c | 8 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 6 |
4 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 94937ce9db8..96aad89827f 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -269,7 +269,7 @@ static void draw_azone_arrow(float x1, float y1, float x2, float y2, AZEdge edge GPU_blend(false); } -static void region_draw_azone_tab_arrow(AZone *az) +static void region_draw_azone_tab_arrow(ScrArea *area, ARegion *region, AZone *az) { GPU_blend(true); @@ -289,7 +289,9 @@ static void region_draw_azone_tab_arrow(AZone *az) break; } - float color[4] = {0.05f, 0.05f, 0.05f, 0.4f}; + /* Workaround for different color spaces between normal areas and the ones using GPUViewports. */ + float alpha = WM_region_use_viewport(area, region) ? 0.6f : 0.4f; + float color[4] = {0.05f, 0.05f, 0.05f, alpha}; UI_draw_roundbox_aa( true, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, color); @@ -330,7 +332,7 @@ static void region_draw_azones(ScrArea *area, ARegion *region) if (az->region) { /* only display tab or icons when the region is hidden */ if (az->region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) { - region_draw_azone_tab_arrow(az); + region_draw_azone_tab_arrow(area, region, az); } } } diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl index 18f58d52f32..bdc87baf924 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl @@ -35,4 +35,6 @@ void main() if (butCo > 0.0) { fragColor.a = 1.0; } + + fragColor = blender_srgb_to_framebuffer_space(fragColor); } diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index bd534c51c9a..3af99a11a6b 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -870,6 +870,8 @@ void WM_generic_callback_free(struct wmGenericCallback *callback); void WM_generic_user_data_free(struct wmGenericUserData *user_data); +bool WM_region_use_viewport(struct ScrArea *area, struct ARegion *region); + #ifdef WITH_XR_OPENXR /* wm_xr.c */ bool WM_xr_session_exists(const wmXrData *xr); diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 63ad2e446ea..a01ab1377c1 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -293,7 +293,7 @@ static bool wm_region_use_viewport_by_type(short space_type, short region_type) return (ELEM(space_type, SPACE_VIEW3D, SPACE_IMAGE) && region_type == RGN_TYPE_WINDOW); } -static bool wm_region_use_viewport(ScrArea *area, ARegion *region) +bool WM_region_use_viewport(ScrArea *area, ARegion *region) { return wm_region_use_viewport_by_type(area->spacetype, region->regiontype); } @@ -658,7 +658,7 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo) LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { if (region->visible && region->do_draw) { CTX_wm_region_set(C, region); - bool use_viewport = wm_region_use_viewport(area, region); + bool use_viewport = WM_region_use_viewport(area, region); if (stereo && wm_draw_region_stereo_set(bmain, area, region, STEREO_LEFT_ID)) { wm_draw_region_buffer_create(region, true, use_viewport); @@ -1042,7 +1042,7 @@ void WM_draw_region_free(ARegion *region, bool hide) void wm_draw_region_test(bContext *C, ScrArea *area, ARegion *region) { /* Function for redraw timer benchmark. */ - bool use_viewport = wm_region_use_viewport(area, region); + bool use_viewport = WM_region_use_viewport(area, region); wm_draw_region_buffer_create(region, false, use_viewport); wm_draw_region_bind(region, 0); ED_region_do_draw(C, region); |