… | |
… | |
428 | { |
428 | { |
429 | flags = new_flags; |
429 | flags = new_flags; |
430 | changed++; |
430 | changed++; |
431 | } |
431 | } |
432 | |
432 | |
433 | //fprintf (stderr, "flags = %lX, scale = %ux%u, align=%+d%+d\n", |
|
|
434 | // flags, h_scale, v_scale, h_align, v_align); |
|
|
435 | return (changed > 0); |
433 | return (changed > 0); |
436 | } |
434 | } |
437 | |
435 | |
438 | void |
436 | void |
439 | bgPixmap_t::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y) |
437 | bgPixmap_t::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y) |
… | |
… | |
529 | |
527 | |
530 | int x = 0; |
528 | int x = 0; |
531 | int y = 0; |
529 | int y = 0; |
532 | int w = 0; |
530 | int w = 0; |
533 | int h = 0; |
531 | int h = 0; |
534 | |
|
|
535 | TIMING_TEST_START (asim); |
|
|
536 | |
532 | |
537 | if (original_asim) |
533 | if (original_asim) |
538 | get_image_geometry (original_asim->width, original_asim->height, w, h, x, y); |
534 | get_image_geometry (original_asim->width, original_asim->height, w, h, x, y); |
539 | |
535 | |
540 | if (!original_asim |
536 | if (!original_asim |
… | |
… | |
657 | } |
653 | } |
658 | |
654 | |
659 | free (layers); |
655 | free (layers); |
660 | } |
656 | } |
661 | } |
657 | } |
662 | TIMING_TEST_PRINT_RESULT (asim); |
|
|
663 | |
658 | |
664 | bool ret = false; |
659 | bool ret = false; |
665 | |
660 | |
666 | if (result) |
661 | if (result) |
667 | { |
662 | { |
… | |
… | |
713 | |
708 | |
714 | if (result != background && result != original_asim) |
709 | if (result != background && result != original_asim) |
715 | destroy_asimage (&result); |
710 | destroy_asimage (&result); |
716 | |
711 | |
717 | XFreeGC (target->dpy, gc); |
712 | XFreeGC (target->dpy, gc); |
718 | TIMING_TEST_PRINT_RESULT (asim); |
|
|
719 | |
713 | |
720 | ret = true; |
714 | ret = true; |
721 | } |
715 | } |
722 | |
716 | |
723 | if (background) |
717 | if (background) |
… | |
… | |
1283 | } |
1277 | } |
1284 | |
1278 | |
1285 | XRenderFreePicture (dpy, mask_pic); |
1279 | XRenderFreePicture (dpy, mask_pic); |
1286 | XRenderFreePicture (dpy, overlay_pic); |
1280 | XRenderFreePicture (dpy, overlay_pic); |
1287 | XRenderFreePicture (dpy, back_pic); |
1281 | XRenderFreePicture (dpy, back_pic); |
1288 | # if DO_TIMING_TEST |
|
|
1289 | XSync (dpy, False); |
|
|
1290 | # endif |
|
|
1291 | # endif |
1282 | # endif |
1292 | } |
1283 | } |
1293 | |
1284 | |
1294 | return ret; |
1285 | return ret; |
1295 | } |
1286 | } |
… | |
… | |
1320 | int window_height = target->szHint.height; |
1311 | int window_height = target->szHint.height; |
1321 | int sx, sy; |
1312 | int sx, sy; |
1322 | XGCValues gcv; |
1313 | XGCValues gcv; |
1323 | GC gc; |
1314 | GC gc; |
1324 | |
1315 | |
1325 | TIMING_TEST_START (tp); |
|
|
1326 | target->get_window_origin (sx, sy); |
1316 | target->get_window_origin (sx, sy); |
1327 | |
1317 | |
1328 | /* check if we are outside of the visible part of the virtual screen : */ |
1318 | /* check if we are outside of the visible part of the virtual screen : */ |
1329 | if (sx + window_width <= 0 || sy + window_height <= 0 |
1319 | if (sx + window_width <= 0 || sy + window_height <= 0 |
1330 | || sx >= root_width || sy >= root_height) |
1320 | || sx >= root_width || sy >= root_height) |
… | |
… | |
1367 | { |
1357 | { |
1368 | XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); |
1358 | XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); |
1369 | result |= transpPmapTiled; |
1359 | result |= transpPmapTiled; |
1370 | XFreeGC (dpy, gc); |
1360 | XFreeGC (dpy, gc); |
1371 | } |
1361 | } |
1372 | TIMING_TEST_PRINT_RESULT (tp); |
|
|
1373 | |
1362 | |
1374 | if (tiled_root_pmap != None) |
1363 | if (tiled_root_pmap != None) |
1375 | { |
1364 | { |
1376 | if (!need_client_side_rendering ()) |
1365 | if (!need_client_side_rendering ()) |
1377 | { |
1366 | { |
… | |
… | |
1394 | pmap_width = window_width; |
1383 | pmap_width = window_width; |
1395 | pmap_height = window_height; |
1384 | pmap_height = window_height; |
1396 | pmap_depth = root_depth; |
1385 | pmap_depth = root_depth; |
1397 | } |
1386 | } |
1398 | |
1387 | |
1399 | TIMING_TEST_PRINT_RESULT (tp); |
|
|
1400 | |
|
|
1401 | return result; |
1388 | return result; |
1402 | } |
1389 | } |
1403 | |
1390 | |
1404 | bool |
1391 | bool |
1405 | bgPixmap_t::set_root_pixmap () |
1392 | bgPixmap_t::set_root_pixmap () |
… | |
… | |
1427 | { |
1414 | { |
1428 | unsigned long background_flags = 0; |
1415 | unsigned long background_flags = 0; |
1429 | |
1416 | |
1430 | if (target == NULL) |
1417 | if (target == NULL) |
1431 | return false; |
1418 | return false; |
1432 | |
|
|
1433 | TIMING_TEST_START (tp); |
|
|
1434 | |
1419 | |
1435 | invalidate (); |
1420 | invalidate (); |
1436 | # ifdef ENABLE_TRANSPARENCY |
1421 | # ifdef ENABLE_TRANSPARENCY |
1437 | if (flags & isTransparent) |
1422 | if (flags & isTransparent) |
1438 | { |
1423 | { |
… | |
… | |
1527 | } |
1512 | } |
1528 | } |
1513 | } |
1529 | |
1514 | |
1530 | apply (); |
1515 | apply (); |
1531 | |
1516 | |
1532 | XSync (target->dpy, False); |
|
|
1533 | valid_since = ev::now (); |
1517 | valid_since = ev::now (); |
1534 | |
|
|
1535 | TIMING_TEST_PRINT_RESULT (tp); |
|
|
1536 | |
1518 | |
1537 | return true; |
1519 | return true; |
1538 | } |
1520 | } |
1539 | |
1521 | |
1540 | bool |
1522 | bool |
… | |
… | |
1556 | void |
1538 | void |
1557 | bgPixmap_t::apply () |
1539 | bgPixmap_t::apply () |
1558 | { |
1540 | { |
1559 | if (target) |
1541 | if (target) |
1560 | { |
1542 | { |
1561 | flags &= ~isVtOrigin; |
|
|
1562 | |
|
|
1563 | if (pixmap != None) |
1543 | if (pixmap != None) |
1564 | { |
1544 | { |
1565 | /* set target's background to pixmap */ |
1545 | /* set target's background to pixmap */ |
1566 | # ifdef ENABLE_TRANSPARENCY |
1546 | # ifdef ENABLE_TRANSPARENCY |
1567 | if (flags & isTransparent) |
1547 | if (flags & isTransparent) |
… | |
… | |
1573 | XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative); |
1553 | XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative); |
1574 | } |
1554 | } |
1575 | else |
1555 | else |
1576 | # endif |
1556 | # endif |
1577 | { |
1557 | { |
1578 | flags |= isVtOrigin; |
|
|
1579 | /* force old pixmap dereference in case it was transparent before :*/ |
1558 | /* force old pixmap dereference in case it was transparent before :*/ |
1580 | XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]); |
1559 | XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]); |
1581 | XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap); |
1560 | XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap); |
1582 | /* do we also need to set scrollbar's background here ? */ |
1561 | /* do we also need to set scrollbar's background here ? */ |
1583 | |
1562 | |