Bug 1985067. r=jnicol a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262614
This commit is contained in:
committed by
rvandermeulen@mozilla.com
parent
14d3f5b076
commit
44ff633cd5
@@ -85,7 +85,11 @@ class PrintTranslator final : public Translator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AddDrawTarget(ReferencePtr aRefPtr, DrawTarget* aDT) final {
|
void AddDrawTarget(ReferencePtr aRefPtr, DrawTarget* aDT) final {
|
||||||
mDrawTargets.InsertOrUpdate(aRefPtr, RefPtr{aDT});
|
RefPtr<DrawTarget>& value = mDrawTargets.LookupOrInsert(aRefPtr);
|
||||||
|
if (mCurrentDT && mCurrentDT == value) {
|
||||||
|
mCurrentDT = nullptr;
|
||||||
|
}
|
||||||
|
value = aDT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddPath(ReferencePtr aRefPtr, Path* aPath) final {
|
void AddPath(ReferencePtr aRefPtr, Path* aPath) final {
|
||||||
@@ -119,11 +123,11 @@ class PrintTranslator final : public Translator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RemoveDrawTarget(ReferencePtr aRefPtr) final {
|
void RemoveDrawTarget(ReferencePtr aRefPtr) final {
|
||||||
ReferencePtr currentDT = mCurrentDT;
|
RefPtr<DrawTarget> removedDT;
|
||||||
if (currentDT == aRefPtr) {
|
if (mDrawTargets.Remove(aRefPtr, getter_AddRefs(removedDT)) &&
|
||||||
|
mCurrentDT == removedDT) {
|
||||||
mCurrentDT = nullptr;
|
mCurrentDT = nullptr;
|
||||||
}
|
}
|
||||||
mDrawTargets.Remove(aRefPtr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SetCurrentDrawTarget(ReferencePtr aRefPtr) final {
|
bool SetCurrentDrawTarget(ReferencePtr aRefPtr) final {
|
||||||
|
|||||||
Reference in New Issue
Block a user