screenshot: Account for render target scale when rendering
This commit is contained in:
parent
239bbf93f4
commit
f791eb8fa7
1 changed files with 2 additions and 2 deletions
|
@ -257,7 +257,7 @@ void ScreenShotEffect::takeScreenShot(ScreenShotWindowData *screenshot)
|
||||||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||||
|
|
||||||
QMatrix4x4 projection;
|
QMatrix4x4 projection;
|
||||||
projection.ortho(QRect(0, 0, geometry.width(), geometry.height()));
|
projection.ortho(QRect(0, 0, geometry.width() * devicePixelRatio, geometry.height() * devicePixelRatio));
|
||||||
d.setProjectionMatrix(projection);
|
d.setProjectionMatrix(projection);
|
||||||
|
|
||||||
effects->drawWindow(window, mask, infiniteRegion(), d);
|
effects->drawWindow(window, mask, infiniteRegion(), d);
|
||||||
|
@ -358,7 +358,7 @@ QImage ScreenShotEffect::blitScreenshot(const QRect &geometry, qreal devicePixel
|
||||||
image = QImage(nativeSize.width(), nativeSize.height(), QImage::Format_ARGB32);
|
image = QImage(nativeSize.width(), nativeSize.height(), QImage::Format_ARGB32);
|
||||||
GLTexture texture(GL_RGBA8, nativeSize.width(), nativeSize.height());
|
GLTexture texture(GL_RGBA8, nativeSize.width(), nativeSize.height());
|
||||||
GLFramebuffer target(&texture);
|
GLFramebuffer target(&texture);
|
||||||
target.blitFromFramebuffer(effects->mapToRenderTarget(geometry));
|
target.blitFromFramebuffer(effects->mapToRenderTarget(QRectF(geometry)).toRect());
|
||||||
// copy content from framebuffer into image
|
// copy content from framebuffer into image
|
||||||
texture.bind();
|
texture.bind();
|
||||||
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||||
|
|
Loading…
Reference in a new issue