mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 550537: Use a different optimal operator for Direct2D. r=jrmuizel
This commit is contained in:
parent
4a6761de48
commit
41977ad8e8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user