mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1577236 - clang-10: Fix -Wimplicit-int-float-conversion warnings in gfx/ r=nical
Differential Revision: https://phabricator.services.mozilla.com/D43776 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
bbfc6ecf78
commit
843fae6aee
@ -1052,9 +1052,9 @@ void BasicCompositor::EndFrame() {
|
||||
mRenderTarget->mDrawTarget->PopClip();
|
||||
|
||||
if (StaticPrefs::nglayout_debug_widget_update_flashing()) {
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
float r = float(rand()) / float(RAND_MAX);
|
||||
float g = float(rand()) / float(RAND_MAX);
|
||||
float b = float(rand()) / float(RAND_MAX);
|
||||
// We're still clipped to mInvalidRegion, so just fill the bounds.
|
||||
mRenderTarget->mDrawTarget->FillRect(
|
||||
IntRectToRect(mInvalidRegion.GetBounds()).ToUnknownRect(),
|
||||
|
@ -663,9 +663,9 @@ bool BasicLayerManager::EndTransactionInternal(
|
||||
|
||||
void BasicLayerManager::FlashWidgetUpdateArea(gfxContext* aContext) {
|
||||
if (StaticPrefs::nglayout_debug_widget_update_flashing()) {
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
float r = float(rand()) / float(RAND_MAX);
|
||||
float g = float(rand()) / float(RAND_MAX);
|
||||
float b = float(rand()) / float(RAND_MAX);
|
||||
aContext->SetColor(Color(r, g, b, 0.2f));
|
||||
aContext->Paint();
|
||||
}
|
||||
|
@ -1903,9 +1903,9 @@ void CompositorOGL::EndFrame() {
|
||||
#endif
|
||||
|
||||
if (StaticPrefs::nglayout_debug_widget_update_flashing()) {
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
float r = float(rand()) / float(RAND_MAX);
|
||||
float g = float(rand()) / float(RAND_MAX);
|
||||
float b = float(rand()) / float(RAND_MAX);
|
||||
EffectChain effectChain;
|
||||
effectChain.mPrimaryEffect = new EffectSolidColor(Color(r, g, b, 0.2f));
|
||||
// If we're clipping the render target to the invalid rect, then the
|
||||
|
@ -2108,9 +2108,9 @@ static bool PaintItemByDrawTarget(nsDisplayItem* aItem, gfx::DrawTarget* aDT,
|
||||
}
|
||||
if (aItem->Frame()->PresContext()->GetPaintFlashing() && isInvalidated) {
|
||||
aDT->SetTransform(gfx::Matrix());
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
float r = float(rand()) / float(RAND_MAX);
|
||||
float g = float(rand()) / float(RAND_MAX);
|
||||
float b = float(rand()) / float(RAND_MAX);
|
||||
aDT->FillRect(Rect(aDT->GetRect()),
|
||||
gfx::ColorPattern(gfx::Color(r, g, b, 0.5)));
|
||||
}
|
||||
|
@ -92,10 +92,10 @@ inline nscoord NSToCoordRound(double aValue) {
|
||||
inline nscoord NSToCoordRoundWithClamp(float aValue) {
|
||||
#ifndef NS_COORD_IS_FLOAT
|
||||
// Bounds-check before converting out of float, to avoid overflow
|
||||
if (aValue >= nscoord_MAX) {
|
||||
if (aValue >= float(nscoord_MAX)) {
|
||||
return nscoord_MAX;
|
||||
}
|
||||
if (aValue <= nscoord_MIN) {
|
||||
if (aValue <= float(nscoord_MIN)) {
|
||||
return nscoord_MIN;
|
||||
}
|
||||
#endif
|
||||
@ -238,10 +238,10 @@ inline nscoord NSToCoordFloor(double aValue) { return nscoord(floor(aValue)); }
|
||||
inline nscoord NSToCoordFloorClamped(float aValue) {
|
||||
#ifndef NS_COORD_IS_FLOAT
|
||||
// Bounds-check before converting out of float, to avoid overflow
|
||||
if (aValue >= nscoord_MAX) {
|
||||
if (aValue >= float(nscoord_MAX)) {
|
||||
return nscoord_MAX;
|
||||
}
|
||||
if (aValue <= nscoord_MIN) {
|
||||
if (aValue <= float(nscoord_MIN)) {
|
||||
return nscoord_MIN;
|
||||
}
|
||||
#endif
|
||||
@ -284,10 +284,10 @@ inline nscoord NSToCoordTrunc(double aValue) {
|
||||
inline nscoord NSToCoordTruncClamped(float aValue) {
|
||||
#ifndef NS_COORD_IS_FLOAT
|
||||
// Bounds-check before converting out of float, to avoid overflow
|
||||
if (aValue >= nscoord_MAX) {
|
||||
if (aValue >= float(nscoord_MAX)) {
|
||||
return nscoord_MAX;
|
||||
}
|
||||
if (aValue <= nscoord_MIN) {
|
||||
if (aValue <= float(nscoord_MIN)) {
|
||||
return nscoord_MIN;
|
||||
}
|
||||
#endif
|
||||
@ -297,10 +297,10 @@ inline nscoord NSToCoordTruncClamped(float aValue) {
|
||||
inline nscoord NSToCoordTruncClamped(double aValue) {
|
||||
#ifndef NS_COORD_IS_FLOAT
|
||||
// Bounds-check before converting out of double, to avoid overflow
|
||||
if (aValue >= nscoord_MAX) {
|
||||
if (aValue >= float(nscoord_MAX)) {
|
||||
return nscoord_MAX;
|
||||
}
|
||||
if (aValue <= nscoord_MIN) {
|
||||
if (aValue <= float(nscoord_MIN)) {
|
||||
return nscoord_MIN;
|
||||
}
|
||||
#endif
|
||||
|
@ -433,9 +433,9 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,
|
||||
|
||||
if (StaticPrefs::gfx_webrender_blob_paint_flashing()) {
|
||||
dt->SetTransform(gfx::Matrix());
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
float r = float(rand()) / float(RAND_MAX);
|
||||
float g = float(rand()) / float(RAND_MAX);
|
||||
float b = float(rand()) / float(RAND_MAX);
|
||||
dt->FillRect(gfx::Rect(origin.x, origin.y, aSize.width, aSize.height),
|
||||
gfx::ColorPattern(gfx::Color(r, g, b, 0.5)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user