Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/core/windowthumbnail.cpp
Show First 20 Lines • Show All 365 Lines • ▼ Show 20 Line(s) | 365 | { | |||
---|---|---|---|---|---|
366 | QIcon icon; | 366 | QIcon icon; | ||
367 | if (KWindowSystem::self()->hasWId(m_winId)) { | 367 | if (KWindowSystem::self()->hasWId(m_winId)) { | ||
368 | icon = KWindowSystem::self()->icon(m_winId, boundingRect().width(), boundingRect().height()); | 368 | icon = KWindowSystem::self()->icon(m_winId, boundingRect().width(), boundingRect().height()); | ||
369 | } else { | 369 | } else { | ||
370 | // fallback to plasma icon | 370 | // fallback to plasma icon | ||
371 | icon = QIcon::fromTheme(QStringLiteral("plasma")); | 371 | icon = QIcon::fromTheme(QStringLiteral("plasma")); | ||
372 | } | 372 | } | ||
373 | QImage image = icon.pixmap(boundingRect().size().toSize()).toImage(); | 373 | QImage image = icon.pixmap(boundingRect().size().toSize()).toImage(); | ||
374 | textureNode->reset(window()->createTextureFromImage(image)); | 374 | textureNode->reset(window()->createTextureFromImage(image, QQuickWindow::TextureCanUseAtlas)); | ||
375 | } | 375 | } | ||
376 | 376 | | |||
377 | #if HAVE_XCB_COMPOSITE | 377 | #if HAVE_XCB_COMPOSITE | ||
378 | #if HAVE_GLX | 378 | #if HAVE_GLX | ||
379 | bool WindowThumbnail::windowToTextureGLX(WindowTextureNode *textureNode) | 379 | bool WindowThumbnail::windowToTextureGLX(WindowTextureNode *textureNode) | ||
380 | { | 380 | { | ||
381 | if (glXGetCurrentContext()) { | 381 | if (glXGetCurrentContext()) { | ||
382 | if (!m_openGLFunctionsResolved) { | 382 | if (!m_openGLFunctionsResolved) { | ||
Show All 19 Lines | 388 | if (m_glxPixmap == XCB_PIXMAP_NONE) { | |||
402 | 402 | | |||
403 | m_depth = geo->depth; | 403 | m_depth = geo->depth; | ||
404 | m_visualid = attr->visual; | 404 | m_visualid = attr->visual; | ||
405 | 405 | | |||
406 | if (!loadGLXTexture()) { | 406 | if (!loadGLXTexture()) { | ||
407 | return false; | 407 | return false; | ||
408 | } | 408 | } | ||
409 | 409 | | |||
410 | textureNode->reset(window()->createTextureFromId(m_texture, QSize(geo->width, geo->height))); | 410 | textureNode->reset(window()->createTextureFromId(m_texture, QSize(geo->width, geo->height), QQuickWindow::TextureCanUseAtlas)); | ||
411 | } | 411 | } | ||
412 | textureNode->texture()->bind(); | 412 | textureNode->texture()->bind(); | ||
413 | bindGLXTexture(); | 413 | bindGLXTexture(); | ||
414 | return true; | 414 | return true; | ||
415 | } | 415 | } | ||
416 | return false; | 416 | return false; | ||
417 | } | 417 | } | ||
418 | #endif // HAVE_GLX | 418 | #endif // HAVE_GLX | ||
Show All 32 Lines | 435 | if (m_image == EGL_NO_IMAGE_KHR) { | |||
451 | 451 | | |||
452 | glGenTextures(1, &m_texture); | 452 | glGenTextures(1, &m_texture); | ||
453 | QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> geo(xcb_get_geometry_reply(c, geometryCookie, nullptr)); | 453 | QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> geo(xcb_get_geometry_reply(c, geometryCookie, nullptr)); | ||
454 | QSize size; | 454 | QSize size; | ||
455 | if (!geo.isNull()) { | 455 | if (!geo.isNull()) { | ||
456 | size.setWidth(geo->width); | 456 | size.setWidth(geo->width); | ||
457 | size.setHeight(geo->height); | 457 | size.setHeight(geo->height); | ||
458 | } | 458 | } | ||
459 | textureNode->reset(window()->createTextureFromId(m_texture, size)); | 459 | textureNode->reset(window()->createTextureFromId(m_texture, size, QQuickWindow::TextureCanUseAtlas)); | ||
460 | } | 460 | } | ||
461 | textureNode->texture()->bind(); | 461 | textureNode->texture()->bind(); | ||
462 | bindEGLTexture(); | 462 | bindEGLTexture(); | ||
463 | return true; | 463 | return true; | ||
464 | } | 464 | } | ||
465 | return false; | 465 | return false; | ||
466 | } | 466 | } | ||
467 | 467 | | |||
▲ Show 20 Lines • Show All 432 Lines • Show Last 20 Lines |