Changeset 25f26600 in mainline for uspace/lib/ui/src/window.c
- Timestamp:
- 2020-12-07T23:44:20Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 13d20e5, 4db4718d, e9c1639
- Parents:
- 7e38970d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/window.c
r7e38970d r25f26600 292 292 gfx_coord2_t offs; 293 293 gfx_rect_t nrect; 294 gfx_rect_t arect; 295 gfx_bitmap_t *app_bmp = NULL; 296 gfx_bitmap_params_t params; 297 gfx_bitmap_alloc_t alloc; 294 298 errno_t rc; 295 299 … … 301 305 gfx_rect_rtranslate(&offs, rect, &nrect); 302 306 307 if (window->app_gc != NULL) { 308 assert(window->app_bmp != NULL); 309 310 gfx_bitmap_params_init(¶ms); 311 312 /* 313 * The bitmap will have the same dimensions as the 314 * application rectangle, but start at 0,0. 315 */ 316 ui_wdecor_app_from_rect(window->wdecor->style, &nrect, &arect); 317 gfx_rect_rtranslate(&arect.p0, &arect, ¶ms.rect); 318 319 rc = gfx_bitmap_create(window->gc, ¶ms, NULL, 320 &app_bmp); 321 if (rc != EOK) 322 goto error; 323 324 rc = gfx_bitmap_get_alloc(app_bmp, &alloc); 325 if (rc != EOK) 326 goto error; 327 } 328 303 329 /* dwindow can be NULL in case of unit tests */ 304 330 if (window->dwindow != NULL) { 305 331 rc = display_window_resize(window->dwindow, &offs, &nrect); 306 332 if (rc != EOK) 307 return rc;333 goto error; 308 334 } 309 335 310 336 ui_wdecor_set_rect(window->wdecor, &nrect); 311 337 ui_wdecor_paint(window->wdecor); 338 339 if (window->app_gc != NULL) { 340 mem_gc_retarget(window->app_mgc, ¶ms.rect, &alloc); 341 342 gfx_bitmap_destroy(window->app_bmp); 343 window->app_bmp = app_bmp; 344 } 345 312 346 return EOK; 347 error: 348 if (app_bmp != NULL) 349 gfx_bitmap_destroy(app_bmp); 350 return rc; 313 351 } 314 352 … … 389 427 } 390 428 429 window->app_mgc = memgc; 391 430 window->app_gc = mem_gc_get_ctx(memgc); 392 431 }
Note:
See TracChangeset
for help on using the changeset viewer.