summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/direct2d
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/direct2d')
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp11
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp6
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp8
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp6
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp26
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp16
7 files changed, 38 insertions, 37 deletions
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp
index 2151f3ae95..587bae3598 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp
@@ -54,7 +54,8 @@ QT_BEGIN_NAMESPACE
class QWindowsDirect2DBitmapPrivate
{
public:
- QWindowsDirect2DBitmapPrivate(ID2D1DeviceContext *dc = 0, ID2D1Bitmap1 *bm = 0)
+ QWindowsDirect2DBitmapPrivate(ID2D1DeviceContext *dc = nullptr,
+ ID2D1Bitmap1 *bm = nullptr)
: deviceContext(new QWindowsDirect2DDeviceContext(dc))
, bitmap(bm)
@@ -75,9 +76,9 @@ public:
}
- bool resize(int width, int height, const void *data = 0, int pitch = 0)
+ bool resize(int width, int height, const void *data = nullptr, int pitch = 0)
{
- deviceContext->get()->SetTarget(0);
+ deviceContext->get()->SetTarget(nullptr);
bitmap.Reset();
D2D1_SIZE_U size = {
@@ -108,14 +109,14 @@ public:
D2D1_BITMAP_PROPERTIES1 properties = bitmapProperties();
properties.bitmapOptions = D2D1_BITMAP_OPTIONS_CANNOT_DRAW | D2D1_BITMAP_OPTIONS_CPU_READ;
- hr = deviceContext->get()->CreateBitmap(size, NULL, 0,
+ hr = deviceContext->get()->CreateBitmap(size, nullptr, 0,
properties, &mappingCopy);
if (FAILED(hr)) {
qWarning("%s: Could not create bitmap: %#lx", __FUNCTION__, hr);
return QImage();
}
- hr = mappingCopy->CopyFromBitmap(NULL, bitmap.Get(), NULL);
+ hr = mappingCopy->CopyFromBitmap(nullptr, bitmap.Get(), nullptr);
if (FAILED(hr)) {
qWarning("%s: Could not copy from bitmap: %#lx", __FUNCTION__, hr);
return QImage();
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
index a5817016e6..a31477ded9 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
@@ -68,11 +68,11 @@ public:
const int ntypes = int(sizeof(typeAttempts) / sizeof(typeAttempts[0]));
for (int i = 0; i < ntypes; i++) {
- hr = D3D11CreateDevice(NULL,
+ hr = D3D11CreateDevice(nullptr,
typeAttempts[i],
- NULL,
+ nullptr,
D3D11_CREATE_DEVICE_SINGLETHREADED | D3D11_CREATE_DEVICE_BGRA_SUPPORT,
- NULL,
+ nullptr,
0,
D3D11_SDK_VERSION,
&d3dDevice,
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
index 173d79cf2b..86c863ec50 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
class QWindowsDirect2DEventDispatcher : public QWindowsGuiEventDispatcher
{
public:
- QWindowsDirect2DEventDispatcher(QObject *parent = 0)
+ QWindowsDirect2DEventDispatcher(QObject *parent = nullptr)
: QWindowsGuiEventDispatcher(parent)
{
uninstallMessageHook(); // ### Workaround for QTBUG-42428
@@ -82,7 +82,7 @@ static QVersionNumber systemD2DVersion()
UINT i = GetSystemDirectory(filename, bufSize);
if (i > 0 && i < bufSize) {
if (_tcscat_s(filename, bufSize, __TEXT("\\d2d1.dll")) == 0) {
- DWORD versionInfoSize = GetFileVersionInfoSize(filename, NULL);
+ DWORD versionInfoSize = GetFileVersionInfoSize(filename, nullptr);
if (versionInfoSize) {
QVarLengthArray<BYTE> info(static_cast<int>(versionInfoSize));
if (GetFileVersionInfo(filename, 0, versionInfoSize, info.data())) {
@@ -132,7 +132,7 @@ QWindowsDirect2DIntegration *QWindowsDirect2DIntegration::create(const QStringLi
QString caption = QCoreApplication::translate("QWindowsDirect2DIntegration",
"Cannot load direct2d platform plugin");
- MessageBoxW(NULL,
+ MessageBoxW(nullptr,
msg.toStdWString().c_str(),
caption.toStdWString().c_str(),
MB_OK | MB_ICONERROR);
@@ -144,7 +144,7 @@ QWindowsDirect2DIntegration *QWindowsDirect2DIntegration::create(const QStringLi
if (!integration->init()) {
delete integration;
- integration = 0;
+ integration = nullptr;
}
return integration;
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp
index f763c4f7ab..220302d041 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp
@@ -47,15 +47,15 @@ void *QWindowsDirect2DNativeInterface::nativeResourceForBackingStore(const QByte
{
if (!bs || !bs->handle()) {
qWarning("%s: '%s' requested for null backingstore or backingstore without handle.", __FUNCTION__, resource.constData());
- return 0;
+ return nullptr;
}
// getDC is so common we don't want to print an "invalid key" line for it
if (resource == "getDC")
- return 0;
+ return nullptr;
qWarning("%s: Invalid key '%s' requested.", __FUNCTION__, resource.constData());
- return 0;
+ return nullptr;
}
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
index d3e1d4dd12..fa201c784e 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
@@ -385,9 +385,9 @@ public:
antialiasMode(),
D2D1::IdentityMatrix(),
1.0,
- NULL,
+ nullptr,
layerOptions()),
- NULL);
+ nullptr);
pushedClips.push(LayerClip);
}
}
@@ -602,7 +602,7 @@ public:
hr = dc()->CreateBitmapBrush(bitmap.bitmap(), bitmapBrushProperties, &pen.dashBrush);
pen.dashLength = bitmap.size().width();
} else {
- hr = factory()->CreateStrokeStyle(props, NULL, 0, &pen.strokeStyle);
+ hr = factory()->CreateStrokeStyle(props, nullptr, 0, &pen.strokeStyle);
}
if (FAILED(hr))
@@ -816,7 +816,7 @@ public:
Direct2DPathGeometryWriter writer;
if (!writer.begin())
- return NULL;
+ return nullptr;
writer.setWindingFillEnabled(path.hasWindingFill());
writer.setAliasingEnabled(alias);
@@ -932,7 +932,7 @@ public:
dc()->DrawGlyphRun(pos,
&glyphRun,
- NULL,
+ nullptr,
pen.brush.Get(),
DWRITE_MEASURING_MODE_GDI_CLASSIC);
}
@@ -990,7 +990,7 @@ public:
dashOffset = pen.dashLength - fmod(lineLength - dashOffset, pen.dashLength);
}
dc()->DrawLine(to_d2d_point_2f(p1), to_d2d_point_2f(p2),
- brush, FLOAT(pen.qpen.widthF()), NULL);
+ brush, FLOAT(pen.qpen.widthF()), nullptr);
if (skipJoin)
continue;
@@ -1102,9 +1102,9 @@ bool QWindowsDirect2DPaintEngine::begin(QPaintDevice * pdev)
d->antialiasMode(),
D2D1::IdentityMatrix(),
1.0,
- NULL,
+ nullptr,
d->layerOptions()),
- NULL);
+ nullptr);
} else {
QRect clip(0, 0, pdev->width(), pdev->height());
if (!systemClip().isEmpty())
@@ -1474,7 +1474,7 @@ void QWindowsDirect2DPaintEngine::drawPixmap(const QRectF &r,
r.x() + r.width(), r.y() + r.height(),
r.x(), r.y() + r.height()
};
- const QVectorPath vp(points, 4, 0, QVectorPath::RectangleHint);
+ const QVectorPath vp(points, 4, nullptr, QVectorPath::RectangleHint);
QBrush brush(sr.isValid() ? pm.copy(sr.toRect()) : pm);
brush.setTransform(QTransform::fromTranslate(r.x(), r.y()));
rasterFill(vp, brush);
@@ -1511,7 +1511,7 @@ void QWindowsDirect2DPaintEngine::drawPixmap(const QRectF &r,
}
D2D1_RECT_U d2d_sr = to_d2d_rect_u(sr.toRect());
- HRESULT hr = intermediate.bitmap()->CopyFromBitmap(NULL,
+ HRESULT hr = intermediate.bitmap()->CopyFromBitmap(nullptr,
bitmap->bitmap(),
&d2d_sr);
if (FAILED(hr)) {
@@ -1526,9 +1526,9 @@ void QWindowsDirect2DPaintEngine::drawPixmap(const QRectF &r,
return;
}
- HRESULT hr = intermediate.bitmap()->CopyFromBitmap(NULL,
+ HRESULT hr = intermediate.bitmap()->CopyFromBitmap(nullptr,
bitmap->bitmap(),
- NULL);
+ nullptr);
if (FAILED(hr)) {
qWarning("%s: Could not copy source bitmap to intermediate bitmap: %#lx", __FUNCTION__, hr);
return;
@@ -1708,7 +1708,7 @@ void QWindowsDirect2DPaintEngine::rasterFill(const QVectorPath &path, const QBru
right, info.rectf.y(),
right, bottom,
info.rectf.x(), bottom };
- QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);
+ QVectorPath vp(pts, 4, nullptr, QVectorPath::RectangleHint);
extended->clip(vp, info.operation);
break;
}
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp
index 6c56d356b7..b2fb4ba551 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp
@@ -56,7 +56,7 @@ QPlatformIntegration *QWindowsDirect2DIntegrationPlugin::create(const QString& s
{
if (system.compare(system, QLatin1String("direct2d"), Qt::CaseInsensitive) == 0)
return QWindowsDirect2DIntegration::create(paramList);
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
index f81182e0b1..239e5f3087 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
@@ -171,12 +171,12 @@ void QWindowsDirect2DWindow::present(const QRegion &region)
const BLENDFUNCTION blend = { AC_SRC_OVER, 0, BYTE(255.0 * opacity()), AC_SRC_ALPHA };
const QRect r = region.boundingRect();
const RECT dirty = { r.left(), r.top(), r.left() + r.width(), r.top() + r.height() };
- UPDATELAYEREDWINDOWINFO info = { sizeof(UPDATELAYEREDWINDOWINFO), NULL,
+ UPDATELAYEREDWINDOWINFO info = { sizeof(UPDATELAYEREDWINDOWINFO), nullptr,
&ptDst, &size, hdc, &ptSrc, 0, &blend, ULW_ALPHA, &dirty };
if (!UpdateLayeredWindowIndirect(handle(), &info))
qErrnoWarning(int(GetLastError()), "Failed to update the layered window");
- hr = dxgiSurface->ReleaseDC(NULL);
+ hr = dxgiSurface->ReleaseDC(nullptr);
if (FAILED(hr))
qErrnoWarning(hr, "Failed to release the DC for presentation");
}
@@ -195,8 +195,8 @@ void QWindowsDirect2DWindow::setupSwapChain()
QWindowsDirect2DContext::instance()->d3dDevice(), // [in] IUnknown *pDevice
handle(), // [in] HWND hWnd
&desc, // [in] const DXGI_SWAP_CHAIN_DESC1 *pDesc
- NULL, // [in] const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc
- NULL, // [in] IDXGIOutput *pRestrictToOutput
+ nullptr, // [in] const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc
+ nullptr, // [in] IDXGIOutput *pRestrictToOutput
m_swapChain.ReleaseAndGetAddressOf()); // [out] IDXGISwapChain1 **ppSwapChain
if (FAILED(hr))
@@ -244,14 +244,14 @@ QSharedPointer<QWindowsDirect2DBitmap> QWindowsDirect2DWindow::copyBackBuffer()
nullptr // _Field_size_opt_(1) ID2D1ColorContext *colorContext;
};
ComPtr<ID2D1Bitmap1> copy;
- HRESULT hr = m_deviceContext.Get()->CreateBitmap(size, NULL, 0, properties, &copy);
+ HRESULT hr = m_deviceContext.Get()->CreateBitmap(size, nullptr, 0, properties, &copy);
if (FAILED(hr)) {
qWarning("%s: Could not create staging bitmap: %#lx", __FUNCTION__, hr);
return null_result;
}
- hr = copy.Get()->CopyFromBitmap(NULL, m_bitmap->bitmap(), NULL);
+ hr = copy.Get()->CopyFromBitmap(nullptr, m_bitmap->bitmap(), nullptr);
if (FAILED(hr)) {
qWarning("%s: Could not copy from bitmap! %#lx", __FUNCTION__, hr);
return null_result;
@@ -285,7 +285,7 @@ void QWindowsDirect2DWindow::setupBitmap()
backBufferDesc.BindFlags = D3D11_BIND_RENDER_TARGET;
backBufferDesc.MiscFlags = D3D11_RESOURCE_MISC_GDI_COMPATIBLE;
ComPtr<ID3D11Texture2D> backBufferTexture;
- HRESULT hr = QWindowsDirect2DContext::instance()->d3dDevice()->CreateTexture2D(&backBufferDesc, NULL, &backBufferTexture);
+ HRESULT hr = QWindowsDirect2DContext::instance()->d3dDevice()->CreateTexture2D(&backBufferDesc, nullptr, &backBufferTexture);
if (FAILED(hr)) {
qErrnoWarning(hr, "Failed to create backing texture for indirect rendering");
return;
@@ -299,7 +299,7 @@ void QWindowsDirect2DWindow::setupBitmap()
}
ComPtr<ID2D1Bitmap1> backBufferBitmap;
- hr = m_deviceContext->CreateBitmapFromDxgiSurface(backBufferSurface.Get(), NULL, backBufferBitmap.GetAddressOf());
+ hr = m_deviceContext->CreateBitmapFromDxgiSurface(backBufferSurface.Get(), nullptr, backBufferBitmap.GetAddressOf());
if (FAILED(hr)) {
qWarning("%s: Could not create Direct2D Bitmap from DXGI Surface: %#lx", __FUNCTION__, hr);
return;