Bug 951556. Don't do multiple flushes due to DrawBufferWithRotation. r=mattwoodrow

This commit is contained in:
Nicholas Cameron 2014-01-09 13:57:52 +13:00
parent feea036f53
commit 9aca7bac0f
3 changed files with 22 additions and 2 deletions

View File

@ -154,8 +154,6 @@ RotatedBuffer::DrawBufferQuadrant(gfx::DrawTarget* aTarget,
if (aOperator == OP_SOURCE) {
aTarget->PopClip();
}
aTarget->Flush();
}
void
@ -391,6 +389,17 @@ ComputeBufferRect(const nsIntRect& aRequestedRect)
return rect;
}
void
RotatedContentBuffer::FlushBuffers()
{
if (mDTBuffer) {
mDTBuffer->Flush();
}
if (mDTBufferOnWhite) {
mDTBufferOnWhite->Flush();
}
}
RotatedContentBuffer::PaintState
RotatedContentBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
uint32_t aFlags)

View File

@ -75,6 +75,8 @@ public:
BUFFER_WHITE, // The buffer with white background, only valid with component alpha.
BUFFER_BOTH // The combined black/white buffers, only valid for writing operations, not reading.
};
// It is the callers repsonsibility to ensure aTarget is flushed after calling
// this method.
void DrawBufferWithRotation(gfx::DrawTarget* aTarget, ContextSource aSource,
float aOpacity = 1.0,
gfx::CompositionOp aOperator = gfx::OP_OVER,
@ -396,6 +398,10 @@ protected:
*/
bool EnsureBuffer();
bool EnsureBufferOnWhite();
// Flush our buffers if they are mapped.
void FlushBuffers();
/**
* True if we have a buffer where we can get it (but not necessarily
* mapped currently).

View File

@ -598,6 +598,8 @@ ContentClientDoubleBuffered::SyncFrontBufferToBackBuffer()
mFrontBufferRect,
mFrontBufferRotation);
UpdateDestinationFrom(frontBuffer, updateRegion);
// We need to flush our buffers before we unlock our front textures
FlushBuffers();
mFrontClient->Unlock();
if (mFrontClientOnWhite) {
mFrontClientOnWhite->Unlock();
@ -816,6 +818,9 @@ DeprecatedContentClientDoubleBuffered::SyncFrontBufferToBackBuffer()
mFrontBufferRotation);
UpdateDestinationFrom(frontBuffer, updateRegion);
// We need to flush our buffers before we unlock our front textures
FlushBuffers();
mFrontAndBackBufferDiffer = false;
}