From fa0ab06d4158be7d1a0f2ebf74b21dbdc16d8528 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 9 Oct 2024 18:13:46 +0100 Subject: [PATCH] Direct2D: Fix performance issue caused by the entire window painting unnecessarily --- .../native/juce_Direct2DHwndContext_windows.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp index 8d9d5a7610..ee5fe35d24 100644 --- a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp @@ -170,10 +170,6 @@ private: RectangleList getPaintAreas() const override { - // Does the entire buffer need to be filled? - if (swap.state == SwapChain::State::bufferAllocated) - return swap.getSize(); - return deferredRepaints; } @@ -422,6 +418,7 @@ Image Direct2DHwndContext::createSnapshot() const void Direct2DHwndContext::clearTargetBuffer() { + applyPendingClipList(); pimpl->getDeviceContext()->Clear(); }