mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 923434 - Don't use operator source for D2D in ThebesLayerBuffer since it's slower. r=Bas
This commit is contained in:
parent
92d47bc46f
commit
2b4a1c6957
@ -178,6 +178,19 @@ RotatedBuffer::DrawBufferQuadrant(gfx::DrawTarget* aTarget,
|
||||
|
||||
gfx::Point quadrantTranslation(quadrantRect.x, quadrantRect.y);
|
||||
|
||||
MOZ_ASSERT(aOperator == OP_OVER || aOperator == OP_SOURCE);
|
||||
// direct2d is much slower when using OP_SOURCE so use OP_OVER and
|
||||
// (maybe) a clear instead. Normally we need to draw in a single operation
|
||||
// (to avoid flickering) but direct2d is ok since it defers rendering.
|
||||
// We should try abstract this logic in a helper when we have other use
|
||||
// cases.
|
||||
if (aTarget->GetType() == BACKEND_DIRECT2D && aOperator == OP_SOURCE) {
|
||||
aOperator = OP_OVER;
|
||||
if (mDTBuffer->GetFormat() == FORMAT_B8G8R8A8) {
|
||||
aTarget->ClearRect(ToRect(fillRect));
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<SourceSurface> snapshot;
|
||||
if (aSource == BUFFER_BLACK) {
|
||||
snapshot = mDTBuffer->Snapshot();
|
||||
|
Loading…
Reference in New Issue
Block a user