diff --git a/gfx/layers/CanvasRenderer.h b/gfx/layers/CanvasRenderer.h index f2856974a5f3..7e03e295b083 100644 --- a/gfx/layers/CanvasRenderer.h +++ b/gfx/layers/CanvasRenderer.h @@ -143,7 +143,6 @@ class CanvasRenderer : public RefCounted { std::shared_ptr BorrowSnapshot( bool requireAlphaPremult = true) const; - protected: void FirePreTransactionCallback() const; void FireDidTransactionCallback() const; }; diff --git a/gfx/layers/basic/BasicCanvasLayer.cpp b/gfx/layers/basic/BasicCanvasLayer.cpp index 19dc6edf175e..5f7399c02047 100644 --- a/gfx/layers/basic/BasicCanvasLayer.cpp +++ b/gfx/layers/basic/BasicCanvasLayer.cpp @@ -32,14 +32,15 @@ void BasicCanvasLayer::Paint(DrawTarget* aDT, const Point& aDeviceOffset, if (IsHidden()) return; // Ignore IsDirty(). - const auto& cr = mCanvasRenderer; - MOZ_ASSERT(cr); - const auto snapshot = cr->BorrowSnapshot(); + MOZ_ASSERT(mCanvasRenderer); + mCanvasRenderer->FirePreTransactionCallback(); + + const auto snapshot = mCanvasRenderer->BorrowSnapshot(); if (!snapshot) return; const auto& surface = snapshot->mSurf; Maybe oldTM; - if (!cr->YIsDown()) { + if (!mCanvasRenderer->YIsDown()) { // y-flip oldTM = Some(aDT->GetTransform()); aDT->SetTransform(Matrix(*oldTM) @@ -57,6 +58,8 @@ void BasicCanvasLayer::Paint(DrawTarget* aDT, const Point& aDeviceOffset, aDT->SetTransform(*oldTM); } + mCanvasRenderer->FireDidTransactionCallback(); + Painted(); }