diff --git a/gfx/layers/RotatedBuffer.cpp b/gfx/layers/RotatedBuffer.cpp index 946c230d9abb..8476c16b2ad0 100644 --- a/gfx/layers/RotatedBuffer.cpp +++ b/gfx/layers/RotatedBuffer.cpp @@ -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 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) {