Bug 1850727 - Only clear last clip mask when destroying clip mask. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D187366
This commit is contained in:
Lee Salzman 2023-09-04 17:39:16 +00:00
parent e4a95dc345
commit 3ebedffae0
2 changed files with 6 additions and 3 deletions

View File

@ -194,9 +194,11 @@ static Atomic<int64_t> sDrawTargetWebglCount(0);
DrawTargetWebgl::DrawTargetWebgl() { sDrawTargetWebglCount++; }
inline void DrawTargetWebgl::SharedContext::ClearLastTexture() {
inline void DrawTargetWebgl::SharedContext::ClearLastTexture(bool aFullClear) {
mLastTexture = nullptr;
mLastClipMask = nullptr;
if (aFullClear) {
mLastClipMask = nullptr;
}
}
// Attempts to clear the snapshot state. If the snapshot is only referenced by
@ -239,6 +241,7 @@ DrawTargetWebgl::~DrawTargetWebgl() {
child->DeallocShmem(mShmem);
}
}
mSharedContext->ClearLastTexture(true);
if (mClipMask) {
mSharedContext->mWebgl->DeleteTexture(mClipMask);
}

View File

@ -301,7 +301,7 @@ class DrawTargetWebgl : public DrawTarget, public SupportsWeakPtr {
// Reset the current target.
void ClearTarget() { mCurrentTarget = nullptr; }
// Reset the last used texture to force binding next use.
void ClearLastTexture();
void ClearLastTexture(bool aFullClear = false);
bool SupportsPattern(const Pattern& aPattern);