mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49: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;
|
HLOCKEDRGN lockedHandle;
|
||||||
auto rgn = s_rgntable.Lock(handle, &lockedHandle, 0);
|
auto rgn = s_rgntable.Lock(handle, &lockedHandle, 0);
|
||||||
|
if (!rgn) return;
|
||||||
|
|
||||||
if (rgn) {
|
|
||||||
if (combineMode == SRGN_OR || combineMode == SRGN_PARAMONLY) {
|
if (combineMode == SRGN_OR || combineMode == SRGN_PARAMONLY) {
|
||||||
if (!IsNullRect(rect)) {
|
if (!IsNullRect(rect)) {
|
||||||
rgn->sequence++;
|
rgn->sequence++;
|
||||||
|
|
@ -308,8 +308,6 @@ void SRgnCombineRectf(HSRGN handle, RECTF* rect, void* param, int32_t combineMod
|
||||||
}
|
}
|
||||||
|
|
||||||
InvalidateRegion(rgn);
|
InvalidateRegion(rgn);
|
||||||
}
|
|
||||||
|
|
||||||
s_rgntable.Unlock(lockedHandle);
|
s_rgntable.Unlock(lockedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -385,11 +383,7 @@ void SRgnGetBoundingRectf(HSRGN handle, RECTF* rect) {
|
||||||
|
|
||||||
HLOCKEDRGN lockedHandle;
|
HLOCKEDRGN lockedHandle;
|
||||||
auto rgn = s_rgntable.Lock(handle, &lockedHandle, 0);
|
auto rgn = s_rgntable.Lock(handle, &lockedHandle, 0);
|
||||||
|
if (!rgn) return;
|
||||||
if (!rgn) {
|
|
||||||
s_rgntable.Unlock(lockedHandle);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < rgn->source.Count(); i++) {
|
for (uint32_t i = 0; i < rgn->source.Count(); i++) {
|
||||||
auto source = &rgn->source[i];
|
auto source = &rgn->source[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue