Direct2D: Fix MSVC2015 warnings.

qwindowsdirect2dpaintengine.cpp(365): warning C4838: conversion from 'const qreal' to 'FLOAT' requires a narrowing conversion
qwindowsdirect2dpaintengine.cpp(928): warning C4838: conversion from 'const qreal' to 'FLOAT' requires a narrowing conversion
qwindowsdirect2dpaintengine.cpp(928): warning C4838: conversion from 'int' to 'UINT32' requires a narrowing conversion
qwindowsdirect2dpaintengine.cpp(1398): warning C4838: conversion from 'qreal' to 'FLOAT' requires a narrowing conversion
qwindowsdirect2dpaintengine.cpp(1426): warning C4838: conversion from 'double' to 'FLOAT' requires a narrowing conversion
qwindowsdirect2dbitmap.cpp(78): warning C4838: conversion from 'int' to 'UINT32' requires a narrowing conversion
qwindowsdirect2dwindow.cpp(166): warning C4838: conversion from 'double' to 'BYTE' requires a narrowing conversion

Change-Id: I6992260ed2696fa4c47c1c0dd666f448f115879a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
bb10
Friedemann Kleint 2015-05-22 11:56:23 +02:00
parent 8e797477b9
commit 4476966e04
2 changed files with 12 additions and 12 deletions

View File

@ -358,10 +358,10 @@ public:
} else if (path.isRect() && (q->state()->matrix.type() <= QTransform::TxScale)) {
const qreal * const points = path.points();
D2D_RECT_F rect = {
points[0], // left
points[1], // top
points[2], // right,
points[5] // bottom
FLOAT(points[0]), // left
FLOAT(points[1]), // top
FLOAT(points[2]), // right,
FLOAT(points[5]) // bottom
};
dc()->PushAxisAlignedClip(rect, antialiasMode());
@ -918,13 +918,13 @@ public:
DWRITE_GLYPH_RUN glyphRun = {
fontFace, // IDWriteFontFace *fontFace;
fontDef.pixelSize, // FLOAT fontEmSize;
numGlyphs, // UINT32 glyphCount;
FLOAT(fontDef.pixelSize), // FLOAT fontEmSize;
UINT32(numGlyphs), // UINT32 glyphCount;
glyphIndices, // const UINT16 *glyphIndices;
glyphAdvances, // const FLOAT *glyphAdvances;
glyphOffsets, // const DWRITE_GLYPH_OFFSET *glyphOffsets;
FALSE, // BOOL isSideways;
rtl ? 1 : 0 // UINT32 bidiLevel;
rtl ? 1u : 0u // UINT32 bidiLevel;
};
const bool antiAlias = bool((q->state()->renderHints & QPainter::TextAntialiasing)
@ -1393,8 +1393,8 @@ void QWindowsDirect2DPaintEngine::drawEllipse(const QRectF &r)
D2D1_ELLIPSE ellipse = {
to_d2d_point_2f(p),
r.width() / 2.0,
r.height() / 2.0
FLOAT(r.width() / 2.0),
FLOAT(r.height() / 2.0)
};
if (d->brush.brush)
@ -1421,8 +1421,8 @@ void QWindowsDirect2DPaintEngine::drawEllipse(const QRect &r)
D2D1_ELLIPSE ellipse = {
to_d2d_point_2f(p),
r.width() / 2.0,
r.height() / 2.0
FLOAT(r.width() / 2.0),
FLOAT(r.height() / 2.0)
};
if (d->brush.brush)

View File

@ -163,7 +163,7 @@ void QWindowsDirect2DWindow::present(const QRegion &region)
const SIZE size = { bounds.width(), bounds.height() };
const POINT ptDst = { bounds.x(), bounds.y() };
const POINT ptSrc = { 0, 0 };
const BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255.0 * opacity(), AC_SRC_ALPHA };
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,