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:
Nicholas Nethercote
2015-09-23 23:42:58 -07:00
parent 15a618076e
commit c1b2461b9d
3 changed files with 6 additions and 7 deletions

View File

@@ -584,7 +584,7 @@ BasicLayerManager::FlashWidgetUpdateArea(gfxContext *aContext)
float r = float(rand()) / RAND_MAX;
float g = 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();
}
}
@@ -1004,10 +1004,9 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
gfxRect destRect;
#ifdef DEBUG
if (aLayer->GetDebugColorIndex() != 0) {
gfxRGBA color((aLayer->GetDebugColorIndex() & 1) ? 1.0 : 0.0,
(aLayer->GetDebugColorIndex() & 2) ? 1.0 : 0.0,
(aLayer->GetDebugColorIndex() & 4) ? 1.0 : 0.0,
1.0);
Color color((aLayer->GetDebugColorIndex() & 1) ? 1.f : 0.f,
(aLayer->GetDebugColorIndex() & 2) ? 1.f : 0.f,
(aLayer->GetDebugColorIndex() & 4) ? 1.f : 0.f);
nsRefPtr<gfxContext> temp = new gfxContext(untransformedDT, Point(bounds.x, bounds.y));
temp->SetColor(color);