Bug 1208283 (part 5) - Pass a gfx::Color instead of a gfxRGBA to PaintRectToSurface(). r=jwatt.

--HG--
extra : rebase_source : 6d5e72d5a5579d445a77f090b357720a71654e99
This commit is contained in:
Nicholas Nethercote 2015-09-24 18:32:40 -07:00
Родитель ff7df9ad79
Коммит 634396125b
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -3216,7 +3216,7 @@ PluginInstanceChild::PaintRectToPlatformSurface(const nsIntRect& aRect,
void
PluginInstanceChild::PaintRectToSurface(const nsIntRect& aRect,
gfxASurface* aSurface,
const gfxRGBA& aColor)
const Color& aColor)
{
// Render using temporary X surface, with copy to image surface
nsIntRect plPaintRect(aRect);
@ -3242,7 +3242,7 @@ PluginInstanceChild::PaintRectToSurface(const nsIntRect& aRect,
// Moz2D treats OP_SOURCE operations as unbounded, so we need to
// clip to the rect that we want to fill:
dt->PushClipRect(rect);
dt->FillRect(rect, ColorPattern(ToColor(aColor)), // aColor is already a device color
dt->FillRect(rect, ColorPattern(aColor), // aColor is already a device color
DrawOptions(1.f, CompositionOp::OP_SOURCE));
dt->PopClip();
dt->Flush();
@ -3325,7 +3325,7 @@ PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
// Paint the plugin directly onto the target, with a white
// background and copy the result
PaintRectToSurface(rect, aSurface, gfxRGBA(1.0, 1.0, 1.0));
PaintRectToSurface(rect, aSurface, Color(1.f, 1.f, 1.f));
{
RefPtr<DrawTarget> dt = CreateDrawTargetForSurface(whiteImage);
RefPtr<SourceSurface> surface =
@ -3335,7 +3335,7 @@ PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
// Paint the plugin directly onto the target, with a black
// background
PaintRectToSurface(rect, aSurface, gfxRGBA(0.0, 0.0, 0.0));
PaintRectToSurface(rect, aSurface, Color(0.f, 0.f, 0.f));
// Don't copy the result, just extract a subimage so that we can
// recover alpha directly into the target
@ -3345,7 +3345,7 @@ PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
#else
// Paint onto white background
whiteImage->SetDeviceOffset(deviceOffset);
PaintRectToSurface(rect, whiteImage, gfxRGBA(1.0, 1.0, 1.0));
PaintRectToSurface(rect, whiteImage, Color(1.f, 1.f, 1.f));
if (useSurfaceSubimageForBlack) {
gfxImageSurface *surface = static_cast<gfxImageSurface*>(aSurface);
@ -3357,7 +3357,7 @@ PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
// Paint onto black background
blackImage->SetDeviceOffset(deviceOffset);
PaintRectToSurface(rect, blackImage, gfxRGBA(0.0, 0.0, 0.0));
PaintRectToSurface(rect, blackImage, Color(0.f, 0.f, 0.f));
#endif
MOZ_ASSERT(whiteImage && blackImage, "Didn't paint enough!");
@ -3517,7 +3517,7 @@ PluginInstanceChild::ShowPluginFrame()
}
// ... and hand off to the plugin
// BEWARE: mBackground may die during this call
PaintRectToSurface(rect, mCurrentSurface, gfxRGBA(0.0, 0.0, 0.0, 0.0));
PaintRectToSurface(rect, mCurrentSurface, Color());
} else if (!temporarilyMakeVisible && mDoAlphaExtraction) {
// We don't want to pay the expense of alpha extraction for
// phony paints.
@ -3534,7 +3534,7 @@ PluginInstanceChild::ShowPluginFrame()
(temporarilyMakeVisible && mHelperSurface) ?
mHelperSurface : mCurrentSurface;
PaintRectToSurface(rect, target, gfxRGBA(0.0, 0.0, 0.0, 0.0));
PaintRectToSurface(rect, target, Color());
}
mHasPainted = true;

Просмотреть файл

@ -514,7 +514,7 @@ private:
// Paint plugin content rectangle to surface with bg color filling
void PaintRectToSurface(const nsIntRect& aRect,
gfxASurface* aSurface,
const gfxRGBA& aColor);
const gfx::Color& aColor);
// Render plugin content to surface using
// white/black image alpha extraction algorithm