From 72e345cdd7772540d4e7494d10f671d534726786 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 27 May 2025 14:16:29 +0100 Subject: [PATCH] Direct2DImage: Add missing data change notification when creating writable BitmapData The OpenGL renderer listens for imageDataChanged() to invalidated cached textures. Before this change, the SimpleFFTDemo would display a static (outdated) image on Windows when using the OpenGLRenderer. --- modules/juce_graphics/native/juce_Direct2DImage_windows.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_graphics/native/juce_Direct2DImage_windows.cpp b/modules/juce_graphics/native/juce_Direct2DImage_windows.cpp index 139e07dbac..1c514f03d9 100644 --- a/modules/juce_graphics/native/juce_Direct2DImage_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DImage_windows.cpp @@ -580,6 +580,8 @@ void Direct2DPixelData::moveValidatedImageSection (Point destTopLeft, Recta return; } + sendDataChangeMessage(); + Ptr staging = new Direct2DPixelData { pixelFormat, sourceRect.getWidth(), sourceRect.getHeight(), @@ -777,6 +779,8 @@ void Direct2DPixelData::initialiseBitmapData (Image::BitmapData& bitmap, if (mode == Image::BitmapData::readOnly) return; + sendDataChangeMessage(); + struct Releaser : public Image::BitmapData::BitmapDataReleaser { Releaser (std::unique_ptr wrappedIn, Ptr selfIn)