Bug 414296 - Screenshots are downscaled with dpr > 1
Summary: Screenshots are downscaled with dpr > 1
Status: RESOLVED DUPLICATE of bug 409762
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-19 12:15 UTC by Méven Car
Modified: 2019-11-19 14:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Méven Car 2019-11-19 12:15:47 UTC
SUMMARY

Screenshots made with spectacle when using a scale ratio are downscaled.

I believe the fix needs to be made in kwin/effects/screenshot/screenshot.cpp:607 :

QImage ScreenShotEffect::blitScreenshot(const QRect &geometry)
{
    QImage img;
    if (effects->isOpenGLCompositing())
    {
        img = QImage(geometry.size(), QImage::Format_ARGB32);
        if (GLRenderTarget::blitSupported() && !GLPlatform::instance()->isGLES()) {
            GLTexture tex(GL_RGBA8, geometry.width(), geometry.height());
            GLRenderTarget target(tex);
            target.blitFromFramebuffer(geometry);
            // copy content from framebuffer into image
            tex.bind();
            glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)img.bits());
            tex.unbind();
        } else {
            glReadPixels(0, 0, img.width(), img.height(), GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)img.bits());
        }
        ScreenShotEffect::convertFromGLImage(img, geometry.width(), geometry.height());
    }

To have an output image whose output image is scaled up.

STEPS TO REPRODUCE
1. With a scaling ratio of 2 for instance (physical res is 3840x2160)
2. Take a fullscreen screenshot with spectacle 

OBSERVED RESULT
Screenshot size is 1920*1080.

EXPECTED RESULT
Screenshot size is 3840x2160.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 19.10
KDE Plasma Version: 5.17.80
KDE Frameworks Version: 5.64.0
Qt Version: 5.12.4
Kernel Version: 5.3.0-23-generic
Comment 1 Méven Car 2019-11-19 12:17:13 UTC
*** Bug 409762 has been marked as a duplicate of this bug. ***
Comment 2 David Redondo 2019-11-19 13:51:11 UTC
Happens only on Wayland right?
Comment 3 Méven Car 2019-11-19 14:09:03 UTC
(In reply to David Redondo from comment #2)
> Happens only on Wayland right?

I don't think so, it depends only on scaling see https://bugs.kde.org/show_bug.cgi?id=409762

*** This bug has been marked as a duplicate of bug 409762 ***
Comment 4 Méven Car 2019-11-19 14:10:03 UTC
(In reply to Méven Car from comment #3)
> (In reply to David Redondo from comment #2)
> > Happens only on Wayland right?
> 
> I don't think so, it depends only on scaling see
> https://bugs.kde.org/show_bug.cgi?id=409762

Oups indeed it is wayland only.