Fix more C++11 narrowing warnings

REVIEW: 106997
remotes/origin/Plasma/5.0
Jurica Vukadin 14 years ago committed by Martin Gräßlin
parent e68955866d
commit bcdc74f8d6
  1. 3
      client.cpp
  2. 6
      lanczosfilter.cpp
  3. 8
      libkwineffects/kwingltexture.cpp
  4. 2
      overlaywindow.cpp
  5. 6
      scene_opengl.cpp
  6. 2
      scene_xrender.cpp

@ -744,7 +744,8 @@ void Client::setMask(const QRegion& reg, int mode)
}
if (shape()) {
// The rest of the applyign using a temporary window
XRectangle rec = { 0, 0, clientSize().width(), clientSize().height() };
XRectangle rec = { 0, 0, static_cast<unsigned short>(clientSize().width()),
static_cast<unsigned short>(clientSize().height()) };
XShapeCombineRectangles(display(), shape_helper_window, ShapeBounding,
clientPos().x(), clientPos().y(), &rec, 1, ShapeSubtract, Unsorted);
XShapeCombineShape(display(), shape_helper_window, ShapeBounding,

@ -432,7 +432,8 @@ void LanczosFilter::prepareRenderStates(GLTexture* tex, double opacity, double b
// Note that both operands have to be in range [0.5; 1] since opengl
// automatically substracts 0.5 from them
glActiveTexture(GL_TEXTURE1);
float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11, saturation };
float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11,
static_cast<float>(saturation) };
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS);
@ -500,7 +501,8 @@ void LanczosFilter::prepareRenderStates(GLTexture* tex, double opacity, double b
opacity);
} else {
// Multiply color by brightness and replace alpha by opacity
float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness, opacity };
float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness,
static_cast<float>(opacity) };
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);

@ -311,10 +311,10 @@ void GLTexture::render(QRegion region, const QRect& rect, bool hardwareClipping)
}
const float verts[ 4 * 2 ] = {
// NOTICE: r.x/y could be replaced by "0", but that would make it unreadable...
r.x(), r.y(),
r.x(), r.y() + rect.height(),
r.x() + rect.width(), r.y(),
r.x() + rect.width(), r.y() + rect.height()
static_cast<float>(r.x()), static_cast<float>(r.y()),
static_cast<float>(r.x()), static_cast<float>(r.y() + rect.height()),
static_cast<float>(r.x() + rect.width()), static_cast<float>(r.y()),
static_cast<float>(r.x() + rect.width()), static_cast<float>(r.y() + rect.height())
};
#ifdef KWIN_HAVE_OPENGLES
const float texWidth = 1.0f;

@ -142,7 +142,7 @@ void OverlayWindow::destroy()
if (m_window == None)
return;
// reset the overlay shape
XRectangle rec = { 0, 0, displayWidth(), displayHeight() };
XRectangle rec = { 0, 0, static_cast<unsigned short>(displayWidth()), static_cast<unsigned short>(displayHeight()) };
XShapeCombineRectangles(display(), m_window, ShapeBounding, 0, 0, &rec, 1, ShapeSet, Unsorted);
XShapeCombineRectangles(display(), m_window, ShapeInput, 0, 0, &rec, 1, ShapeSet, Unsorted);
#ifdef KWIN_HAVE_XCOMPOSITE_OVERLAY

@ -1299,7 +1299,8 @@ void SceneOpenGL1Window::prepareStates(TextureType type, qreal opacity, qreal br
// Note that both operands have to be in range [0.5; 1] since opengl
// automatically substracts 0.5 from them
glActiveTexture(GL_TEXTURE1);
float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11, saturation };
float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11,
static_cast<float>(saturation) };
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS);
@ -1367,7 +1368,8 @@ void SceneOpenGL1Window::prepareStates(TextureType type, qreal opacity, qreal br
opacity);
} else {
// Multiply color by brightness and replace alpha by opacity
float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness, opacity };
float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness,
static_cast<float>(opacity) };
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);

@ -696,7 +696,7 @@ XRenderComposite(display(), PictOpOver, _PART_->x11PictureHandle(), decorationAl
if (data.brightness() < 1.0) {
// fake brightness change by overlaying black
XRenderColor col = { 0, 0, 0, 0xffff *(1 - data.brightness()) * data.opacity() };
XRenderColor col = { 0, 0, 0, static_cast<unsigned short>(0xffff *(1 - data.brightness()) * data.opacity()) };
if (blitInTempPixmap) {
XRenderFillRectangle(display(), PictOpOver, renderTarget, &col,
-temp_visibleRect.left(), -temp_visibleRect.top(), width(), height());

Loading…
Cancel
Save