#15122: Use grayscale text antialiasing for regression test plot snapshots

This commit is contained in:
Magne Sjaastad committed 2026-11-05 14:52:28 +01:00
1 parent 783c6ad524
commit eb3dcaac53
5 files changed
+99 -10

No files matched your search

@@ -21,6 +21,7 @@
#include "RiaGuiApplication.h"
#include "RiaPreferences.h"
#include "RiaPreferencesSummary.h"
#include "RiaSnapshotTools.h"
#include "RiaVersionInfo.h"
#include "RimPlot.h"
@@ -692,10 +693,10 @@ QImage RimMultiPlot::captureSnapshot( int width, int height )
m_viewer->performFullUpdateOfHiddenPages();
RiuTools::sendDeferredResizeEvents( m_viewer );
QPixmap pix( width, height );
pix.fill( Qt::white );
m_viewer->renderTo( &pix );
image = pix.toImage();
image = RiaSnapshotTools::renderSnapshotImage( width,
height,
Qt::white,
[this]( QPaintDevice* paintDevice ) { m_viewer->renderTo( paintDevice ); } );
m_viewer->setMinimumSize( 0, 0 );
m_viewer->setMaximumSize( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX );
@@ -22,6 +22,7 @@
#include "RiaColorTools.h"
#include "RiaGuiApplication.h"
#include "RiaPreferencesSystem.h"
#include "RiaSnapshotTools.h"
#include "RicfCommandObject.h"
@@ -300,11 +301,14 @@ QImage RimViewWindow::internalCaptureSnapshot( ads::CDockWidget* dockWidget, QWi
QApplication::processEvents();
}
QPixmap pix( width, height );
pix.fill( Qt::transparent );
QPainter painter( &pix );
widget->render( &painter );
QImage image = RiaSnapshotTools::renderSnapshotImage( width,
height,
Qt::transparent,
[widget]( QPaintDevice* paintDevice )
{
QPainter painter( paintDevice );
widget->render( &painter );
} );
if ( shouldResize )
{
@@ -313,7 +317,7 @@ QImage RimViewWindow::internalCaptureSnapshot( ads::CDockWidget* dockWidget, QWi
widget->resize( orgSize );
}
return pix.toImage();
return image;
}
//--------------------------------------------------------------------------------------------------