mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #123: Alternative software rendering backend
This commit is contained in:
@ -180,21 +180,11 @@ int PDFToolRenderBase::execute(const PDFToolOptions& options)
|
||||
fontCache.setDocument(md);
|
||||
fontCache.setCacheShrinkEnabled(nullptr, false);
|
||||
|
||||
QSurfaceFormat surfaceFormat;
|
||||
if (options.renderUseHardwareRendering)
|
||||
{
|
||||
surfaceFormat = QSurfaceFormat::defaultFormat();
|
||||
surfaceFormat.setProfile(QSurfaceFormat::CoreProfile);
|
||||
surfaceFormat.setSamples(options.renderMSAAsamples);
|
||||
surfaceFormat.setColorSpace(QColorSpace(QColorSpace::SRgb));
|
||||
surfaceFormat.setSwapBehavior(QSurfaceFormat::DefaultSwapBehavior);
|
||||
}
|
||||
|
||||
m_pageInfo.resize(document.getCatalog()->getPageCount());
|
||||
pdf::PDFRasterizerPool rasterizerPool(&document, &fontCache, &cmsManager,
|
||||
&optionalContentActivity, options.renderFeatures, meshQualitySettings,
|
||||
pdf::PDFRasterizerPool::getCorrectedRasterizerCount(options.renderRasterizerCount),
|
||||
options.renderUseHardwareRendering, surfaceFormat, nullptr);
|
||||
options.renderUseSoftwareRendering ? pdf::RendererEngine::QPainter : pdf::RendererEngine::Blend2D, nullptr);
|
||||
|
||||
auto onRenderError = [this](pdf::PDFInteger pageIndex, pdf::PDFRenderError error)
|
||||
{
|
||||
|
Reference in New Issue
Block a user