Bug 957859: Add "f" suffix to some numeric literals in Compositor.cpp and ContainerLayerComposite.cpp, to fix MSVC C4305 warnings. r=nical

This commit is contained in:
Daniel Holbert 2014-01-09 06:26:19 -08:00
parent dd642a8df5
commit aedfdeb947
2 changed files with 11 additions and 11 deletions

View File

@ -100,20 +100,20 @@ Compositor::DrawDiagnosticsInternal(DiagnosticFlags aFlags,
#else
int lWidth = 2;
#endif
float opacity = 0.7;
float opacity = 0.7f;
gfx::Color color;
if (aFlags & DIAGNOSTIC_CONTENT) {
color = gfx::Color(0.0, 1.0, 0.0, 1.0); // green
color = gfx::Color(0.0f, 1.0f, 0.0f, 1.0f); // green
if (aFlags & DIAGNOSTIC_COMPONENT_ALPHA) {
color = gfx::Color(0.0, 1.0, 1.0, 1.0); // greenish blue
color = gfx::Color(0.0f, 1.0f, 1.0f, 1.0f); // greenish blue
}
} else if (aFlags & DIAGNOSTIC_IMAGE) {
color = gfx::Color(1.0, 0.0, 0.0, 1.0); // red
color = gfx::Color(1.0f, 0.0f, 0.0f, 1.0f); // red
} else if (aFlags & DIAGNOSTIC_COLOR) {
color = gfx::Color(0.0, 0.0, 1.0, 1.0); // blue
color = gfx::Color(0.0f, 0.0f, 1.0f, 1.0f); // blue
} else if (aFlags & DIAGNOSTIC_CONTAINER) {
color = gfx::Color(0.8, 0.0, 0.8, 1.0); // purple
color = gfx::Color(0.8f, 0.0f, 0.8f, 1.0f); // purple
}
// make tile borders a bit more transparent to keep layer borders readable.
@ -121,10 +121,10 @@ Compositor::DrawDiagnosticsInternal(DiagnosticFlags aFlags,
aFlags & DIAGNOSTIC_BIGIMAGE ||
aFlags & DIAGNOSTIC_REGION_RECT) {
lWidth = 1;
opacity = 0.5;
color.r *= 0.7;
color.g *= 0.7;
color.b *= 0.7;
opacity = 0.5f;
color.r *= 0.7f;
color.g *= 0.7f;
color.b *= 0.7f;
}
EffectChain effects;

View File

@ -176,7 +176,7 @@ static void DrawVelGraph(const nsIntRect& aClipRect,
float opacity = 1.0;
EffectChain effects;
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(0.2,0,0,1));
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(0.2f,0,0,1));
compositor->DrawQuad(graphRect,
clipRect,
effects,