mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
Direct2D: Avoid applying pending clip list in excludeClipRectangle unless the transform is non-trivial
Frequently, excludeClipRectangle will be called several times in a row, in order to trim away borders on each side of a rectangle. When this happens, we want to avoid creating geometric clip layers which exclude only two or three of the borders, and instead wait until all borders have been excluded before applying the clip list. This way, it may be possible to simplify the clip list to a single rectangle, which can be implemented using the faster axis-aligned clipping layer.
This commit is contained in:
parent
b0bd58c5e6
commit
6402641d49
1 changed files with 2 additions and 2 deletions
|
|
@ -1000,8 +1000,6 @@ void Direct2DGraphicsContext::excludeClipRectangle (const Rectangle<int>& userSp
|
|||
{
|
||||
JUCE_SCOPED_TRACE_EVENT_FRAME_RECT_I32 (etw::excludeClipRectangle, etw::direct2dKeyword, getFrameId(), userSpaceExcludedRectangle)
|
||||
|
||||
applyPendingClipList();
|
||||
|
||||
auto& transform = currentState->currentTransform;
|
||||
auto& deviceSpaceClipList = currentState->deviceSpaceClipList;
|
||||
const auto frameSize = getPimpl()->getFrameSize().toFloat();
|
||||
|
|
@ -1030,6 +1028,8 @@ void Direct2DGraphicsContext::excludeClipRectangle (const Rectangle<int>& userSp
|
|||
}
|
||||
else
|
||||
{
|
||||
applyPendingClipList();
|
||||
|
||||
deviceSpaceClipList = frameSize;
|
||||
pendingClipList.subtract (userSpaceExcludedRectangle.toFloat());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue