зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1023882 - Part 7 - Move down the calculation of the low-precision invalid region so it happens later. r=Cwiiis
This commit is contained in:
Родитель
e9c83fc117
Коммит
efa88b9b2c
|
@ -240,10 +240,9 @@ ClientTiledThebesLayer::RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||||
LayerManager::DrawThebesLayerCallback aCallback,
|
LayerManager::DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData)
|
void* aCallbackData)
|
||||||
{
|
{
|
||||||
// Render the low precision buffer, if there's area to invalidate and the
|
// Render the low precision buffer, if the visible region is larger than the
|
||||||
// visible region is larger than the critical display port.
|
// critical display port.
|
||||||
if (!aInvalidRegion.IsEmpty() &&
|
if (!nsIntRegion(LayerIntRect::ToUntyped(mPaintData.mCriticalDisplayPort)).Contains(mVisibleRegion)) {
|
||||||
!nsIntRegion(LayerIntRect::ToUntyped(mPaintData.mCriticalDisplayPort)).Contains(mVisibleRegion)) {
|
|
||||||
nsIntRegion oldValidRegion = mContentClient->mLowPrecisionTiledBuffer.GetValidRegion();
|
nsIntRegion oldValidRegion = mContentClient->mLowPrecisionTiledBuffer.GetValidRegion();
|
||||||
oldValidRegion.And(oldValidRegion, mVisibleRegion);
|
oldValidRegion.And(oldValidRegion, mVisibleRegion);
|
||||||
|
|
||||||
|
@ -332,6 +331,7 @@ ClientTiledThebesLayer::RenderLayer()
|
||||||
|
|
||||||
TILING_PRLOG_OBJ(("TILING 0x%p: Initial visible region %s\n", this, tmpstr.get()), mVisibleRegion);
|
TILING_PRLOG_OBJ(("TILING 0x%p: Initial visible region %s\n", this, tmpstr.get()), mVisibleRegion);
|
||||||
TILING_PRLOG_OBJ(("TILING 0x%p: Initial valid region %s\n", this, tmpstr.get()), mValidRegion);
|
TILING_PRLOG_OBJ(("TILING 0x%p: Initial valid region %s\n", this, tmpstr.get()), mValidRegion);
|
||||||
|
TILING_PRLOG_OBJ(("TILING 0x%p: Initial low-precision valid region %s\n", this, tmpstr.get()), mLowPrecisionValidRegion);
|
||||||
|
|
||||||
nsIntRegion invalidRegion;
|
nsIntRegion invalidRegion;
|
||||||
invalidRegion.Sub(mVisibleRegion, mValidRegion);
|
invalidRegion.Sub(mVisibleRegion, mValidRegion);
|
||||||
|
@ -381,25 +381,6 @@ ClientTiledThebesLayer::RenderLayer()
|
||||||
TILING_PRLOG_OBJ(("TILING 0x%p: Repeat-transaction invalid region %s\n", this, tmpstr.get()), invalidRegion);
|
TILING_PRLOG_OBJ(("TILING 0x%p: Repeat-transaction invalid region %s\n", this, tmpstr.get()), invalidRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIntRegion lowPrecisionInvalidRegion;
|
|
||||||
if (!mPaintData.mCriticalDisplayPort.IsEmpty()) {
|
|
||||||
if (gfxPrefs::UseLowPrecisionBuffer()) {
|
|
||||||
// Calculate the invalid region for the low precision buffer
|
|
||||||
lowPrecisionInvalidRegion.Sub(mVisibleRegion, mLowPrecisionValidRegion);
|
|
||||||
|
|
||||||
// Remove the valid region from the low precision valid region (we don't
|
|
||||||
// validate this part of the low precision buffer).
|
|
||||||
lowPrecisionInvalidRegion.Sub(lowPrecisionInvalidRegion, mValidRegion);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (invalidRegion.IsEmpty() && lowPrecisionInvalidRegion.IsEmpty()) {
|
|
||||||
EndPaint(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TILING_PRLOG_OBJ(("TILING 0x%p: Invalid region %s\n", this, tmpstr.get()), invalidRegion);
|
|
||||||
|
|
||||||
bool updatedHighPrecision = RenderHighPrecision(invalidRegion, callback, data);
|
bool updatedHighPrecision = RenderHighPrecision(invalidRegion, callback, data);
|
||||||
if (updatedHighPrecision) {
|
if (updatedHighPrecision) {
|
||||||
ClientManager()->Hold(this);
|
ClientManager()->Hold(this);
|
||||||
|
@ -411,23 +392,35 @@ ClientTiledThebesLayer::RenderLayer()
|
||||||
ClientManager()->SetRepeatTransaction();
|
ClientManager()->SetRepeatTransaction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there are low precision updates, mark the paint as unfinished and
|
|
||||||
// request a repeat transaction.
|
|
||||||
if (!lowPrecisionInvalidRegion.IsEmpty()) {
|
|
||||||
ClientManager()->SetRepeatTransaction();
|
|
||||||
mPaintData.mLowPrecisionPaintCount = 1;
|
|
||||||
mPaintData.mPaintFinished = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return so that low precision updates aren't performed in the same
|
nsIntRegion lowPrecisionInvalidRegion;
|
||||||
// transaction as high-precision updates.
|
if (gfxPrefs::UseLowPrecisionBuffer()) {
|
||||||
EndPaint(false);
|
// Calculate the invalid region for the low precision buffer. Make sure
|
||||||
|
// to remove the valid high-precision area so we don't double-paint it.
|
||||||
|
lowPrecisionInvalidRegion.Sub(mVisibleRegion, mLowPrecisionValidRegion);
|
||||||
|
lowPrecisionInvalidRegion.Sub(lowPrecisionInvalidRegion, mValidRegion);
|
||||||
|
}
|
||||||
|
TILING_PRLOG_OBJ(("TILING 0x%p: Low-precision invalid region %s\n", this, tmpstr.get()), lowPrecisionInvalidRegion);
|
||||||
|
|
||||||
|
// If there is nothing to draw in low-precision, then we're done.
|
||||||
|
if (lowPrecisionInvalidRegion.IsEmpty()) {
|
||||||
|
EndPaint(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TILING_PRLOG_OBJ(("TILING 0x%p: Low-precision valid region is %s\n", this, tmpstr.get()), mLowPrecisionValidRegion);
|
if (updatedHighPrecision) {
|
||||||
TILING_PRLOG_OBJ(("TILING 0x%p: Low-precision invalid region is %s\n", this, tmpstr.get()), lowPrecisionInvalidRegion);
|
// If there are low precision updates, but we just did some high-precision
|
||||||
|
// updates, then mark the paint as unfinished and request a repeat transaction.
|
||||||
|
// This is so that we don't perform low-precision updates in the same transaction
|
||||||
|
// as high-precision updates.
|
||||||
|
TILING_PRLOG(("TILING 0x%p: Scheduling repeat transaction for low-precision painting\n", this));
|
||||||
|
ClientManager()->SetRepeatTransaction();
|
||||||
|
mPaintData.mLowPrecisionPaintCount = 1;
|
||||||
|
mPaintData.mPaintFinished = false;
|
||||||
|
EndPaint(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool updatedLowPrecision = RenderLowPrecision(lowPrecisionInvalidRegion, callback, data);
|
bool updatedLowPrecision = RenderLowPrecision(lowPrecisionInvalidRegion, callback, data);
|
||||||
if (updatedLowPrecision) {
|
if (updatedLowPrecision) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче