зеркало из https://github.com/mozilla/pjs.git
Bug 550537: Use a different optimal operator for Direct2D. r=jrmuizel
This commit is contained in:
Родитель
e49c079f3d
Коммит
8c77d90255
|
@ -630,7 +630,7 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::GraphicsFilter aFilter,
|
||||||
|
|
||||||
if ((op == gfxContext::OPERATOR_OVER || pushedGroup) &&
|
if ((op == gfxContext::OPERATOR_OVER || pushedGroup) &&
|
||||||
format == gfxASurface::ImageFormatRGB24) {
|
format == gfxASurface::ImageFormatRGB24) {
|
||||||
aContext->SetOperator(gfxContext::OPERATOR_SOURCE);
|
aContext->SetOperator(OptimalFillOperator());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phew! Now we can actually draw this image
|
// Phew! Now we can actually draw this image
|
||||||
|
@ -955,3 +955,18 @@ void imgFrame::SetCompositingFailed(PRBool val)
|
||||||
{
|
{
|
||||||
mCompositingFailed = 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));
|
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
|
private: // data
|
||||||
nsRefPtr<gfxImageSurface> mImageSurface;
|
nsRefPtr<gfxImageSurface> mImageSurface;
|
||||||
nsRefPtr<gfxASurface> mOptSurface;
|
nsRefPtr<gfxASurface> mOptSurface;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче