@@ -80,7 +80,7 @@ typedef enum MouseShapes { BEAM, HAND, ARROW } MouseShape;
8080 (c)->reverse = (a >> REVERSE_SHIFT) & 1; (c)->strikethrough = (a >> STRIKE_SHIFT) & 1; (c)->dim = (a >> DIM_SHIFT) & 1;
8181
8282#define COPY_CELL (src , s , dest , d ) \
83- (dest)->cells [d] = (src)->cells [s];
83+ (dest)->cpu_cells [d] = (src)->cpu_cells[s]; (dest)->gpu_cells[d] = (src)->gpu_cells [s];
8484
8585#define COPY_SELF_CELL (s , d ) COPY_CELL(self, s, self, d)
8686
@@ -140,15 +140,19 @@ typedef struct {
140140 color_type fg , bg , decoration_fg ;
141141 sprite_index sprite_x , sprite_y , sprite_z ;
142142 attrs_type attrs ;
143- // The following are only needed on the CPU, not the GPU
143+ } GPUCell ;
144+
145+ typedef struct {
144146 char_type ch ;
145147 combining_type cc_idx [2 ];
146- } Cell ;
148+ } CPUCell ;
149+
147150
148151typedef struct {
149152 PyObject_HEAD
150153
151- Cell * cells ;
154+ GPUCell * gpu_cells ;
155+ CPUCell * cpu_cells ;
152156 index_type xnum , ynum ;
153157 bool continued , needs_free , has_dirty_text ;
154158} Line ;
@@ -157,14 +161,16 @@ typedef struct {
157161typedef struct {
158162 PyObject_HEAD
159163
160- Cell * buf ;
164+ GPUCell * gpu_cell_buf ;
165+ CPUCell * cpu_cell_buf ;
161166 index_type xnum , ynum , * line_map , * scratch ;
162167 line_attrs_type * line_attrs ;
163168 Line * line ;
164169} LineBuf ;
165170
166171typedef struct {
167- Cell * cells ;
172+ GPUCell * gpu_cells ;
173+ CPUCell * cpu_cells ;
168174 line_attrs_type * line_attrs ;
169175} HistoryBufSegment ;
170176
@@ -226,10 +232,10 @@ typedef struct {FONTS_DATA_HEAD} *FONTS_DATA_HANDLE;
226232 for(index_type __i__ = (at); __i__ < (line)->xnum - (num); __i__++) { \
227233 COPY_CELL(line, __i__ + (num), line, __i__) \
228234 } \
229- if ((((line)->cells [(at)].attrs) & WIDTH_MASK) != 1) { \
230- (line)->cells [(at)].ch = BLANK_CHAR; \
231- (line)->cells [(at)].attrs = BLANK_CHAR ? 1 : 0; \
232- clear_sprite_position((line)->cells [(at)]); \
235+ if ((((line)->gpu_cells [(at)].attrs) & WIDTH_MASK) != 1) { \
236+ (line)->cpu_cells [(at)].ch = BLANK_CHAR; \
237+ (line)->gpu_cells [(at)].attrs = BLANK_CHAR ? 1 : 0; \
238+ clear_sprite_position((line)->gpu_cells [(at)]); \
233239 }\
234240}
235241
@@ -260,7 +266,7 @@ Cursor* cursor_copy(Cursor*);
260266void cursor_copy_to (Cursor * src , Cursor * dest );
261267void cursor_reset_display_attrs (Cursor * );
262268void cursor_from_sgr (Cursor * self , unsigned int * params , unsigned int count );
263- void apply_sgr_to_cells (Cell * first_cell , unsigned int cell_count , unsigned int * params , unsigned int count );
269+ void apply_sgr_to_cells (GPUCell * first_cell , unsigned int cell_count , unsigned int * params , unsigned int count );
264270const char * cursor_as_sgr (Cursor * , Cursor * );
265271
266272double monotonic ();
0 commit comments