Bug 550537: Use a different optimal operator for Direct2D. r=jrmuizel

This commit is contained in:
Bas Schouten 2010-03-12 11:08:25 +01:00
Родитель e49c079f3d
Коммит 8c77d90255
2 изменённых файлов: 23 добавлений и 1 удалений

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

@ -630,7 +630,7 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::GraphicsFilter aFilter,
if ((op == gfxContext::OPERATOR_OVER || pushedGroup) &&
format == gfxASurface::ImageFormatRGB24) {
aContext->SetOperator(gfxContext::OPERATOR_SOURCE);
aContext->SetOperator(OptimalFillOperator());
}
// Phew! Now we can actually draw this image
@ -955,3 +955,18 @@ void imgFrame::SetCompositingFailed(PRBool val)
{
mCompositingFailed = val;
}
gfxContext::GraphicsOperator imgFrame::OptimalFillOperator()
{
#ifdef XP_WIN
if (gfxWindowsPlatform::GetPlatform()->GetRenderMode() ==
gfxWindowsPlatform::RENDER_DIRECT2D) {
// D2D -really- hates operator source.
return gfxContext::OPERATOR_OVER;
} else {
#endif
return gfxContext::OPERATOR_SOURCE;
#ifdef XP_WIN
}
#endif
}

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

@ -140,6 +140,13 @@ private: // methods
return ((1 << mPaletteDepth) * sizeof(PRUint32));
}
/**
* This returns the fastest operator to use for solid surfaces which have no
* alpha channel or their alpha channel is uniformly opaque.
* This differs per render mode.
*/
gfxContext::GraphicsOperator OptimalFillOperator();
private: // data
nsRefPtr<gfxImageSurface> mImageSurface;
nsRefPtr<gfxASurface> mOptSurface;