mirror of https://github.com/vitalif/phantomjs
Fix consistent crash on OS X when rendering to PDF format.
By implementing a dummy platform native interface (for now, it may be extended in the near future), QPlatformPrinterSupportPlugin will avoid the path of loading the printer support plugin (QCocoaPrinterSupportPlugin on OS X). Related upstream bug (QCocoaPrinterSupportPlugin problem with static build): https://bugreports.qt-project.org/browse/QTBUG-33109 https://github.com/ariya/phantomjs/issues/125002.0
parent
4bc91b1bf0
commit
7317724723
|
@ -69,6 +69,13 @@ PhantomIntegration::PhantomIntegration()
|
|||
mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
|
||||
|
||||
screenAdded(mPrimaryScreen);
|
||||
|
||||
m_phantomPlatformNativeInterface = new PhantomPlatformNativeInterface();
|
||||
}
|
||||
|
||||
PhantomIntegration::~PhantomIntegration()
|
||||
{
|
||||
delete m_phantomPlatformNativeInterface;
|
||||
}
|
||||
|
||||
bool PhantomIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
||||
|
@ -106,3 +113,8 @@ QAbstractEventDispatcher *PhantomIntegration::createEventDispatcher() const
|
|||
{
|
||||
return createUnixEventDispatcher();
|
||||
}
|
||||
|
||||
QPlatformNativeInterface *PhantomIntegration::nativeInterface() const
|
||||
{
|
||||
return m_phantomPlatformNativeInterface;
|
||||
}
|
||||
|
|
|
@ -43,12 +43,18 @@
|
|||
#define PHANTOMINTEGRATION_H
|
||||
|
||||
#include <qpa/qplatformintegration.h>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#include <qpa/qplatformscreen.h>
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
class QWindowSurface;
|
||||
|
||||
class PhantomPlatformNativeInterface : public QPlatformNativeInterface
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
class PhantomScreen : public QPlatformScreen
|
||||
{
|
||||
public:
|
||||
|
@ -71,6 +77,7 @@ class PhantomIntegration : public QPlatformIntegration
|
|||
{
|
||||
public:
|
||||
PhantomIntegration();
|
||||
~PhantomIntegration();
|
||||
|
||||
bool hasCapability(QPlatformIntegration::Capability cap) const;
|
||||
|
||||
|
@ -79,6 +86,10 @@ public:
|
|||
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||
|
||||
QPlatformFontDatabase *fontDatabase() const;
|
||||
QPlatformNativeInterface *nativeInterface() const;
|
||||
|
||||
private:
|
||||
PhantomPlatformNativeInterface *m_phantomPlatformNativeInterface;
|
||||
};
|
||||
|
||||
#endif // PHANTOMINTEGRATION_H
|
||||
|
|
Loading…
Reference in New Issue