mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1207944 (part 5) - Use SetColor(const Color&) when setting from a constructed gfxRGBA. r=jwatt.
In various places SetColor() gets passed a gfxRBGA that is constructed at the call site. This patch changes these to construct a gfx::Color directly, avoiding the subsequent conversion.
This commit is contained in:
parent
043314a662
commit
5bead7803b
@ -584,7 +584,7 @@ BasicLayerManager::FlashWidgetUpdateArea(gfxContext *aContext)
|
|||||||
float r = float(rand()) / RAND_MAX;
|
float r = float(rand()) / RAND_MAX;
|
||||||
float g = float(rand()) / RAND_MAX;
|
float g = float(rand()) / RAND_MAX;
|
||||||
float b = float(rand()) / RAND_MAX;
|
float b = float(rand()) / RAND_MAX;
|
||||||
aContext->SetColor(gfxRGBA(r, g, b, 0.2));
|
aContext->SetColor(Color(r, g, b, 0.2f));
|
||||||
aContext->Paint();
|
aContext->Paint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1004,10 +1004,9 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
|||||||
gfxRect destRect;
|
gfxRect destRect;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (aLayer->GetDebugColorIndex() != 0) {
|
if (aLayer->GetDebugColorIndex() != 0) {
|
||||||
gfxRGBA color((aLayer->GetDebugColorIndex() & 1) ? 1.0 : 0.0,
|
Color color((aLayer->GetDebugColorIndex() & 1) ? 1.f : 0.f,
|
||||||
(aLayer->GetDebugColorIndex() & 2) ? 1.0 : 0.0,
|
(aLayer->GetDebugColorIndex() & 2) ? 1.f : 0.f,
|
||||||
(aLayer->GetDebugColorIndex() & 4) ? 1.0 : 0.0,
|
(aLayer->GetDebugColorIndex() & 4) ? 1.f : 0.f);
|
||||||
1.0);
|
|
||||||
|
|
||||||
nsRefPtr<gfxContext> temp = new gfxContext(untransformedDT, Point(bounds.x, bounds.y));
|
nsRefPtr<gfxContext> temp = new gfxContext(untransformedDT, Point(bounds.x, bounds.y));
|
||||||
temp->SetColor(color);
|
temp->SetColor(color);
|
||||||
|
@ -547,7 +547,7 @@ struct BufferAlphaColor {
|
|||||||
aBounds.Width() / appsPerDevUnit,
|
aBounds.Width() / appsPerDevUnit,
|
||||||
aBounds.Height() / appsPerDevUnit), true);
|
aBounds.Height() / appsPerDevUnit), true);
|
||||||
mContext->Clip();
|
mContext->Clip();
|
||||||
mContext->SetColor(gfxRGBA(aAlphaColor.r, aAlphaColor.g, aAlphaColor.b));
|
mContext->SetColor(Color(aAlphaColor.r, aAlphaColor.g, aAlphaColor.b));
|
||||||
mContext->PushGroup(gfxContentType::COLOR_ALPHA);
|
mContext->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||||
mAlpha = aAlphaColor.a;
|
mAlpha = aAlphaColor.a;
|
||||||
}
|
}
|
||||||
|
@ -1576,7 +1576,7 @@ FrameLayerBuilder::FlashPaint(gfxContext *aContext)
|
|||||||
float r = float(rand()) / RAND_MAX;
|
float r = float(rand()) / RAND_MAX;
|
||||||
float g = float(rand()) / RAND_MAX;
|
float g = float(rand()) / RAND_MAX;
|
||||||
float b = float(rand()) / RAND_MAX;
|
float b = float(rand()) / RAND_MAX;
|
||||||
aContext->SetColor(gfxRGBA(r, g, b, 0.4));
|
aContext->SetColor(Color(r, g, b, 0.4f));
|
||||||
aContext->Paint();
|
aContext->Paint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user