mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 1368386 - Make ProgressiveUpdate's aValidRegion parameter const to make it a bit easier to reason about. r=mattwoodrow
MozReview-Commit-ID: DOfJ8TTuL1t --HG-- extra : rebase_source : d4e6a1dc8aedb9f6b446c43aeded6823944c497a
This commit is contained in:
parent
fd5c1c95ed
commit
da5c42ccd2
@ -322,8 +322,12 @@ ClientTiledPaintedLayer::RenderHighPrecision(const nsIntRegion& aInvalidRegion,
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update with old valid region %s\n", this, Stringify(oldValidRegion).c_str());
|
||||
|
||||
return mContentClient->GetTiledBuffer()->ProgressiveUpdate(mValidRegion, aInvalidRegion,
|
||||
oldValidRegion, &mPaintData, aCallback, aCallbackData);
|
||||
nsIntRegion drawnRegion;
|
||||
bool updatedBuffer =
|
||||
mContentClient->GetTiledBuffer()->ProgressiveUpdate(mValidRegion, aInvalidRegion,
|
||||
oldValidRegion, drawnRegion, &mPaintData, aCallback, aCallbackData);
|
||||
mValidRegion.OrWith(drawnRegion);
|
||||
return updatedBuffer;
|
||||
}
|
||||
|
||||
// Otherwise do a non-progressive paint. We must do this even when
|
||||
@ -388,9 +392,11 @@ ClientTiledPaintedLayer::RenderLowPrecision(const nsIntRegion& aInvalidRegion,
|
||||
TILING_LOG("TILING %p: Progressive paint: low-precision old valid region is %s\n", this, Stringify(oldValidRegion).c_str());
|
||||
|
||||
if (!invalidRegion.IsEmpty()) {
|
||||
nsIntRegion drawnRegion;
|
||||
updatedBuffer = mContentClient->GetLowPrecisionTiledBuffer()->ProgressiveUpdate(
|
||||
mLowPrecisionValidRegion, invalidRegion, oldValidRegion,
|
||||
&mPaintData, aCallback, aCallbackData);
|
||||
drawnRegion, &mPaintData, aCallback, aCallbackData);
|
||||
mLowPrecisionValidRegion.OrWith(drawnRegion);
|
||||
}
|
||||
|
||||
TILING_LOG("TILING %p: Progressive paint: low-precision new valid region is %s\n", this, Stringify(mLowPrecisionValidRegion).c_str());
|
||||
|
@ -45,9 +45,10 @@ public:
|
||||
bool aIsProgressive = false) override;
|
||||
|
||||
bool SupportsProgressiveUpdate() override { return false; }
|
||||
bool ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
bool ProgressiveUpdate(const nsIntRegion& aValidRegion,
|
||||
const nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
nsIntRegion& aOutDrawnRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData) override
|
||||
|
@ -1336,9 +1336,10 @@ ClientMultiTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& a
|
||||
}
|
||||
|
||||
bool
|
||||
ClientMultiTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
ClientMultiTiledLayerBuffer::ProgressiveUpdate(const nsIntRegion& aValidRegion,
|
||||
const nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
nsIntRegion& aOutDrawnRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
@ -1350,6 +1351,7 @@ ClientMultiTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
bool repeat = false;
|
||||
bool isBufferChanged = false;
|
||||
nsIntRegion remainingInvalidRegion = aInvalidRegion;
|
||||
nsIntRegion updatedValidRegion = aValidRegion;
|
||||
do {
|
||||
// Compute the region that should be updated. Repeat as many times as
|
||||
// is required.
|
||||
@ -1370,13 +1372,14 @@ ClientMultiTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
isBufferChanged = true;
|
||||
|
||||
// Keep track of what we're about to refresh.
|
||||
aValidRegion.Or(aValidRegion, regionToPaint);
|
||||
aOutDrawnRegion.OrWith(regionToPaint);
|
||||
updatedValidRegion.OrWith(regionToPaint);
|
||||
|
||||
// aValidRegion may have been altered by InvalidateRegion, but we still
|
||||
// want to display stale content until it gets progressively updated.
|
||||
// Create a region that includes stale content.
|
||||
nsIntRegion validOrStale;
|
||||
validOrStale.Or(aValidRegion, aOldValidRegion);
|
||||
validOrStale.Or(updatedValidRegion, aOldValidRegion);
|
||||
|
||||
// Paint the computed region and subtract it from the invalid region.
|
||||
PaintThebes(validOrStale, regionToPaint, remainingInvalidRegion,
|
||||
@ -1384,7 +1387,7 @@ ClientMultiTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
remainingInvalidRegion.SubOut(regionToPaint);
|
||||
} while (repeat);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update final valid region %s buffer changed %d\n", &mPaintedLayer, Stringify(aValidRegion).c_str(), isBufferChanged);
|
||||
TILING_LOG("TILING %p: Progressive update final valid region %s buffer changed %d\n", &mPaintedLayer, Stringify(updatedValidRegion).c_str(), isBufferChanged);
|
||||
TILING_LOG("TILING %p: Progressive update final invalid region %s\n", &mPaintedLayer, Stringify(remainingInvalidRegion).c_str());
|
||||
|
||||
// Return false if nothing has been drawn, or give what has been drawn
|
||||
|
@ -296,9 +296,10 @@ public:
|
||||
bool aIsProgressive = false) = 0;
|
||||
|
||||
virtual bool SupportsProgressiveUpdate() = 0;
|
||||
virtual bool ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
virtual bool ProgressiveUpdate(const nsIntRegion& aValidRegion,
|
||||
const nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
nsIntRegion& aOutDrawnRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData) = 0;
|
||||
@ -354,10 +355,13 @@ public:
|
||||
/**
|
||||
* Performs a progressive update of a given tiled buffer.
|
||||
* See ComputeProgressiveUpdateRegion below for parameter documentation.
|
||||
* aOutDrawnRegion is an outparameter that contains the region that was
|
||||
* drawn, and which can now be added to the layer's valid region.
|
||||
*/
|
||||
bool ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
bool ProgressiveUpdate(const nsIntRegion& aValidRegion,
|
||||
const nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
nsIntRegion& aOutDrawnRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData) override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user