using QOpenGLPaintDevice::setPaintFlipped

This commit is contained in:
Uwe Rathmann 2019-10-29 07:02:30 +01:00
parent 93e8009c78
commit d67d83dd85

View File

@ -38,6 +38,7 @@ static uint qskCreateTextureOpenGL(
QOpenGLFramebufferObject multisampledFbo( width, height, format1 ); QOpenGLFramebufferObject multisampledFbo( width, height, format1 );
QOpenGLPaintDevice pd( width, height ); QOpenGLPaintDevice pd( width, height );
pd.setPaintFlipped( true );
{ {
QPainter painter( &pd ); QPainter painter( &pd );
@ -66,12 +67,10 @@ static uint qskCreateTextureOpenGL(
QOpenGLFramebufferObject fbo( width, height, format2 ); QOpenGLFramebufferObject fbo( width, height, format2 );
// Mirror vertically const QRect fboRect( 0, 0, width, height );
const QRect sourceRect( 0, 0, width, height );
const QRect targetRect( 0, height, width, -height );
QOpenGLFramebufferObject::blitFramebuffer( QOpenGLFramebufferObject::blitFramebuffer(
&fbo, sourceRect, &multisampledFbo, targetRect ); &fbo, fboRect, &multisampledFbo, fboRect );
return fbo.takeTexture(); return fbo.takeTexture();
} }