Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/opengl/scene_opengl.cpp
Show First 20 Lines • Show All 2424 Lines • ▼ Show 20 Line(s) | |||||
2425 | 2425 | | |||
2426 | SceneOpenGLDecorationRenderer::SceneOpenGLDecorationRenderer(Decoration::DecoratedClientImpl *client) | 2426 | SceneOpenGLDecorationRenderer::SceneOpenGLDecorationRenderer(Decoration::DecoratedClientImpl *client) | ||
2427 | : Renderer(client) | 2427 | : Renderer(client) | ||
2428 | , m_texture() | 2428 | , m_texture() | ||
2429 | { | 2429 | { | ||
2430 | connect(this, &Renderer::renderScheduled, client->client(), static_cast<void (AbstractClient::*)(const QRect&)>(&AbstractClient::addRepaint)); | 2430 | connect(this, &Renderer::renderScheduled, client->client(), static_cast<void (AbstractClient::*)(const QRect&)>(&AbstractClient::addRepaint)); | ||
2431 | } | 2431 | } | ||
2432 | 2432 | | |||
2433 | SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer() = default; | 2433 | SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer() | ||
2434 | { | ||||
2435 | if (Scene *scene = Compositor::self()->scene()) { | ||||
2436 | scene->makeOpenGLContextCurrent(); | ||||
2437 | m_texture.reset(); | ||||
2438 | } | ||||
2439 | } | ||||
2434 | 2440 | | |||
2435 | // Rotates the given source rect 90° counter-clockwise, | 2441 | // Rotates the given source rect 90° counter-clockwise, | ||
2436 | // and flips it vertically | 2442 | // and flips it vertically | ||
2437 | static QImage rotate(const QImage &srcImage, const QRect &srcRect) | 2443 | static QImage rotate(const QImage &srcImage, const QRect &srcRect) | ||
2438 | { | 2444 | { | ||
2439 | auto dpr = srcImage.devicePixelRatio(); | 2445 | auto dpr = srcImage.devicePixelRatio(); | ||
2440 | QImage image(srcRect.height() * dpr, srcRect.width() * dpr, srcImage.format()); | 2446 | QImage image(srcRect.height() * dpr, srcRect.width() * dpr, srcImage.format()); | ||
2441 | image.setDevicePixelRatio(dpr); | 2447 | image.setDevicePixelRatio(dpr); | ||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |