Direct2D QPA plugin: Use member initialization
Use C++ 11 member initialization in value-type structs. Task-number: QTBUG-51673 Change-Id: I2e609337cfc057d1de23b3de62b9ed43a4ecec9c Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>bb10
parent
d9beeb65f9
commit
41b27047ea
|
|
@ -51,7 +51,6 @@ class QWindowsDirect2DDeviceContextPrivate {
|
|||
public:
|
||||
QWindowsDirect2DDeviceContextPrivate(ID2D1DeviceContext *dc)
|
||||
: deviceContext(dc)
|
||||
, refCount(0)
|
||||
{
|
||||
if (!dc) {
|
||||
HRESULT hr = QWindowsDirect2DContext::instance()->d2dDevice()->CreateDeviceContext(
|
||||
|
|
@ -98,7 +97,7 @@ public:
|
|||
}
|
||||
|
||||
ComPtr<ID2D1DeviceContext> deviceContext;
|
||||
int refCount;
|
||||
int refCount = 0;
|
||||
};
|
||||
|
||||
QWindowsDirect2DDeviceContext::QWindowsDirect2DDeviceContext(ID2D1DeviceContext *dc)
|
||||
|
|
|
|||
|
|
@ -74,12 +74,7 @@ public:
|
|||
class Direct2DVersion
|
||||
{
|
||||
private:
|
||||
Direct2DVersion()
|
||||
: partOne(0)
|
||||
, partTwo(0)
|
||||
, partThree(0)
|
||||
, partFour(0)
|
||||
{}
|
||||
Direct2DVersion() = default;
|
||||
|
||||
Direct2DVersion(int one, int two, int three, int four)
|
||||
: partOne(one)
|
||||
|
|
@ -170,7 +165,10 @@ public:
|
|||
return a - b;
|
||||
}
|
||||
|
||||
int partOne, partTwo, partThree, partFour;
|
||||
int partOne = 0;
|
||||
int partTwo = 0;
|
||||
int partThree = 0;
|
||||
int partFour = 0;
|
||||
};
|
||||
|
||||
QWindowsDirect2DIntegration *QWindowsDirect2DIntegration::create(const QStringList ¶mList)
|
||||
|
|
|
|||
|
|
@ -138,14 +138,6 @@ static QVector<D2D1_GRADIENT_STOP> qGradientStopsToD2DStops(const QGradientStops
|
|||
class Direct2DPathGeometryWriter
|
||||
{
|
||||
public:
|
||||
Direct2DPathGeometryWriter()
|
||||
: m_inFigure(false)
|
||||
, m_roundCoordinates(false)
|
||||
, m_adjustPositivelySlopedLines(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool begin()
|
||||
{
|
||||
HRESULT hr = factory()->CreatePathGeometry(&m_geometry);
|
||||
|
|
@ -249,9 +241,9 @@ private:
|
|||
ComPtr<ID2D1PathGeometry1> m_geometry;
|
||||
ComPtr<ID2D1GeometrySink> m_sink;
|
||||
|
||||
bool m_inFigure;
|
||||
bool m_roundCoordinates;
|
||||
bool m_adjustPositivelySlopedLines;
|
||||
bool m_inFigure = false;
|
||||
bool m_roundCoordinates = false;
|
||||
bool m_adjustPositivelySlopedLines = false;
|
||||
QPointF m_previousPoint;
|
||||
};
|
||||
|
||||
|
|
@ -272,7 +264,6 @@ class QWindowsDirect2DPaintEnginePrivate : public QPaintEngineExPrivate
|
|||
public:
|
||||
QWindowsDirect2DPaintEnginePrivate(QWindowsDirect2DBitmap *bm, QWindowsDirect2DPaintEngine::Flags flags)
|
||||
: bitmap(bm)
|
||||
, clipFlags(0)
|
||||
, flags(flags)
|
||||
{
|
||||
pen.reset();
|
||||
|
|
@ -284,7 +275,7 @@ public:
|
|||
QWindowsDirect2DBitmap *bitmap;
|
||||
QImage fallbackImage;
|
||||
|
||||
unsigned int clipFlags;
|
||||
unsigned int clipFlags = 0;
|
||||
QStack<ClipType> pushedClips;
|
||||
QWindowsDirect2DPaintEngine::Flags flags;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,15 +57,12 @@ public:
|
|||
: owns_bitmap(true)
|
||||
, bitmap(new QWindowsDirect2DBitmap)
|
||||
, device(new QWindowsDirect2DPaintDevice(bitmap, QInternal::Pixmap))
|
||||
, devicePixelRatio(1.0)
|
||||
{}
|
||||
|
||||
QWindowsDirect2DPlatformPixmapPrivate(QWindowsDirect2DBitmap *bitmap,
|
||||
QWindowsDirect2DPaintEngine::Flags flags)
|
||||
: owns_bitmap(false)
|
||||
, bitmap(bitmap)
|
||||
: bitmap(bitmap)
|
||||
, device(new QWindowsDirect2DPaintDevice(bitmap, QInternal::Pixmap, flags))
|
||||
, devicePixelRatio(1.0)
|
||||
{}
|
||||
|
||||
~QWindowsDirect2DPlatformPixmapPrivate()
|
||||
|
|
@ -74,10 +71,10 @@ public:
|
|||
delete bitmap;
|
||||
}
|
||||
|
||||
bool owns_bitmap;
|
||||
bool owns_bitmap = false;
|
||||
QWindowsDirect2DBitmap *bitmap;
|
||||
QScopedPointer<QWindowsDirect2DPaintDevice> device;
|
||||
qreal devicePixelRatio;
|
||||
qreal devicePixelRatio = 1.0;
|
||||
};
|
||||
|
||||
static int qt_d2dpixmap_serno = 0;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
QWindowsDirect2DWindow::QWindowsDirect2DWindow(QWindow *window, const QWindowsWindowData &data)
|
||||
: QWindowsWindow(window, data)
|
||||
, m_needsFullFlush(true)
|
||||
, m_directRendering(!(data.flags & Qt::FramelessWindowHint && window->format().hasAlpha()))
|
||||
{
|
||||
if (window->type() == Qt::Desktop)
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ private:
|
|||
Microsoft::WRL::ComPtr<ID2D1DeviceContext> m_deviceContext;
|
||||
QScopedPointer<QWindowsDirect2DBitmap> m_bitmap;
|
||||
QScopedPointer<QPixmap> m_pixmap;
|
||||
bool m_needsFullFlush;
|
||||
bool m_directRendering;
|
||||
bool m_needsFullFlush = true;
|
||||
bool m_directRendering = false;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
Loading…
Reference in New Issue