[gtk+] broadway: Remove window translation code



commit b436f06a947d824606c2db02b6b51e7d212a2f28
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Nov 6 12:31:27 2013 +0100

    broadway: Remove window translation code
    
    This is no longer used as we neutered gdk_window_scroll & co.

 gdk/broadway/broadway-output.c    |   21 ---------
 gdk/broadway/broadway-output.h    |    6 ---
 gdk/broadway/broadway-protocol.h  |    2 -
 gdk/broadway/broadway-server.c    |   91 -------------------------------------
 gdk/broadway/broadway.js          |   17 -------
 gdk/broadway/broadwayd.c          |   31 -------------
 gdk/broadway/gdkbroadway-server.c |   37 ---------------
 7 files changed, 0 insertions(+), 205 deletions(-)
---
diff --git a/gdk/broadway/broadway-output.c b/gdk/broadway/broadway-output.c
index 96b6f71..bcae8b8 100644
--- a/gdk/broadway/broadway-output.c
+++ b/gdk/broadway/broadway-output.c
@@ -210,27 +210,6 @@ write_header(BroadwayOutput *output, char op)
 }
 
 void
-broadway_output_copy_rectangles (BroadwayOutput *output,  int id,
-                                BroadwayRect *rects, int n_rects,
-                                int dx, int dy)
-{
-  int i;
-
-  write_header (output, BROADWAY_OP_COPY_RECTANGLES);
-  append_uint16 (output, id);
-  append_uint16 (output, n_rects);
-  for (i = 0; i < n_rects; i++)
-    {
-      append_uint16 (output, rects[i].x);
-      append_uint16 (output, rects[i].y);
-      append_uint16 (output, rects[i].width);
-      append_uint16 (output, rects[i].height);
-    }
-  append_uint16 (output, dx);
-  append_uint16 (output, dy);
-}
-
-void
 broadway_output_grab_pointer (BroadwayOutput *output,
                              int id,
                              gboolean owner_event)
diff --git a/gdk/broadway/broadway-output.h b/gdk/broadway/broadway-output.h
index 487dfad..4a7f261 100644
--- a/gdk/broadway/broadway-output.h
+++ b/gdk/broadway/broadway-output.h
@@ -67,12 +67,6 @@ void            broadway_output_put_rgba        (BroadwayOutput *output,
                                                 void           *data);
 void            broadway_output_surface_flush   (BroadwayOutput *output,
                                                 int             id);
-void            broadway_output_copy_rectangles (BroadwayOutput *output,
-                                                int             id,
-                                                BroadwayRect   *rects,
-                                                int             n_rects,
-                                                int             dx,
-                                                int             dy);
 void            broadway_output_grab_pointer    (BroadwayOutput *output,
                                                 int id,
                                                 gboolean owner_event);
diff --git a/gdk/broadway/broadway-protocol.h b/gdk/broadway/broadway-protocol.h
index fe7a8a4..d16d279 100644
--- a/gdk/broadway/broadway-protocol.h
+++ b/gdk/broadway/broadway-protocol.h
@@ -25,7 +25,6 @@ typedef enum {
 } BroadwayEventType;
 
 typedef enum {
-  BROADWAY_OP_COPY_RECTANGLES = 'b',
   BROADWAY_OP_GRAB_POINTER = 'g',
   BROADWAY_OP_UNGRAB_POINTER = 'u',
   BROADWAY_OP_NEW_SURFACE = 's',
@@ -127,7 +126,6 @@ typedef enum {
   BROADWAY_REQUEST_SHOW_WINDOW,
   BROADWAY_REQUEST_HIDE_WINDOW,
   BROADWAY_REQUEST_SET_TRANSIENT_FOR,
-  BROADWAY_REQUEST_TRANSLATE,
   BROADWAY_REQUEST_UPDATE,
   BROADWAY_REQUEST_MOVE_RESIZE,
   BROADWAY_REQUEST_GRAB_POINTER,
diff --git a/gdk/broadway/broadway-server.c b/gdk/broadway/broadway-server.c
index 114c650..d51551d 100644
--- a/gdk/broadway/broadway-server.c
+++ b/gdk/broadway/broadway-server.c
@@ -1381,97 +1381,6 @@ broadway_server_has_client (BroadwayServer *server)
 }
 
 static void
-_cairo_region (cairo_t         *cr,
-              const cairo_region_t *region)
-{
-  cairo_rectangle_int_t box;
-  gint n_boxes, i;
-
-  g_return_if_fail (cr != NULL);
-  g_return_if_fail (region != NULL);
-
-  n_boxes = cairo_region_num_rectangles (region);
-
-  for (i = 0; i < n_boxes; i++)
-    {
-      cairo_region_get_rectangle (region, i, &box);
-      cairo_rectangle (cr, box.x, box.y, box.width, box.height);
-    }
-}
-
-
-static void
-copy_region (cairo_surface_t *surface,
-            cairo_region_t *area,
-            gint            dx,
-            gint            dy)
-{
-  cairo_t *cr;
-
-  cr = cairo_create (surface);
-  cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
-
-  _cairo_region (cr, area);
-  cairo_clip (cr);
-
-  /* NB: This is a self-copy and Cairo doesn't support that yet.
-   * So we do a litle trick.
-   */
-  cairo_push_group (cr);
-
-  cairo_set_source_surface (cr, surface, dx, dy);
-  cairo_paint (cr);
-
-  cairo_pop_group_to_source (cr);
-  cairo_paint (cr);
-
-  cairo_destroy (cr);
-}
-
-gboolean
-broadway_server_window_translate (BroadwayServer *server,
-                                 gint id,
-                                 cairo_region_t *area,
-                                 gint            dx,
-                                 gint            dy)
-{
-  BroadwayWindow *window;
-  gboolean sent = FALSE;
-
-  window = g_hash_table_lookup (server->id_ht,
-                               GINT_TO_POINTER (id));
-  if (window == NULL)
-    return FALSE;
-
-  if (window->last_synced &&
-      server->output)
-    {
-      BroadwayRect *rects;
-      cairo_rectangle_int_t rect;
-      int i, n_rects;
-
-      copy_region (window->last_surface, area, dx, dy);
-      n_rects = cairo_region_num_rectangles (area);
-      rects = g_new (BroadwayRect, n_rects);
-      for (i = 0; i < n_rects; i++)
-       {
-         cairo_region_get_rectangle (area, i, &rect);
-         rects[i].x = rect.x;
-         rects[i].y = rect.y;
-         rects[i].width = rect.width;
-         rects[i].height = rect.height;
-       }
-      broadway_output_copy_rectangles (server->output,
-                                      window->id,
-                                      rects, n_rects, dx, dy);
-      g_free (rects);
-      sent = TRUE;
-    }
-
-  return sent;
-}
-
-static void
 diff_surfaces (cairo_surface_t *surface,
               cairo_surface_t *old_surface)
 {
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 4610c54..8619f61 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -156,23 +156,6 @@ function flushSurface(surface)
            context.drawImage(cmd.img, cmd.x, cmd.y);
            break;
 
-       case 'b': // copy rects
-           context.save();
-           context.beginPath();
-
-           for (var j = 0; j < cmd.rects.length; j++) {
-               var rect = cmd.rects[j];
-               context.rect(rect.x, rect.y, rect.w, rect.h);
-           }
-           context.clip();
-           // This seems to break chrome when src overlaps dest
-           // But source-over should be fine for rgb surfaces anyway
-           //context.globalCompositeOperation = "copy";
-           context.drawImage(surface.canvas,
-                             cmd.dx, cmd.dy);
-           context.restore();
-           break;
-
        default:
            alert("Unknown drawing op " + cmd.op);
        }
diff --git a/gdk/broadway/broadwayd.c b/gdk/broadway/broadwayd.c
index 3590e19..eb98528 100644
--- a/gdk/broadway/broadwayd.c
+++ b/gdk/broadway/broadwayd.c
@@ -124,26 +124,6 @@ send_reply (BroadwayClient *client,
     }
 }
 
-static cairo_region_t *
-region_from_rects (BroadwayRect *rects, int n_rects)
-{
-  cairo_region_t *region;
-  cairo_rectangle_int_t *cairo_rects;
-  int i;
-  
-  cairo_rects = g_new (cairo_rectangle_int_t, n_rects);
-  for (i = 0; i < n_rects; i++)
-    {
-      cairo_rects[i].x = rects[i].x;
-      cairo_rects[i].y = rects[i].y;
-      cairo_rects[i].width = rects[i].width;
-      cairo_rects[i].height = rects[i].height;
-    }
-  region = cairo_region_create_rectangles (cairo_rects, n_rects);
-  g_free (cairo_rects);
-  return region;
-}
-
 void
 add_client_serial_mapping (BroadwayClient *client,
                           guint32 client_serial,
@@ -217,7 +197,6 @@ client_handle_request (BroadwayClient *client,
   BroadwayReplyQueryMouse reply_query_mouse;
   BroadwayReplyGrabPointer reply_grab_pointer;
   BroadwayReplyUngrabPointer reply_ungrab_pointer;
-  cairo_region_t *area;
   cairo_surface_t *surface;
   guint32 before_serial, now_serial;
 
@@ -274,16 +253,6 @@ client_handle_request (BroadwayClient *client,
                                                request->set_transient_for.id,
                                                request->set_transient_for.parent);
       break;
-    case BROADWAY_REQUEST_TRANSLATE:
-      area = region_from_rects (request->translate.rects,
-                               request->translate.n_rects);
-      broadway_server_window_translate (server,
-                                       request->translate.id,
-                                       area,
-                                       request->translate.dx,
-                                       request->translate.dy);
-      cairo_region_destroy (area);
-      break;
     case BROADWAY_REQUEST_UPDATE:
       surface = broadway_server_open_surface (server,
                                              request->update.id,
diff --git a/gdk/broadway/gdkbroadway-server.c b/gdk/broadway/gdkbroadway-server.c
index 5017ef2..268f9f5 100644
--- a/gdk/broadway/gdkbroadway-server.c
+++ b/gdk/broadway/gdkbroadway-server.c
@@ -509,43 +509,6 @@ _gdk_broadway_server_window_set_transient_for (GdkBroadwayServer *server,
                                    BROADWAY_REQUEST_SET_TRANSIENT_FOR);
 }
 
-gboolean
-_gdk_broadway_server_window_translate (GdkBroadwayServer *server,
-                                      gint id,
-                                      cairo_region_t *area,
-                                      gint            dx,
-                                      gint            dy)
-{
-  BroadwayRequestTranslate *msg;
-  cairo_rectangle_int_t rect;
-  int i, n_rects;
-  gsize msg_size;
-
-  n_rects = cairo_region_num_rectangles (area);
-
-  msg_size = sizeof (BroadwayRequestTranslate) + (n_rects-1) * sizeof (BroadwayRect);
-  msg = g_malloc (msg_size);
-
-  msg->id = id;
-  msg->dx = dx;
-  msg->dy = dy;
-  msg->n_rects = n_rects;
-  
-  for (i = 0; i < n_rects; i++)
-    {
-      cairo_region_get_rectangle (area, i, &rect);
-      msg->rects[i].x = rect.x;
-      msg->rects[i].y = rect.y;
-      msg->rects[i].width = rect.width;
-      msg->rects[i].height = rect.height;
-    }
-
-  gdk_broadway_server_send_message_with_size (server, (BroadwayRequestBase *)msg, msg_size,
-                                             BROADWAY_REQUEST_TRANSLATE);
-  g_free (msg);
-  return TRUE;
-}
-
 static void *
 map_named_shm (char *name, gsize size)
 {


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