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>2019-05-28 00:21:39 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-28 15:22:22 +0300
commite0c1116ce3dfef8415b7a975e82cd1506383ed9c (patch)
tree5e1aac7b4ed95890e8025ef28ef8147338eeb861 /source/blender/draw/intern/draw_manager_exec.c
parent2e211d099f8d13b79cdf9057f77532c587311c3d (diff)
Cleanup: DRW: Rename DRW_STATE_BLEND_* for API clarity
Diffstat (limited to 'source/blender/draw/intern/draw_manager_exec.c')
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index b232cfd01ad..11c19b292f0 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -183,26 +183,27 @@ void drw_state_set(DRWState state)
/* Blending (all buffer) */
{
int test;
- if (CHANGED_ANY_STORE_VAR(DRW_STATE_BLEND | DRW_STATE_BLEND_PREMUL | DRW_STATE_ADDITIVE |
- DRW_STATE_MULTIPLY | DRW_STATE_ADDITIVE_FULL |
- DRW_STATE_BLEND_OIT | DRW_STATE_BLEND_PREMUL_UNDER,
+ if (CHANGED_ANY_STORE_VAR(DRW_STATE_BLEND_ALPHA | DRW_STATE_BLEND_ALPHA_PREMUL |
+ DRW_STATE_BLEND_ADD | DRW_STATE_BLEND_MUL |
+ DRW_STATE_BLEND_ADD_FULL | DRW_STATE_BLEND_OIT |
+ DRW_STATE_BLEND_ALPHA_UNDER_PREMUL,
test)) {
if (test) {
glEnable(GL_BLEND);
- if ((state & DRW_STATE_BLEND) != 0) {
+ if ((state & DRW_STATE_BLEND_ALPHA) != 0) {
glBlendFuncSeparate(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA, /* RGB */
GL_ONE,
GL_ONE_MINUS_SRC_ALPHA); /* Alpha */
}
- else if ((state & DRW_STATE_BLEND_PREMUL_UNDER) != 0) {
+ else if ((state & DRW_STATE_BLEND_ALPHA_UNDER_PREMUL) != 0) {
glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE);
}
- else if ((state & DRW_STATE_BLEND_PREMUL) != 0) {
+ else if ((state & DRW_STATE_BLEND_ALPHA_PREMUL) != 0) {
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
- else if ((state & DRW_STATE_MULTIPLY) != 0) {
+ else if ((state & DRW_STATE_BLEND_MUL) != 0) {
glBlendFunc(GL_DST_COLOR, GL_ZERO);
}
else if ((state & DRW_STATE_BLEND_OIT) != 0) {
@@ -211,14 +212,14 @@ void drw_state_set(DRWState state)
GL_ZERO,
GL_ONE_MINUS_SRC_ALPHA); /* Alpha */
}
- else if ((state & DRW_STATE_ADDITIVE) != 0) {
+ else if ((state & DRW_STATE_BLEND_ADD) != 0) {
/* Do not let alpha accumulate but premult the source RGB by it. */
glBlendFuncSeparate(GL_SRC_ALPHA,
GL_ONE, /* RGB */
GL_ZERO,
GL_ONE); /* Alpha */
}
- else if ((state & DRW_STATE_ADDITIVE_FULL) != 0) {
+ else if ((state & DRW_STATE_BLEND_ADD_FULL) != 0) {
/* Let alpha accumulate. */
glBlendFunc(GL_ONE, GL_ONE);
}