зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1083245: Pop all clips before copying to the destination blending surface. r=jrmuizel
We need to pop the clips from the decide context before flushing and copying to the destination blending surface, otherwise drawing commands executed on a pushed layer for clipping will not be realized on the destination surface for blending. Note that this fixes most situation, but in the case of doing custom blending to an area of a surface which is not opaque while having a complex clip pushed this will still lead to some artifacts. I haven't seen this be a problem in practice though.
This commit is contained in:
Родитель
7a4a2758f6
Коммит
fdee1bb880
|
@ -968,6 +968,8 @@ DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern)
|
|||
mDC->CreateBitmap(D2DIntSize(mSize), D2D1::BitmapProperties(D2DPixelFormat(mFormat)), byRef(tmpBitmap));
|
||||
|
||||
// This flush is important since the copy method will not know about the context drawing to the surface.
|
||||
// We also need to pop all the clips to make sure any drawn content will have made it to the final bitmap.
|
||||
PopAllClips();
|
||||
mDC->Flush();
|
||||
|
||||
// We need to use a copy here because affects don't accept a surface on
|
||||
|
@ -978,6 +980,9 @@ DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern)
|
|||
mBlendEffect->SetInput(1, mTempBitmap);
|
||||
mBlendEffect->SetValue(D2D1_BLEND_PROP_MODE, D2DBlendMode(aOp));
|
||||
|
||||
PushClipsToDC(mDC);
|
||||
mClipsArePushed = true;
|
||||
|
||||
mDC->DrawImage(mBlendEffect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY);
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче