[Bf-blender-cvs] [ba75e93c888] master: Cleanup: DRW: Remove DRW_STATE_OFFSET

Clément Foucault noreply at git.blender.org
Mon May 27 12:58:22 CEST 2019


Commit: ba75e93c8882df10d2027aa1ffa0347337b54160
Author: Clément Foucault
Date:   Sun May 26 02:12:35 2019 +0200
Branches: master
https://developer.blender.org/rBba75e93c8882df10d2027aa1ffa0347337b54160

Cleanup: DRW: Remove DRW_STATE_OFFSET

===================================================================

M	source/blender/draw/intern/DRW_render.h
M	source/blender/draw/intern/draw_manager_exec.c

===================================================================

diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index 0f019df9d86..9de90dc5491 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -349,10 +349,6 @@ typedef enum {
   DRW_STATE_CLIP_PLANES = (1 << 22),
   DRW_STATE_WIRE_SMOOTH = (1 << 23),
   DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 24),
-  /** Polygon offset. Does not work with lines and points. */
-  DRW_STATE_OFFSET_POSITIVE = (1 << 25),
-  /** Polygon offset. Does not work with lines and points. */
-  DRW_STATE_OFFSET_NEGATIVE = (1 << 26),
 } DRWState;
 
 #define DRW_STATE_DEFAULT \
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index 7c53d8f4fff..8c4acb1f2d2 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -306,33 +306,6 @@ void drw_state_set(DRWState state)
     }
   }
 
-  /* Polygon Offset */
-  {
-    int test;
-    if (CHANGED_ANY_STORE_VAR(DRW_STATE_OFFSET_POSITIVE | DRW_STATE_OFFSET_NEGATIVE, test)) {
-      if (test) {
-        glEnable(GL_POLYGON_OFFSET_FILL);
-        glEnable(GL_POLYGON_OFFSET_LINE);
-        glEnable(GL_POLYGON_OFFSET_POINT);
-        /* Stencil Write */
-        if ((state & DRW_STATE_OFFSET_POSITIVE) != 0) {
-          glPolygonOffset(1.0f, 1.0f);
-        }
-        else if ((state & DRW_STATE_OFFSET_NEGATIVE) != 0) {
-          glPolygonOffset(-1.0f, -1.0f);
-        }
-        else {
-          BLI_assert(0);
-        }
-      }
-      else {
-        glDisable(GL_POLYGON_OFFSET_FILL);
-        glDisable(GL_POLYGON_OFFSET_LINE);
-        glDisable(GL_POLYGON_OFFSET_POINT);
-      }
-    }
-  }
-
 #undef CHANGED_TO
 #undef CHANGED_ANY
 #undef CHANGED_ANY_STORE_VAR



More information about the Bf-blender-cvs mailing list