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-07-17 20:21:33 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-18 04:43:52 +0300
commit1f2edba1fbf39a40b07bdf37276d2650655a4edd (patch)
tree8a4421f5b3eeede0cc37cd1dde19d3c9983dfb45 /source/blender/windowmanager/intern/wm_draw.c
parentd19b3019d9aee026b7aab738624795da162f6a8b (diff)
Cleanup: GPU: Encapsulate scissor test
Diffstat (limited to 'source/blender/windowmanager/intern/wm_draw.c')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index fa335501d60..f6fc97f602b 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -106,7 +106,7 @@ static void wm_paintcursor_draw(bContext *C, ScrArea *area, ARegion *region)
if (pc->poll == NULL || pc->poll(C)) {
/* Prevent drawing outside region. */
- glEnable(GL_SCISSOR_TEST);
+ GPU_scissor_test(true);
GPU_scissor(region->winrct.xmin,
region->winrct.ymin,
BLI_rcti_size_x(&region->winrct) + 1,
@@ -121,7 +121,7 @@ static void wm_paintcursor_draw(bContext *C, ScrArea *area, ARegion *region)
pc->draw(C, win->eventstate->x, win->eventstate->y, pc->customdata);
}
- glDisable(GL_SCISSOR_TEST);
+ GPU_scissor_test(false);
}
}
}
@@ -461,7 +461,7 @@ static void wm_draw_region_bind(ARegion *region, int view)
/* For now scissor is expected by region drawing, we could disable it
* and do the enable/disable in the specific cases that setup scissor. */
- glEnable(GL_SCISSOR_TEST);
+ GPU_scissor_test(true);
GPU_scissor(0, 0, region->winx, region->winy);
}
@@ -480,7 +480,7 @@ static void wm_draw_region_unbind(ARegion *region)
GPU_viewport_unbind(region->draw_buffer->viewport);
}
else {
- glDisable(GL_SCISSOR_TEST);
+ GPU_scissor_test(false);
GPU_offscreen_unbind(region->draw_buffer->offscreen, false);
}
}