[gtk/wip/chergert/glproto: 56/94] only set viewport once




commit 665244e282cd3c70a0e8b37ad9e684f704318324
Author: Christian Hergert <chergert redhat com>
Date:   Sat Dec 26 15:25:35 2020 -0800

    only set viewport once

 gsk/next/gskglcommandqueue.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index dc365512bb..b4922f2fd0 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -946,9 +946,12 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self)
               glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
             }
 
-          if (width != batch->any.viewport.width ||
-              height != batch->any.viewport.height)
-            glViewport (0, 0, batch->any.viewport.width, batch->any.viewport.height);
+          if (width != batch->any.viewport.width || height != batch->any.viewport.height)
+            {
+              width = batch->any.viewport.width;
+              height = batch->any.viewport.height;
+              glViewport (0, 0, width, height);
+            }
 
           glClear (batch->clear.bits);
         break;
@@ -968,9 +971,12 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self)
               glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
             }
 
-          if (width != batch->any.viewport.width ||
-              height != batch->any.viewport.height)
-            glViewport (0, 0, batch->any.viewport.width, batch->any.viewport.height);
+          if (width != batch->any.viewport.width || height != batch->any.viewport.height)
+            {
+              width = batch->any.viewport.width;
+              height = batch->any.viewport.height;
+              glViewport (0, 0, width, height);
+            }
 
           if (batch->draw.bind_count > 0)
             {


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