Bug 1023882 - Part 2 - Create a first-transaction block for all the first-transaction code. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2014-06-11 12:42:44 -04:00
Родитель 616b195e22
Коммит 61a044a7ba
1 изменённых файлов: 27 добавлений и 35 удалений

Просмотреть файл

@ -86,10 +86,6 @@ GetTransformToAncestorsParentLayer(Layer* aStart, Layer* aAncestor)
void
ClientTiledThebesLayer::BeginPaint()
{
if (ClientManager()->IsRepeatTransaction()) {
return;
}
mPaintData.mLowPrecisionPaintCount = 0;
mPaintData.mPaintFinished = false;
mPaintData.mCompositionBounds.SetEmpty();
@ -240,38 +236,34 @@ ClientTiledThebesLayer::RenderLayer()
return;
}
// Only paint the mask layer on the first transaction.
if (GetMaskLayer() && !ClientManager()->IsRepeatTransaction()) {
ToClientLayer(GetMaskLayer())->RenderLayer();
}
// In some cases we can take a fast path and just be done with it.
if (UseFastPath()) {
mValidRegion = mVisibleRegion;
NS_ASSERTION(!ClientManager()->IsRepeatTransaction(), "Didn't paint our mask layer");
mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion,
callback, data);
ClientManager()->Hold(this);
mContentClient->UseTiledLayerBuffer(TiledContentClient::TILED_BUFFER);
return;
}
// Calculate everything we need to perform the paint.
BeginPaint();
if (mPaintData.mPaintFinished) {
return;
}
TILING_PRLOG_OBJ(("TILING 0x%p: Valid region %s\n", this, tmpstr.get()), mValidRegion);
TILING_PRLOG_OBJ(("TILING 0x%p: Visible region %s\n", this, tmpstr.get()), mVisibleRegion);
// Make sure that tiles that fall outside of the visible region are
// discarded on the first update.
if (!ClientManager()->IsRepeatTransaction()) {
// Only paint the mask layer on the first transaction.
if (GetMaskLayer()) {
ToClientLayer(GetMaskLayer())->RenderLayer();
}
// In some cases we can take a fast path and just be done with it.
if (UseFastPath()) {
TILING_PRLOG(("TILING 0x%p: Taking fast-path\n"));
mValidRegion = mVisibleRegion;
mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, callback, data);
ClientManager()->Hold(this);
mContentClient->UseTiledLayerBuffer(TiledContentClient::TILED_BUFFER);
return;
}
// For more complex cases we need to calculate a bunch of metrics before we
// can do the paint.
BeginPaint();
if (mPaintData.mPaintFinished) {
return;
}
TILING_PRLOG_OBJ(("TILING 0x%p: Valid region %s\n", this, tmpstr.get()), mValidRegion);
TILING_PRLOG_OBJ(("TILING 0x%p: Visible region %s\n", this, tmpstr.get()), mVisibleRegion);
// Make sure that tiles that fall outside of the visible region are
// discarded on the first update.
mValidRegion.And(mValidRegion, mVisibleRegion);
if (!mPaintData.mCriticalDisplayPort.IsEmpty()) {
// Make sure that tiles that fall outside of the critical displayport are