зеркало из https://github.com/mozilla/gecko-dev.git
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. --HG-- extra : rebase_source : e2882f4af319c9541891da34da4202baee5470b0
This commit is contained in:
Родитель
a37228e1fe
Коммит
165270a482
|
@ -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);
|
||||
|
|
|
@ -547,7 +547,7 @@ struct BufferAlphaColor {
|
|||
aBounds.Width() / appsPerDevUnit,
|
||||
aBounds.Height() / appsPerDevUnit), true);
|
||||
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);
|
||||
mAlpha = aAlphaColor.a;
|
||||
}
|
||||
|
|
|
@ -1576,7 +1576,7 @@ FrameLayerBuilder::FlashPaint(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.4));
|
||||
aContext->SetColor(Color(r, g, b, 0.4f));
|
||||
aContext->Paint();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче