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



commit c206c79a0b8b7bdbd0e4e90fb9cca234840852f0
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 c0c3df7db..ec9b36301 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 8deb59e00..d976a501e 100644
--- a/cogl/cogl/cogl-framebuffer-private.h
+++ b/cogl/cogl/cogl-framebuffer-private.h
@@ -183,10 +183,6 @@ struct _CoglFramebuffer
   int                 clear_clip_y1;
   CoglBool            clear_clip_dirty;
 
-  /* Whether something has been drawn to the buffer since the last
-   * swap buffers or swap region. */
-  CoglBool            mid_scene;
-
   /* driver specific */
   CoglBool            dirty_bitmasks;
   CoglFramebufferBits bits;
@@ -270,9 +266,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 cfb0e1a06..5177b98d4 100644
--- a/cogl/cogl/cogl-framebuffer.c
+++ b/cogl/cogl/cogl-framebuffer.c
@@ -246,12 +246,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,
@@ -423,7 +417,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)
@@ -1163,12 +1156,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 a00afafdf..24ccc8b0f 100644
--- a/cogl/cogl/cogl-journal.c
+++ b/cogl/cogl/cogl-journal.c
@@ -1552,12 +1552,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 f5db270c8..bd2f6f0fb 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]