diff --git a/gfx/layers/client/SingleTiledContentClient.cpp b/gfx/layers/client/SingleTiledContentClient.cpp index b195fd9abfd0..ec5b15b43339 100644 --- a/gfx/layers/client/SingleTiledContentClient.cpp +++ b/gfx/layers/client/SingleTiledContentClient.cpp @@ -45,6 +45,7 @@ ClientSingleTiledLayerBuffer::ClientSingleTiledLayerBuffer(ClientTiledPaintedLay ClientLayerManager* aManager) : ClientTiledLayerBuffer(aPaintedLayer, aCompositableClient) , mManager(aManager) + , mWasLastPaintProgressive(false) { } @@ -89,7 +90,8 @@ ClientSingleTiledLayerBuffer::GetSurfaceDescriptorTiles() 0, 0, 1, 1, 1.0, mFrameResolution.xScale, - mFrameResolution.yScale); + mFrameResolution.yScale, + mWasLastPaintProgressive); } already_AddRefed @@ -105,8 +107,11 @@ ClientSingleTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion, const nsIntRegion& aPaintRegion, const nsIntRegion& aDirtyRegion, LayerManager::DrawPaintedLayerCallback aCallback, - void* aCallbackData) + void* aCallbackData, + bool aIsProgressive) { + mWasLastPaintProgressive = aIsProgressive; + // Compare layer visible region size to current backbuffer size, discard if not matching. IntSize size = mPaintedLayer->GetVisibleRegion().GetBounds().Size(); IntPoint origin = mPaintedLayer->GetVisibleRegion().GetBounds().TopLeft(); diff --git a/gfx/layers/client/SingleTiledContentClient.h b/gfx/layers/client/SingleTiledContentClient.h index 33a01c5c44cc..c3d84618f772 100644 --- a/gfx/layers/client/SingleTiledContentClient.h +++ b/gfx/layers/client/SingleTiledContentClient.h @@ -41,7 +41,8 @@ public: const nsIntRegion& aPaintRegion, const nsIntRegion& aDirtyRegion, LayerManager::DrawPaintedLayerCallback aCallback, - void* aCallbackData) override; + void* aCallbackData, + bool aIsProgressive = false) override; bool SupportsProgressiveUpdate() override { return false; } bool ProgressiveUpdate(nsIntRegion& aValidRegion, @@ -88,6 +89,7 @@ private: nsIntRegion mPaintedRegion; nsIntRegion mValidRegion; + bool mWasLastPaintProgressive; /** * While we're adding tiles, this is used to keep track of the position of diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index 861cfc065cca..95220a82d6c3 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -905,7 +905,8 @@ ClientMultiTiledLayerBuffer::GetSurfaceDescriptorTiles() mTiles.mFirst.x, mTiles.mFirst.y, mTiles.mSize.width, mTiles.mSize.height, mResolution, mFrameResolution.xScale, - mFrameResolution.yScale); + mFrameResolution.yScale, + mWasLastPaintProgressive); } void @@ -913,13 +914,15 @@ ClientMultiTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion, const nsIntRegion& aPaintRegion, const nsIntRegion& aDirtyRegion, LayerManager::DrawPaintedLayerCallback aCallback, - void* aCallbackData) + void* aCallbackData, + bool aIsProgressive) { TILING_LOG("TILING %p: PaintThebes painting region %s\n", mPaintedLayer, Stringify(aPaintRegion).c_str()); TILING_LOG("TILING %p: PaintThebes new valid region %s\n", mPaintedLayer, Stringify(aNewValidRegion).c_str()); mCallback = aCallback; mCallbackData = aCallbackData; + mWasLastPaintProgressive = aIsProgressive; #ifdef GFX_TILEDLAYER_PREF_WARNINGS long start = PR_IntervalNow(); @@ -1653,7 +1656,7 @@ ClientMultiTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion, // Paint the computed region and subtract it from the invalid region. PaintThebes(validOrStale, regionToPaint, aInvalidRegion, - aCallback, aCallbackData); + aCallback, aCallbackData, true); aInvalidRegion.Sub(aInvalidRegion, regionToPaint); } while (repeat); diff --git a/gfx/layers/client/TiledContentClient.h b/gfx/layers/client/TiledContentClient.h index 1ce96533a265..d5a4169245f3 100644 --- a/gfx/layers/client/TiledContentClient.h +++ b/gfx/layers/client/TiledContentClient.h @@ -407,13 +407,15 @@ public: , mCompositableClient(aCompositableClient) , mLastPaintContentType(gfxContentType::COLOR) , mLastPaintSurfaceMode(SurfaceMode::SURFACE_OPAQUE) + , mWasLastPaintProgressive(false) {} virtual void PaintThebes(const nsIntRegion& aNewValidRegion, const nsIntRegion& aPaintRegion, const nsIntRegion& aDirtyRegion, LayerManager::DrawPaintedLayerCallback aCallback, - void* aCallbackData) = 0; + void* aCallbackData, + bool aIsProgressive = false) = 0; virtual bool SupportsProgressiveUpdate() = 0; virtual bool ProgressiveUpdate(nsIntRegion& aValidRegion, @@ -447,6 +449,8 @@ protected: gfxContentType mLastPaintContentType; SurfaceMode mLastPaintSurfaceMode; CSSToParentLayerScale2D mFrameResolution; + + bool mWasLastPaintProgressive; }; class ClientMultiTiledLayerBuffer @@ -473,7 +477,8 @@ public: const nsIntRegion& aPaintRegion, const nsIntRegion& aDirtyRegion, LayerManager::DrawPaintedLayerCallback aCallback, - void* aCallbackData) override; + void* aCallbackData, + bool aIsProgressive = false) override; virtual bool SupportsProgressiveUpdate() override { return true; } /** diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index 091b0a03e141..63794143b6e6 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -341,6 +341,7 @@ struct SurfaceDescriptorTiles { float resolution; float frameXResolution; float frameYResolution; + bool isProgressive; }; struct OpUseTiledLayerBuffer {