emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113974: Redesign redisplay interface to drop update


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r113974: Redesign redisplay interface to drop updated_row and updated_area.
Date: Fri, 23 Aug 2013 03:05:28 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113974
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Fri 2013-08-23 07:03:37 +0400
message:
  Redesign redisplay interface to drop updated_row and updated_area.
  * dispextern.h (updated_row, updated_area): Remove declaration.
  (struct redisplay_interface): Pass glyph row and row area parameters
  to write_glyphs, insert_glyphs and clear_end_of_line functions.
  (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
  Adjust prototypes.
  * dispnew.c (updated_row, updated_area): Remove.
  (redraw_overlapped_rows, update_window_line): Adjust user.
  (update_marginal_area, update_text_area): Likewise.  Pass updated row
  as a parameter.  Prefer enum glyph_row_area to int where appropriate.
  * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
  Adjust users.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/dispextern.h               
dispextern.h-20091113204419-o5vbwnq5f7feedwu-218
  src/dispnew.c                  dispnew.c-20091113204419-o5vbwnq5f7feedwu-258
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-22 18:29:51 +0000
+++ b/src/ChangeLog     2013-08-23 03:03:37 +0000
@@ -1,3 +1,18 @@
+2013-08-23  Dmitry Antipov  <address@hidden>
+
+       Redesign redisplay interface to drop updated_row and updated_area.
+       * dispextern.h (updated_row, updated_area): Remove declaration.
+       (struct redisplay_interface): Pass glyph row and row area parameters
+       to write_glyphs, insert_glyphs and clear_end_of_line functions.
+       (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
+       Adjust prototypes.
+       * dispnew.c (updated_row, updated_area): Remove.
+       (redraw_overlapped_rows, update_window_line): Adjust user.
+       (update_marginal_area, update_text_area): Likewise.  Pass updated row
+       as a parameter.  Prefer enum glyph_row_area to int where appropriate.
+       * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
+       Adjust users.
+
 2013-08-22  Paul Eggert  <address@hidden>
 
        * process.c (flush_pending_output): Remove stub.

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2013-08-08 14:51:07 +0000
+++ b/src/dispextern.h  2013-08-23 03:03:37 +0000
@@ -1197,11 +1197,6 @@
 
 extern struct glyph space_glyph;
 
-/* Glyph row and area updated by update_window_line.  */
-
-extern struct glyph_row *updated_row;
-extern int updated_area;
-
 /* Non-zero means last display completed.  Zero means it was
    preempted.  */
 
@@ -2713,12 +2708,17 @@
 
   /* Write or insert LEN glyphs from STRING at the nominal output
      position.  */
-  void (*write_glyphs) (struct window *w, struct glyph *string, int len);
-  void (*insert_glyphs) (struct window *w, struct glyph *start, int len);
+  void (*write_glyphs) (struct window *w, struct glyph_row *row,
+                       struct glyph *string, enum glyph_row_area area,
+                       int len);
+  void (*insert_glyphs) (struct window *w, struct glyph_row *row,
+                        struct glyph *start, enum glyph_row_area area,
+                        int len);
 
   /* Clear from nominal output position to X.  X < 0 means clear
      to right end of display.  */
-  void (*clear_end_of_line) (struct window *w, int x);
+  void (*clear_end_of_line) (struct window *w, struct glyph_row *row,
+                            enum glyph_row_area area, int x);
 
   /* Function to call to scroll the display as described by RUN on
      window W.  */
@@ -3178,9 +3178,12 @@
                                    int *, int *);
 extern void x_produce_glyphs (struct it *);
 
-extern void x_write_glyphs (struct window *, struct glyph *, int);
-extern void x_insert_glyphs (struct window *, struct glyph *, int len);
-extern void x_clear_end_of_line (struct window *, int);
+extern void x_write_glyphs (struct window *, struct glyph_row *,
+                           struct glyph *, enum glyph_row_area, int);
+extern void x_insert_glyphs (struct window *, struct glyph_row *,
+                            struct glyph *, enum glyph_row_area, int);
+extern void x_clear_end_of_line (struct window *, struct glyph_row *,
+                                enum glyph_row_area, int);
 
 extern struct cursor_pos output_cursor;
 

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2013-08-14 05:41:48 +0000
+++ b/src/dispnew.c     2013-08-23 03:03:37 +0000
@@ -135,11 +135,6 @@
 
 static bool delayed_size_change;
 
-/* Glyph row updated in update_window_line, and area that is updated.  */
-
-struct glyph_row *updated_row;
-int updated_area;
-
 /* A glyph for a space.  */
 
 struct glyph space_glyph;
@@ -3230,14 +3225,12 @@
 
          for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
            {
-             updated_row = row;
-             updated_area = area;
              FRAME_RIF (f)->cursor_to (w, i, 0, row->y,
                                         area == TEXT_AREA ? row->x : 0);
              if (row->used[area])
-               FRAME_RIF (f)->write_glyphs (w, row->glyphs[area],
-                                             row->used[area]);
-             FRAME_RIF (f)->clear_end_of_line (w, -1);
+               FRAME_RIF (f)->write_glyphs (w, row, row->glyphs[area],
+                                             area, row->used[area]);
+             FRAME_RIF (f)->clear_end_of_line (w, row, area, -1);
            }
 
          row->overlapped_p = 0;
@@ -3511,22 +3504,20 @@
    AREA can be either LEFT_MARGIN_AREA or RIGHT_MARGIN_AREA.  */
 
 static void
-update_marginal_area (struct window *w, int area, int vpos)
+update_marginal_area (struct window *w, struct glyph_row *updated_row,
+                     enum glyph_row_area area, int vpos)
 {
   struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
   struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
 
-  /* Let functions in xterm.c know what area subsequent X positions
-     will be relative to.  */
-  updated_area = area;
-
   /* Set cursor to start of glyphs, write them, and clear to the end
      of the area.  I don't think that something more sophisticated is
      necessary here, since marginal areas will not be the default.  */
   rif->cursor_to (w, vpos, 0, desired_row->y, 0);
   if (desired_row->used[area])
-    rif->write_glyphs (w, desired_row->glyphs[area], desired_row->used[area]);
-  rif->clear_end_of_line (w, -1);
+    rif->write_glyphs (w, updated_row, desired_row->glyphs[area],
+                      area, desired_row->used[area]);
+  rif->clear_end_of_line (w, updated_row, area, -1);
 }
 
 
@@ -3534,17 +3525,13 @@
    Value is true if display has changed.  */
 
 static bool
-update_text_area (struct window *w, int vpos)
+update_text_area (struct window *w, struct glyph_row *updated_row, int vpos)
 {
   struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
   struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
   struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
   bool changed_p = 0;
 
-  /* Let functions in xterm.c know what area subsequent X positions
-     will be relative to.  */
-  updated_area = TEXT_AREA;
-
   /* If rows are at different X or Y, or rows have different height,
      or the current row is marked invalid, write the entire line.  */
   if (!current_row->enabled_p
@@ -3567,11 +3554,11 @@
       rif->cursor_to (w, vpos, 0, desired_row->y, desired_row->x);
 
       if (desired_row->used[TEXT_AREA])
-       rif->write_glyphs (w, desired_row->glyphs[TEXT_AREA],
-                          desired_row->used[TEXT_AREA]);
+       rif->write_glyphs (w, updated_row, desired_row->glyphs[TEXT_AREA],
+                          TEXT_AREA, desired_row->used[TEXT_AREA]);
 
       /* Clear to end of window.  */
-      rif->clear_end_of_line (w, -1);
+      rif->clear_end_of_line (w, updated_row, TEXT_AREA, -1);
       changed_p = 1;
 
       /* This erases the cursor.  We do this here because
@@ -3708,7 +3695,8 @@
                }
 
              rif->cursor_to (w, vpos, start_hpos, desired_row->y, start_x);
-             rif->write_glyphs (w, start, i - start_hpos);
+             rif->write_glyphs (w, updated_row, start,
+                                TEXT_AREA, i - start_hpos);
              changed_p = 1;
            }
        }
@@ -3717,7 +3705,8 @@
       if (i < desired_row->used[TEXT_AREA])
        {
          rif->cursor_to (w, vpos, i, desired_row->y, x);
-         rif->write_glyphs (w, desired_glyph, desired_row->used[TEXT_AREA] - 
i);
+         rif->write_glyphs (w, updated_row, desired_glyph,
+                            TEXT_AREA, desired_row->used[TEXT_AREA] - i);
          changed_p = 1;
        }
 
@@ -3739,7 +3728,7 @@
          if (i >= desired_row->used[TEXT_AREA])
            rif->cursor_to (w, vpos, i, desired_row->y,
                            desired_row->pixel_width);
-         rif->clear_end_of_line (w, -1);
+         rif->clear_end_of_line (w, updated_row, TEXT_AREA, -1);
          changed_p = 1;
        }
       else if (desired_row->pixel_width < current_row->pixel_width)
@@ -3767,7 +3756,7 @@
            }
          else
            xlim = current_row->pixel_width;
-         rif->clear_end_of_line (w, xlim);
+         rif->clear_end_of_line (w, updated_row, TEXT_AREA, xlim);
          changed_p = 1;
        }
     }
@@ -3786,10 +3775,6 @@
   struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
   bool changed_p = 0;
 
-  /* Set the row being updated.  This is important to let xterm.c
-     know what line height values are in effect.  */
-  updated_row = desired_row;
-
   /* A row can be completely invisible in case a desired matrix was
      built with a vscroll and then make_cursor_line_fully_visible shifts
      the matrix.  Make sure to make such rows current anyway, since
@@ -3803,7 +3788,7 @@
       if (!desired_row->full_width_p && w->left_margin_cols > 0)
        {
          changed_p = 1;
-         update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
+         update_marginal_area (w, desired_row, LEFT_MARGIN_AREA, vpos);
          /* Setting this flag will ensure the vertical border, if
             any, between this window and the one on its left will be
             redrawn.  This is necessary because updating the left
@@ -3812,7 +3797,7 @@
        }
 
       /* Update the display of the text area.  */
-      if (update_text_area (w, vpos))
+      if (update_text_area (w, desired_row, vpos))
        {
          changed_p = 1;
          if (current_row->mouse_face_p)
@@ -3823,7 +3808,7 @@
       if (!desired_row->full_width_p && w->right_margin_cols > 0)
        {
          changed_p = 1;
-         update_marginal_area (w, RIGHT_MARGIN_AREA, vpos);
+         update_marginal_area (w, desired_row, RIGHT_MARGIN_AREA, vpos);
        }
 
       /* Draw truncation marks etc.  */
@@ -3842,7 +3827,6 @@
 
   /* Update current_row from desired_row.  */
   make_current (w->desired_matrix, w->current_matrix, vpos);
-  updated_row = NULL;
   return changed_p;
 }
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2013-08-15 16:28:42 +0000
+++ b/src/xdisp.c       2013-08-23 03:03:37 +0000
@@ -25763,12 +25763,12 @@
 
 /* EXPORT for RIF:
    Output LEN glyphs starting at START at the nominal cursor position.
-   Advance the nominal cursor over the text.  The global variable
-   updated_row is the glyph row being updated, and updated_area is the
-   area of that row being updated.  */
+   Advance the nominal cursor over the text.  UPDATED_ROW is the glyph row
+   being updated, and UPDATED_AREA is the area of that row being updated.  */
 
 void
-x_write_glyphs (struct window *w, struct glyph *start, int len)
+x_write_glyphs (struct window *w, struct glyph_row *updated_row,
+               struct glyph *start, enum glyph_row_area updated_area, int len)
 {
   int x, hpos, chpos = w->phys_cursor.hpos;
 
@@ -25811,7 +25811,8 @@
    Insert LEN glyphs from START at the nominal cursor position.  */
 
 void
-x_insert_glyphs (struct window *w, struct glyph *start, int len)
+x_insert_glyphs (struct window *w, struct glyph_row *updated_row,
+                struct glyph *start, enum glyph_row_area updated_area, int len)
 {
   struct frame *f;
   int line_height, shift_by_width, shifted_region_width;
@@ -25863,11 +25864,12 @@
    (inclusive) to pixel column TO_X (exclusive).  The idea is that
    everything from TO_X onward is already erased.
 
-   TO_X is a pixel position relative to updated_area of currently
+   TO_X is a pixel position relative to UPDATED_AREA of currently
    updated window W.  TO_X == -1 means clear to the end of this area.  */
 
 void
-x_clear_end_of_line (struct window *w, int to_x)
+x_clear_end_of_line (struct window *w, struct glyph_row *updated_row,
+                    enum glyph_row_area updated_area, int to_x)
 {
   struct frame *f;
   int max_x, min_y, max_y;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]