Changeset 8ce56a6 in mainline
- Timestamp:
- 2021-09-07T08:53:42Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ebb3538
- Parents:
- a0aeb8f
- git-author:
- Jiri Svoboda <jiri@…> (2021-09-06 17:53:32)
- git-committer:
- Jiri Svoboda <jiri@…> (2021-09-07 08:53:42)
- Location:
- uspace/lib
- Files:
-
- 5 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/memgfx/meson.build
ra0aeb8f r8ce56a6 1 1 # 2 # Copyright (c) 202 0Jiri Svoboda2 # Copyright (c) 2021 Jiri Svoboda 3 3 # All rights reserved. 4 4 # … … 29 29 deps = [ 'gfx' ] 30 30 src = files( 31 'src/memgc.c' 31 'src/memgc.c', 32 'src/xlategc.c' 32 33 ) 33 34 … … 35 36 'test/main.c', 36 37 'test/memgfx.c', 38 'test/xlategc.c' 37 39 ) -
uspace/lib/memgfx/private/memgc.h
ra0aeb8f r8ce56a6 27 27 */ 28 28 29 /** @addtogroup lib guigfx29 /** @addtogroup libmemgfx 30 30 * @{ 31 31 */ … … 63 63 /** Bitmap in memory GC */ 64 64 typedef struct { 65 /** Containing canvasGC */65 /** Containing memory GC */ 66 66 struct mem_gc *mgc; 67 67 /** Allocation info */ -
uspace/lib/memgfx/test/main.c
ra0aeb8f r8ce56a6 1 1 /* 2 * Copyright (c) 202 0Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 32 32 33 33 PCUT_IMPORT(memgfx); 34 PCUT_IMPORT(xlategc); 34 35 35 36 PCUT_MAIN(); -
uspace/lib/ui/private/window.h
ra0aeb8f r8ce56a6 46 46 #include <io/pos_event.h> 47 47 #include <memgfx/memgc.h> 48 #include <memgfx/xlategc.h> 48 49 #include <types/ui/cursor.h> 49 50 #include <types/ui/window.h> … … 70 71 /** Window memory GC (if client-side rendering) */ 71 72 mem_gc_t *mgc; 73 /** Translating GC (if full screen & server-side rendering) */ 74 xlate_gc_t *xgc; 72 75 /** Real window GC (if client-side rendering) */ 73 76 gfx_context_t *realgc; -
uspace/lib/ui/src/ui.c
ra0aeb8f r8ce56a6 248 248 case CEV_POS: 249 249 pos = event->ev.pos; 250 #ifdef CONFIG_UI_CS_RENDER 251 /* 252 * TODO Enable translation for server-side rendering 253 * once we can translate rendering operations in this 254 * case. 255 */ 250 /* Translate event to window-relative coordinates */ 256 251 pos.hpos -= awnd->dpos.x; 257 252 pos.vpos -= awnd->dpos.y; 258 #endif259 253 260 254 claim = ui_wdecor_pos_event(awnd->wdecor, &pos); -
uspace/lib/ui/src/window.c
ra0aeb8f r8ce56a6 205 205 gfx_bitmap_alloc_t alloc; 206 206 gfx_bitmap_t *bmp = NULL; 207 gfx_coord2_t off; 207 208 mem_gc_t *memgc = NULL; 209 xlate_gc_t *xgc = NULL; 208 210 errno_t rc; 209 211 … … 297 299 window->gc = mem_gc_get_ctx(memgc); 298 300 window->realgc = gc; 301 (void) off; 299 302 #else 303 /* Server-side rendering */ 304 305 /* Full-screen mode? */ 306 if (ui->display == NULL) { 307 /* Create translating GC to translate window contents */ 308 off.x = 0; 309 off.y = 0; 310 rc = xlate_gc_create(&off, gc, &xgc); 311 if (rc != EOK) 312 goto error; 313 314 window->xgc = xgc; 315 window->gc = xlate_gc_get_ctx(xgc); 316 window->realgc = gc; 317 } else { 318 window->gc = gc; 319 } 320 300 321 (void) ui_window_mem_gc_cb; 301 322 (void) alloc; 302 323 (void) bparams; 303 window->gc = gc;304 324 #endif 305 if (ui->display == NULL) 325 if (ui->display == NULL) { 306 326 ui_window_place(window, &ui->rect, params, &window->dpos); 327 FILE *f = fopen("/tmp/x", "at"); 328 fprintf(f, "xlate_gc_set_off: %d,%d\n", 329 window->dpos.x, window->dpos.y); 330 fclose(f); 331 332 if (window->xgc != NULL) 333 xlate_gc_set_off(window->xgc, &window->dpos); 334 } 307 335 308 336 rc = ui_resource_create(window->gc, ui_is_textmode(ui), &res); … … 335 363 if (memgc != NULL) 336 364 mem_gc_delete(memgc); 365 if (xgc != NULL) 366 xlate_gc_delete(xgc); 337 367 if (bmp != NULL) 338 368 gfx_bitmap_destroy(bmp);
Note:
See TracChangeset
for help on using the changeset viewer.