[mutter] cogl/context: Remove unusued window_buffer field



commit a91138c8f848b56e166fae069d83f96d05da01d1
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Nov 22 15:47:41 2019 +0100

    cogl/context: Remove unusued window_buffer field
    
    It kept track of the last "window" (i.e. CoglOnscreen) was the active
    on. It was used by API removed in the past, so also remove the left over
    field.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/935

 cogl/cogl/cogl-context-private.h                   |  1 -
 cogl/cogl/cogl-context.c                           |  1 -
 cogl/cogl/cogl-onscreen.c                          |  3 --
 cogl/cogl/deprecated/cogl-framebuffer-deprecated.c | 32 ----------------------
 4 files changed, 37 deletions(-)
---
diff --git a/cogl/cogl/cogl-context-private.h b/cogl/cogl/cogl-context-private.h
index 785295f90..112b0b211 100644
--- a/cogl/cogl/cogl-context-private.h
+++ b/cogl/cogl/cogl-context-private.h
@@ -193,7 +193,6 @@ struct _CoglContext
 
   /* Framebuffers */
   GSList           *framebuffer_stack;
-  CoglFramebuffer  *window_buffer;
   unsigned long     current_draw_buffer_state_flushed;
   unsigned long     current_draw_buffer_changes;
   CoglFramebuffer  *current_draw_buffer;
diff --git a/cogl/cogl/cogl-context.c b/cogl/cogl/cogl-context.c
index 0bc8163c7..9d1880f20 100644
--- a/cogl/cogl/cogl-context.c
+++ b/cogl/cogl/cogl-context.c
@@ -318,7 +318,6 @@ cogl_context_new (CoglDisplay *display,
   for (i = 0; i < COGL_BUFFER_BIND_TARGET_COUNT; i++)
     context->current_buffer[i] = NULL;
 
-  context->window_buffer = NULL;
   context->framebuffer_stack = _cogl_create_framebuffer_stack ();
 
   context->current_path = NULL;
diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c
index eafc750ae..2aab3950e 100644
--- a/cogl/cogl/cogl-onscreen.c
+++ b/cogl/cogl/cogl-onscreen.c
@@ -161,9 +161,6 @@ _cogl_onscreen_free (CoglOnscreen *onscreen)
     cogl_object_unref (frame_info);
   g_queue_clear (&onscreen->pending_frame_infos);
 
-  if (framebuffer->context->window_buffer == COGL_FRAMEBUFFER (onscreen))
-    framebuffer->context->window_buffer = NULL;
-
   winsys->onscreen_deinit (onscreen);
   g_return_if_fail (onscreen->winsys == NULL);
 
diff --git a/cogl/cogl/deprecated/cogl-framebuffer-deprecated.c 
b/cogl/cogl/deprecated/cogl-framebuffer-deprecated.c
index 15aefe3c0..72597ec95 100644
--- a/cogl/cogl/deprecated/cogl-framebuffer-deprecated.c
+++ b/cogl/cogl/deprecated/cogl-framebuffer-deprecated.c
@@ -85,24 +85,6 @@ _cogl_free_framebuffer_stack (GSList *stack)
   g_slist_free (stack);
 }
 
-static void
-notify_buffers_changed (CoglFramebuffer *old_draw_buffer,
-                        CoglFramebuffer *new_draw_buffer,
-                        CoglFramebuffer *old_read_buffer,
-                        CoglFramebuffer *new_read_buffer)
-{
-  /* XXX: To support the deprecated cogl_set_draw_buffer API we keep
-   * track of the last onscreen framebuffer that was set so that it
-   * can be restored if the COGL_WINDOW_BUFFER enum is used. A
-   * reference isn't taken to the framebuffer because otherwise we
-   * would have a circular reference between the context and the
-   * framebuffer. Instead the pointer is set to NULL in
-   * _cogl_onscreen_free as a kind of a cheap weak reference */
-  if (new_draw_buffer &&
-      new_draw_buffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN)
-    new_draw_buffer->context->window_buffer = new_draw_buffer;
-}
-
 /* Set the current framebuffer without checking if it's already the
  * current framebuffer. This is used by cogl_pop_framebuffer while
  * the top of the stack is currently not up to date. */
@@ -120,11 +102,6 @@ _cogl_set_framebuffers_real (CoglFramebuffer *draw_buffer,
 
   entry = ctx->framebuffer_stack->data;
 
-  notify_buffers_changed (entry->draw_buffer,
-                          draw_buffer,
-                          entry->read_buffer,
-                          read_buffer);
-
   if (draw_buffer)
     cogl_object_ref (draw_buffer);
   if (entry->draw_buffer)
@@ -233,7 +210,6 @@ void
 cogl_pop_framebuffer (void)
 {
   CoglFramebufferStackEntry *to_pop;
-  CoglFramebufferStackEntry *to_restore;
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -241,14 +217,6 @@ cogl_pop_framebuffer (void)
   g_assert (ctx->framebuffer_stack->next != NULL);
 
   to_pop = ctx->framebuffer_stack->data;
-  to_restore = ctx->framebuffer_stack->next->data;
-
-  if (to_pop->draw_buffer != to_restore->draw_buffer ||
-      to_pop->read_buffer != to_restore->read_buffer)
-    notify_buffers_changed (to_pop->draw_buffer,
-                            to_restore->draw_buffer,
-                            to_pop->read_buffer,
-                            to_restore->read_buffer);
 
   cogl_object_unref (to_pop->draw_buffer);
   cogl_object_unref (to_pop->read_buffer);


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