[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (53bd26d2735fd8e0a443bc724e2e4f7bfaca85cc)



The branch, master has been updated
       via  53bd26d2735fd8e0a443bc724e2e4f7bfaca85cc (commit)
      from  b0177cbf7a124f5bf537dfaebc7a78c9aa01bf28 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/gtkhid-gl.c |   65 +++++++++++++++++++++++++++++------------------
 1 files changed, 40 insertions(+), 25 deletions(-)


=================
 Commit Messages
=================

commit 53bd26d2735fd8e0a443bc724e2e4f7bfaca85cc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    GTK/GL: Split out sub-compositing setup into a separate function.

:100644 100644 3c12833... 8af8a03... M	src/hid/gtk/gtkhid-gl.c

=========
 Changes
=========

commit 53bd26d2735fd8e0a443bc724e2e4f7bfaca85cc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    GTK/GL: Split out sub-compositing setup into a separate function.

diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index 3c12833..8af8a03 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -60,12 +60,47 @@ typedef struct hid_gc_struct
 }
 hid_gc_struct;
 
+static void
+start_subcomposite (void)
+{
+  render_priv *priv = gport->render_priv;
+  int stencil_bit;
+
+  /* Flush out any existing geoemtry to be rendered */
+  hidgl_flush_triangles (&buffer);
+
+  glEnable (GL_STENCIL_TEST);                                 /* Enable Stencil test */
+  glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE);                 /* Stencil pass => replace stencil value (with 1) */
+
+  stencil_bit = hidgl_assign_clear_stencil_bit();             /* Get a new (clean) bitplane to stencil with */
+  glStencilMask (stencil_bit);                                /* Only write to our subcompositing stencil bitplane */
+  glStencilFunc (GL_GREATER, stencil_bit, stencil_bit);       /* Pass stencil test if our assigned bit is clear */
+
+  priv->subcomposite_stencil_bit = stencil_bit;
+}
+
+static void
+end_subcomposite (void)
+{
+  render_priv *priv = gport->render_priv;
+
+  /* Flush out any existing geoemtry to be rendered */
+  hidgl_flush_triangles (&buffer);
+
+  hidgl_return_stencil_bit (priv->subcomposite_stencil_bit);  /* Relinquish any bitplane we previously used */
+
+  glStencilMask (0);
+  glStencilFunc (GL_ALWAYS, 0, 0);                            /* Always pass stencil test */
+  glDisable (GL_STENCIL_TEST);                                /* Disable Stencil test */
+
+  priv->subcomposite_stencil_bit = 0;
+}
+
 
 int
 ghid_set_layer (const char *name, int group, int empty)
 {
   render_priv *priv = gport->render_priv;
-  int stencil_bit;
   int idx = group;
   if (idx >= 0 && idx < max_group)
     {
@@ -78,19 +113,10 @@ ghid_set_layer (const char *name, int group, int empty)
 	    break;
 	}
       idx = PCB->LayerGroups.Entries[group][idx];
-    }
-
-  /* Flush out any existing geoemtry to be rendered */
-  hidgl_flush_triangles (&buffer);
+  }
 
-  glEnable (GL_STENCIL_TEST);                                 /* Enable Stencil test */
-  glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE);                 /* Stencil pass => replace stencil value (with 1) */
-
-  hidgl_return_stencil_bit (priv->subcomposite_stencil_bit);  /* Relinquish any bitplane we previously used */
-  stencil_bit = hidgl_assign_clear_stencil_bit();             /* Get a new (clean) bitplane to stencil with */
-  glStencilFunc (GL_GREATER, stencil_bit, stencil_bit);       /* Pass stencil test if our assigned bit is clear */
-  glStencilMask (stencil_bit);                                /* Only write to our subcompositing stencil bitplane */
-  priv->subcomposite_stencil_bit = stencil_bit;
+  end_subcomposite ();
+  start_subcomposite ();
 
   if (idx >= 0 && idx < max_copper_layer + 2)
     {
@@ -129,18 +155,7 @@ ghid_set_layer (const char *name, int group, int empty)
 static void
 ghid_end_layer (void)
 {
-  render_priv *priv = gport->render_priv;
-
-  /* Flush out any existing geoemtry to be rendered */
-  hidgl_flush_triangles (&buffer);
-
-  /* Relinquish any bitplane we previously used */
-  hidgl_return_stencil_bit (priv->subcomposite_stencil_bit);
-  priv->subcomposite_stencil_bit = 0;
-
-  /* Always pass stencil test */
-  glStencilMask (0);
-  glStencilFunc (GL_ALWAYS, 0, 0);
+  end_subcomposite ();
 }
 
 void




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs