[gtk/wip/chergert/glproto: 126/526] only set viewport once




commit 9e0b297356f6c249d730b4e73e0625e5e4392e81
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]