Changeset View
Changeset View
Standalone View
Standalone View
scene_xrender.cpp
Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Line(s) | 272 | { | |||
---|---|---|---|---|---|
275 | PaintClipper::pop(region); | 275 | PaintClipper::pop(region); | ||
276 | } | 276 | } | ||
277 | 277 | | |||
278 | // fill the screen background | 278 | // fill the screen background | ||
279 | void SceneXrender::paintBackground(QRegion region) | 279 | void SceneXrender::paintBackground(QRegion region) | ||
280 | { | 280 | { | ||
281 | xcb_render_color_t col = { 0, 0, 0, 0xffff }; // black | 281 | xcb_render_color_t col = { 0, 0, 0, 0xffff }; // black | ||
282 | const QVector<xcb_rectangle_t> &rects = Xcb::regionToRects(region); | 282 | const QVector<xcb_rectangle_t> &rects = Xcb::regionToRects(region); | ||
283 | xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, bufferPicture(), col, rects.count(), rects.data()); | 283 | xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, xrenderBufferPicture(), col, rects.count(), rects.data()); | ||
284 | } | 284 | } | ||
285 | 285 | | |||
286 | Scene::Window *SceneXrender::createWindow(Toplevel *toplevel) | 286 | Scene::Window *SceneXrender::createWindow(Toplevel *toplevel) | ||
287 | { | 287 | { | ||
288 | return new Window(toplevel, this); | 288 | return new Window(toplevel, this); | ||
289 | } | 289 | } | ||
290 | 290 | | |||
291 | Scene::EffectFrame *SceneXrender::createEffectFrame(EffectFrameImpl *frame) | 291 | Scene::EffectFrame *SceneXrender::createEffectFrame(EffectFrameImpl *frame) | ||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 406 | { | |||
510 | // the temporary pixmap at the end. | 510 | // the temporary pixmap at the end. | ||
511 | // We should do this only if there is scaling and | 511 | // We should do this only if there is scaling and | ||
512 | // the window has border | 512 | // the window has border | ||
513 | // This solves a number of glitches and on top of this | 513 | // This solves a number of glitches and on top of this | ||
514 | // it optimizes painting quite a bit | 514 | // it optimizes painting quite a bit | ||
515 | const bool blitInTempPixmap = xRenderOffscreen() || (data.crossFadeProgress() < 1.0 && !opaque) || | 515 | const bool blitInTempPixmap = xRenderOffscreen() || (data.crossFadeProgress() < 1.0 && !opaque) || | ||
516 | (scaled && (wantShadow || (client && !client->noBorder()) || (deleted && !deleted->noBorder()))); | 516 | (scaled && (wantShadow || (client && !client->noBorder()) || (deleted && !deleted->noBorder()))); | ||
517 | 517 | | |||
518 | xcb_render_picture_t renderTarget = m_scene->bufferPicture(); | 518 | xcb_render_picture_t renderTarget = m_scene->xrenderBufferPicture(); | ||
519 | if (blitInTempPixmap) { | 519 | if (blitInTempPixmap) { | ||
520 | if (scene_xRenderOffscreenTarget()) { | 520 | if (scene_xRenderOffscreenTarget()) { | ||
521 | temp_visibleRect = toplevel->visibleRect().translated(-toplevel->pos()); | 521 | temp_visibleRect = toplevel->visibleRect().translated(-toplevel->pos()); | ||
522 | renderTarget = *scene_xRenderOffscreenTarget(); | 522 | renderTarget = *scene_xRenderOffscreenTarget(); | ||
523 | } else { | 523 | } else { | ||
524 | prepareTempPixmap(); | 524 | prepareTempPixmap(); | ||
525 | renderTarget = *s_tempPicture; | 525 | renderTarget = *s_tempPicture; | ||
526 | } | 526 | } | ||
▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Line(s) | 723 | xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_OVER, renderTarget, | |||
724 | preMultiply(data.brightness() < 1.0 ? QColor(0,0,0,255*alpha) : QColor(255,255,255,-alpha*255)), | 724 | preMultiply(data.brightness() < 1.0 ? QColor(0,0,0,255*alpha) : QColor(255,255,255,-alpha*255)), | ||
725 | 1, &rect); | 725 | 1, &rect); | ||
726 | } | 726 | } | ||
727 | if (blitInTempPixmap) { | 727 | if (blitInTempPixmap) { | ||
728 | const QRect r = mapToScreen(mask, data, temp_visibleRect); | 728 | const QRect r = mapToScreen(mask, data, temp_visibleRect); | ||
729 | xcb_render_set_picture_transform(connection(), *s_tempPicture, xform); | 729 | xcb_render_set_picture_transform(connection(), *s_tempPicture, xform); | ||
730 | setPictureFilter(*s_tempPicture, filter); | 730 | setPictureFilter(*s_tempPicture, filter); | ||
731 | xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, *s_tempPicture, | 731 | xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, *s_tempPicture, | ||
732 | XCB_RENDER_PICTURE_NONE, m_scene->bufferPicture(), | 732 | XCB_RENDER_PICTURE_NONE, m_scene->xrenderBufferPicture(), | ||
733 | 0, 0, 0, 0, r.x(), r.y(), r.width(), r.height()); | 733 | 0, 0, 0, 0, r.x(), r.y(), r.width(), r.height()); | ||
734 | xcb_render_set_picture_transform(connection(), *s_tempPicture, identity); | 734 | xcb_render_set_picture_transform(connection(), *s_tempPicture, identity); | ||
735 | } | 735 | } | ||
736 | } | 736 | } | ||
737 | if (scaled && !blitInTempPixmap) { | 737 | if (scaled && !blitInTempPixmap) { | ||
738 | xcb_render_set_picture_transform(connection(), pic, identity); | 738 | xcb_render_set_picture_transform(connection(), pic, identity); | ||
739 | if (filter == ImageFilterGood) | 739 | if (filter == ImageFilterGood) | ||
740 | setPictureFilter(pic, KWin::Scene::ImageFilterFast); | 740 | setPictureFilter(pic, KWin::Scene::ImageFilterFast); | ||
▲ Show 20 Lines • Show All 563 Lines • Show Last 20 Lines |