app_server: Reduce usage of the RegionPool where unnecessary.
BRegions with only 1 rectangle will use inline data and perform no allocations, so when we create a BRegion and only add one rect to it, we can just use one inline and avoid using the pool entirely at no cost (and some savings.) No functional change (intended). Change-Id: I10ac6bc7b5cf6b681641e88558a3f1ba770b6f77 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2298 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
ab319eb798
commit
0d312fea71
@ -277,12 +277,10 @@ View::AddChild(View* view)
|
|||||||
// trigger redraw
|
// trigger redraw
|
||||||
IntRect clippedFrame = view->Frame();
|
IntRect clippedFrame = view->Frame();
|
||||||
ConvertToVisibleInTopView(&clippedFrame);
|
ConvertToVisibleInTopView(&clippedFrame);
|
||||||
BRegion* dirty = fWindow->GetRegion();
|
|
||||||
if (dirty) {
|
BRegion dirty;
|
||||||
dirty->Set((clipping_rect)clippedFrame);
|
dirty.Set((clipping_rect)clippedFrame);
|
||||||
fWindow->MarkContentDirtyAsync(*dirty);
|
fWindow->MarkContentDirtyAsync(dirty);
|
||||||
fWindow->RecycleRegion(dirty);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,12 +331,10 @@ View::RemoveChild(View* view)
|
|||||||
// trigger redraw
|
// trigger redraw
|
||||||
IntRect clippedFrame = view->Frame();
|
IntRect clippedFrame = view->Frame();
|
||||||
ConvertToVisibleInTopView(&clippedFrame);
|
ConvertToVisibleInTopView(&clippedFrame);
|
||||||
BRegion* dirty = fWindow->GetRegion();
|
|
||||||
if (dirty) {
|
BRegion dirty;
|
||||||
dirty->Set((clipping_rect)clippedFrame);
|
dirty.Set((clipping_rect)clippedFrame);
|
||||||
fWindow->MarkContentDirtyAsync(*dirty);
|
fWindow->MarkContentDirtyAsync(dirty);
|
||||||
fWindow->RecycleRegion(dirty);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1282,12 +1278,10 @@ View::SetHidden(bool hidden)
|
|||||||
// trigger a redraw
|
// trigger a redraw
|
||||||
IntRect clippedBounds = Bounds();
|
IntRect clippedBounds = Bounds();
|
||||||
ConvertToVisibleInTopView(&clippedBounds);
|
ConvertToVisibleInTopView(&clippedBounds);
|
||||||
BRegion* dirty = fWindow->GetRegion();
|
|
||||||
if (!dirty)
|
BRegion dirty;
|
||||||
return;
|
dirty.Set((clipping_rect)clippedBounds);
|
||||||
dirty->Set((clipping_rect)clippedBounds);
|
fWindow->MarkContentDirty(dirty);
|
||||||
fWindow->MarkContentDirty(*dirty);
|
|
||||||
fWindow->RecycleRegion(dirty);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1532,12 +1526,9 @@ View::_ScreenClipping(BRegion* windowContentClipping, bool force) const
|
|||||||
ConvertToVisibleInTopView(&clippedBounds);
|
ConvertToVisibleInTopView(&clippedBounds);
|
||||||
if (clippedBounds.Width() < fScreenClipping.Frame().Width()
|
if (clippedBounds.Width() < fScreenClipping.Frame().Width()
|
||||||
|| clippedBounds.Height() < fScreenClipping.Frame().Height()) {
|
|| clippedBounds.Height() < fScreenClipping.Frame().Height()) {
|
||||||
BRegion* temp = fWindow->GetRegion();
|
BRegion temp;
|
||||||
if (temp) {
|
temp.Set((clipping_rect)clippedBounds);
|
||||||
temp->Set((clipping_rect)clippedBounds);
|
fScreenClipping.IntersectWith(&temp);
|
||||||
fScreenClipping.IntersectWith(temp);
|
|
||||||
fWindow->RecycleRegion(temp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fScreenClipping.IntersectWith(windowContentClipping);
|
fScreenClipping.IntersectWith(windowContentClipping);
|
||||||
|
Loading…
Reference in New Issue
Block a user