Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/xrender/scene_xrender.cpp
Show First 20 Lines • Show All 381 Lines • ▼ Show 20 Line(s) | 381 | if (mask & PAINT_SCREEN_TRANSFORMED) { | |||
---|---|---|---|---|---|
382 | // Apply the screen transformation | 382 | // Apply the screen transformation | ||
383 | pt.rx() = pt.x() * screen_paint.xScale() + screen_paint.xTranslation(); | 383 | pt.rx() = pt.x() * screen_paint.xScale() + screen_paint.xTranslation(); | ||
384 | pt.ry() = pt.y() * screen_paint.yScale() + screen_paint.yTranslation(); | 384 | pt.ry() = pt.y() * screen_paint.yScale() + screen_paint.yTranslation(); | ||
385 | } | 385 | } | ||
386 | 386 | | |||
387 | return pt; | 387 | return pt; | ||
388 | } | 388 | } | ||
389 | 389 | | |||
390 | QRect SceneXrender::Window::bufferToWindowRect(const QRect &rect) const | ||||
391 | { | ||||
392 | return rect.translated(bufferOffset()); | ||||
393 | } | ||||
394 | | ||||
395 | QRegion SceneXrender::Window::bufferToWindowRegion(const QRegion ®ion) const | ||||
396 | { | ||||
397 | return region.translated(bufferOffset()); | ||||
398 | } | ||||
399 | | ||||
390 | void SceneXrender::Window::prepareTempPixmap() | 400 | void SceneXrender::Window::prepareTempPixmap() | ||
391 | { | 401 | { | ||
392 | const QSize oldSize = temp_visibleRect.size(); | 402 | const QSize oldSize = temp_visibleRect.size(); | ||
393 | temp_visibleRect = toplevel->visibleRect().translated(-toplevel->pos()); | 403 | temp_visibleRect = toplevel->visibleRect().translated(-toplevel->pos()); | ||
394 | if (s_tempPicture && (oldSize.width() < temp_visibleRect.width() || oldSize.height() < temp_visibleRect.height())) { | 404 | if (s_tempPicture && (oldSize.width() < temp_visibleRect.width() || oldSize.height() < temp_visibleRect.height())) { | ||
395 | delete s_tempPicture; | 405 | delete s_tempPicture; | ||
396 | s_tempPicture = nullptr; | 406 | s_tempPicture = nullptr; | ||
397 | scene_setXRenderOffscreenTarget(0); // invalidate, better crash than cause weird results for developers | 407 | scene_setXRenderOffscreenTarget(0); // invalidate, better crash than cause weird results for developers | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 449 | if (options->isXrenderSmoothScale()) { // only when forced, it's slow | |||
442 | else if (mask & PAINT_SCREEN_TRANSFORMED) | 452 | else if (mask & PAINT_SCREEN_TRANSFORMED) | ||
443 | filter = ImageFilterGood; | 453 | filter = ImageFilterGood; | ||
444 | else | 454 | else | ||
445 | filter = ImageFilterFast; | 455 | filter = ImageFilterFast; | ||
446 | } else | 456 | } else | ||
447 | filter = ImageFilterFast; | 457 | filter = ImageFilterFast; | ||
448 | // do required transformations | 458 | // do required transformations | ||
449 | const QRect wr = mapToScreen(mask, data, QRect(0, 0, width(), height())); | 459 | const QRect wr = mapToScreen(mask, data, QRect(0, 0, width(), height())); | ||
450 | QRect cr = QRect(toplevel->clientPos(), toplevel->clientSize()); // Client rect (in the window) | 460 | QRect cr = QRect(toplevel->clientPos(), toplevel->clientSize()); // Content rect (in the buffer) | ||
451 | qreal xscale = 1; | 461 | qreal xscale = 1; | ||
452 | qreal yscale = 1; | 462 | qreal yscale = 1; | ||
453 | bool scaled = false; | 463 | bool scaled = false; | ||
454 | 464 | | |||
455 | X11Client *client = dynamic_cast<X11Client *>(toplevel); | 465 | X11Client *client = dynamic_cast<X11Client *>(toplevel); | ||
456 | Deleted *deleted = dynamic_cast<Deleted*>(toplevel); | 466 | Deleted *deleted = dynamic_cast<Deleted*>(toplevel); | ||
457 | const QRect decorationRect = toplevel->decorationRect(); | 467 | const QRect decorationRect = toplevel->decorationRect(); | ||
458 | if (((client && !client->noBorder()) || (deleted && !deleted->noBorder())) && | 468 | if (((client && !client->noBorder()) || (deleted && !deleted->noBorder())) && | ||
459 | true) { | 469 | true) { | ||
460 | // decorated client | 470 | // decorated client | ||
461 | transformed_shape = decorationRect; | 471 | transformed_shape = decorationRect; | ||
462 | if (toplevel->shape()) { | 472 | if (toplevel->shape()) { | ||
463 | // "xeyes" + decoration | 473 | // "xeyes" + decoration | ||
464 | transformed_shape -= cr; | 474 | transformed_shape -= bufferToWindowRect(cr); | ||
465 | transformed_shape += bufferShape(); | 475 | transformed_shape += bufferToWindowRegion(bufferShape()); | ||
466 | } | 476 | } | ||
467 | } else { | 477 | } else { | ||
468 | transformed_shape = bufferShape(); | 478 | transformed_shape = bufferToWindowRegion(bufferShape()); | ||
469 | } | 479 | } | ||
470 | if (toplevel->shadow()) { | 480 | if (toplevel->shadow()) { | ||
471 | transformed_shape |= toplevel->shadow()->shadowRegion(); | 481 | transformed_shape |= toplevel->shadow()->shadowRegion(); | ||
472 | } | 482 | } | ||
473 | 483 | | |||
474 | xcb_render_transform_t xform = { | 484 | xcb_render_transform_t xform = { | ||
475 | DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), | 485 | DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), | ||
476 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), | 486 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), | ||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | 572 | #define MAP_RECT_TO_TARGET(_RECT_) \ | |||
619 | } | 629 | } | ||
620 | //BEGIN end preparations | 630 | //BEGIN end preparations | ||
621 | 631 | | |||
622 | //BEGIN client preparations | 632 | //BEGIN client preparations | ||
623 | QRect dr = cr; | 633 | QRect dr = cr; | ||
624 | if (blitInTempPixmap) { | 634 | if (blitInTempPixmap) { | ||
625 | dr.translate(-temp_visibleRect.topLeft()); | 635 | dr.translate(-temp_visibleRect.topLeft()); | ||
626 | } else { | 636 | } else { | ||
627 | dr = mapToScreen(mask, data, dr); // Destination rect | 637 | dr = mapToScreen(mask, data, bufferToWindowRect(dr)); // Destination rect | ||
628 | if (scaled) { | 638 | if (scaled) { | ||
629 | cr.moveLeft(cr.x() * xscale); | 639 | cr.moveLeft(cr.x() * xscale); | ||
630 | cr.moveTop(cr.y() * yscale); | 640 | cr.moveTop(cr.y() * yscale); | ||
631 | } | 641 | } | ||
632 | } | 642 | } | ||
633 | 643 | | |||
634 | const int clientRenderOp = (opaque || blitInTempPixmap) ? XCB_RENDER_PICT_OP_SRC : XCB_RENDER_PICT_OP_OVER; | 644 | const int clientRenderOp = (opaque || blitInTempPixmap) ? XCB_RENDER_PICT_OP_SRC : XCB_RENDER_PICT_OP_OVER; | ||
635 | //END client preparations | 645 | //END client preparations | ||
▲ Show 20 Lines • Show All 711 Lines • Show Last 20 Lines |