mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-03 16:39:08 +00:00
chore(region): short circuit redundant unlock calls
This commit is contained in:
parent
83f22d53a8
commit
ff85d9138d
1 changed files with 14 additions and 20 deletions
|
|
@ -290,8 +290,8 @@ void SRgnCombineRectf(HSRGN handle, RECTF* rect, void* param, int32_t combineMod
|
|||
|
||||
HLOCKEDRGN lockedHandle;
|
||||
auto rgn = s_rgntable.Lock(handle, &lockedHandle, 0);
|
||||
if (!rgn) return;
|
||||
|
||||
if (rgn) {
|
||||
if (combineMode == SRGN_OR || combineMode == SRGN_PARAMONLY) {
|
||||
if (!IsNullRect(rect)) {
|
||||
rgn->sequence++;
|
||||
|
|
@ -308,8 +308,6 @@ void SRgnCombineRectf(HSRGN handle, RECTF* rect, void* param, int32_t combineMod
|
|||
}
|
||||
|
||||
InvalidateRegion(rgn);
|
||||
}
|
||||
|
||||
s_rgntable.Unlock(lockedHandle);
|
||||
}
|
||||
|
||||
|
|
@ -385,11 +383,7 @@ void SRgnGetBoundingRectf(HSRGN handle, RECTF* rect) {
|
|||
|
||||
HLOCKEDRGN lockedHandle;
|
||||
auto rgn = s_rgntable.Lock(handle, &lockedHandle, 0);
|
||||
|
||||
if (!rgn) {
|
||||
s_rgntable.Unlock(lockedHandle);
|
||||
return;
|
||||
}
|
||||
if (!rgn) return;
|
||||
|
||||
for (uint32_t i = 0; i < rgn->source.Count(); i++) {
|
||||
auto source = &rgn->source[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue