mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1647167 - Run pre/post transaction triggers in BasicCanvasLayer::Paint. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D82116
This commit is contained in:
parent
411aa9b679
commit
017fc801d8
@ -143,7 +143,6 @@ class CanvasRenderer : public RefCounted<CanvasRenderer> {
|
||||
std::shared_ptr<BorrowedSourceSurface> BorrowSnapshot(
|
||||
bool requireAlphaPremult = true) const;
|
||||
|
||||
protected:
|
||||
void FirePreTransactionCallback() const;
|
||||
void FireDidTransactionCallback() const;
|
||||
};
|
||||
|
@ -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<Matrix> 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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user