[mutter/gbsneto/software-picking: 172/172] cogl: Remove midscene tracking



commit 567b048bb7cde4fe7846fb60f521b9a7043e9192
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Feb 5 11:01:40 2019 -0200

    cogl: Remove midscene tracking
    
    Midscene tracking was used at a time that some Cogl users
    could call random OpenGL API without going through Cogl.
    That is not allowed anymore, and certainly not done by
    Mutter and GNOME Shell.
    
    Remove midscene tracking from CoglFramebuffer.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/402

 cogl/cogl/cogl-attribute.c           |  1 -
 cogl/cogl/cogl-framebuffer-private.h |  7 -------
 cogl/cogl/cogl-framebuffer.c         | 12 ------------
 cogl/cogl/cogl-journal.c             |  6 ------
 cogl/cogl/cogl-onscreen.c            |  2 --
 5 files changed, 28 deletions(-)
---
diff --git a/cogl/cogl/cogl-attribute.c b/cogl/cogl/cogl-attribute.c
index e92546285..731da1543 100644
--- a/cogl/cogl/cogl-attribute.c
+++ b/cogl/cogl/cogl-attribute.c
@@ -652,7 +652,6 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
    * pixel and the scene is just comprised of simple rectangles still
    * in the journal. For this optimization to work we need to track
    * when the framebuffer really does get drawn to. */
-  _cogl_framebuffer_mark_mid_scene (framebuffer);
   _cogl_framebuffer_mark_clear_clip_dirty (framebuffer);
 
   if (G_UNLIKELY (!(flags & COGL_DRAW_SKIP_LEGACY_STATE)) &&
diff --git a/cogl/cogl/cogl-framebuffer-private.h b/cogl/cogl/cogl-framebuffer-private.h
index 1f5b31e51..e1a639411 100644
--- a/cogl/cogl/cogl-framebuffer-private.h
+++ b/cogl/cogl/cogl-framebuffer-private.h
@@ -181,10 +181,6 @@ struct _CoglFramebuffer
   int                 clear_clip_y1;
   gboolean            clear_clip_dirty;
 
-  /* Whether something has been drawn to the buffer since the last
-   * swap buffers or swap region. */
-  gboolean            mid_scene;
-
   /* driver specific */
   gboolean            dirty_bitmasks;
   CoglFramebufferBits bits;
@@ -269,9 +265,6 @@ _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer,
 void
 _cogl_framebuffer_mark_clear_clip_dirty (CoglFramebuffer *framebuffer);
 
-void
-_cogl_framebuffer_mark_mid_scene (CoglFramebuffer *framebuffer);
-
 /*
  * _cogl_framebuffer_get_clip_stack:
  * @framebuffer: A #CoglFramebuffer
diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c
index f4d131315..9ffc4d136 100644
--- a/cogl/cogl/cogl-framebuffer.c
+++ b/cogl/cogl/cogl-framebuffer.c
@@ -241,12 +241,6 @@ _cogl_framebuffer_mark_clear_clip_dirty (CoglFramebuffer *framebuffer)
   framebuffer->clear_clip_dirty = TRUE;
 }
 
-void
-_cogl_framebuffer_mark_mid_scene (CoglFramebuffer *framebuffer)
-{
-  framebuffer->mid_scene = TRUE;
-}
-
 void
 cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
                           unsigned long buffers,
@@ -381,7 +375,6 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
 
 cleared:
 
-  _cogl_framebuffer_mark_mid_scene (framebuffer);
   _cogl_framebuffer_mark_clear_clip_dirty (framebuffer);
 
   if (buffers & COGL_BUFFER_BIT_DEPTH)
@@ -1062,12 +1055,7 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
   if (framebuffer->dither_enabled == dither_enabled)
     return;
 
-  cogl_flush (); /* Currently dithering changes aren't tracked in the journal */
   framebuffer->dither_enabled = dither_enabled;
-
-  if (framebuffer->context->current_draw_buffer == framebuffer)
-    framebuffer->context->current_draw_buffer_changes |=
-      COGL_FRAMEBUFFER_STATE_DITHER;
 }
 
 void
diff --git a/cogl/cogl/cogl-journal.c b/cogl/cogl/cogl-journal.c
index 15de64e1b..d587b2ed1 100644
--- a/cogl/cogl/cogl-journal.c
+++ b/cogl/cogl/cogl-journal.c
@@ -1555,12 +1555,6 @@ _cogl_journal_log_quad (CoglJournal  *journal,
 
   COGL_TIMER_START (_cogl_uprof_context, log_timer);
 
-  /* Adding something to the journal should mean that we are in the
-   * middle of the scene. Although this will also end up being set
-   * when the journal is actually flushed, we set it here explicitly
-   * so that we will know sooner */
-  _cogl_framebuffer_mark_mid_scene (framebuffer);
-
   /* If the framebuffer was previously empty then we'll take a
      reference to the current framebuffer. This reference will be
      removed when the journal is flushed */
diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c
index b06eea2a4..c68971c60 100644
--- a/cogl/cogl/cogl-onscreen.c
+++ b/cogl/cogl/cogl-onscreen.c
@@ -336,7 +336,6 @@ cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
     }
 
   onscreen->frame_counter++;
-  framebuffer->mid_scene = FALSE;
 }
 
 void
@@ -393,7 +392,6 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
     }
 
   onscreen->frame_counter++;
-  framebuffer->mid_scene = FALSE;
 }
 
 int


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