Backed out changeset 0569a8a2f83d (bug 958727) for causing performance regressions.

This commit is contained in:
Ryan VanderMeulen 2014-02-26 20:48:41 -05:00
parent 597733983b
commit 8d98e3613b

View File

@ -301,17 +301,9 @@ RotatedContentBuffer::BufferContentType()
bool
RotatedContentBuffer::BufferSizeOkFor(const nsIntSize& aSize)
{
if (aSize == mBufferRect.Size()) {
return true;
}
if (SizedToVisibleBounds != mBufferSizePolicy &&
aSize < mBufferRect.Size()) {
return (aSize.width * 2 > mBufferRect.width) &&
(aSize.height * 2 > mBufferRect.height);
}
return false;
return (aSize == mBufferRect.Size() ||
(SizedToVisibleBounds != mBufferSizePolicy &&
aSize < mBufferRect.Size()));
}
bool
@ -511,9 +503,8 @@ RotatedContentBuffer::BeginPaint(ThebesLayer* aLayer,
// or call CreateBuffer before this call.
FinalizeFrame(result.mRegionToDraw);
if (result.mRegionToDraw.IsEmpty()) {
if (result.mRegionToDraw.IsEmpty())
return result;
}
nsIntRect drawBounds = result.mRegionToDraw.GetBounds();
RefPtr<DrawTarget> destDTBuffer;
@ -623,7 +614,7 @@ RotatedContentBuffer::BeginPaint(ThebesLayer* aLayer,
mBufferRotation = nsIntPoint(0,0);
}
} else {
// The buffer's not big enough or the buffer needs to shrink, so allocate a new one
// The buffer's not big enough, so allocate a new one
CreateBuffer(result.mContentType, destBufferRect, bufferFlags,
&destDTBuffer, &destDTBufferOnWhite);
if (!destDTBuffer) {