diff --git a/modules/juce_audio_devices/native/juce_ios_Audio.cpp b/modules/juce_audio_devices/native/juce_ios_Audio.cpp index 0ca0ce09e7..fb560b57c2 100644 --- a/modules/juce_audio_devices/native/juce_ios_Audio.cpp +++ b/modules/juce_audio_devices/native/juce_ios_Audio.cpp @@ -217,7 +217,7 @@ private: { OSStatus err = noErr; - if (audioInputIsAvailable) + if (audioInputIsAvailable && numInputChannels > 0) err = AudioUnitRender (audioUnit, flags, time, 1, numFrames, data); const ScopedLock sl (callbackLock); diff --git a/modules/juce_cryptography/encryption/juce_Primes.cpp b/modules/juce_cryptography/encryption/juce_Primes.cpp index 2802b535ea..fbb5ce80c6 100644 --- a/modules/juce_cryptography/encryption/juce_Primes.cpp +++ b/modules/juce_cryptography/encryption/juce_Primes.cpp @@ -71,7 +71,7 @@ namespace PrimesHelpers i = (i - 1) >> 1; - while (i < numBits) + while (i < (unsigned int) numBits) { result.setBit ((int) i); i += prime; diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 96e92627b1..46bfb14a0c 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -281,8 +281,6 @@ public: const RectangleList& maskedRegion, const uint8 updateLayeredWindowAlpha) noexcept { - static HDRAWDIB hdd = createDrawDIB(); - SetMapMode (dc, MM_TEXT); if (transparent) @@ -327,20 +325,11 @@ public: } } - if (hdd == 0) - { - StretchDIBits (dc, - x, y, width, height, - 0, 0, width, height, - bitmapData, (const BITMAPINFO*) &bitmapInfo, - DIB_RGB_COLORS, SRCCOPY); - } - else - { - DrawDibDraw (hdd, dc, x, y, -1, -1, - (BITMAPINFOHEADER*) &bitmapInfo, bitmapData, - 0, 0, width, height, 0); - } + StretchDIBits (dc, + x, y, width, height, + 0, 0, width, height, + bitmapData, (const BITMAPINFO*) &bitmapInfo, + DIB_RGB_COLORS, SRCCOPY); if (! maskedRegion.isEmpty()) RestoreDC (dc, savedDC); @@ -357,16 +346,6 @@ public: private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WindowsBitmapImage); - - static HDRAWDIB createDrawDIB() noexcept - { - HDC dc = GetDC (0); - const int n = GetDeviceCaps (dc, BITSPIXEL); - ReleaseDC (0, dc); - - // only open if we're not palettised - return n > 8 ? DrawDibOpen() : 0; - } }; //============================================================================== @@ -1052,7 +1031,8 @@ private: Image& getImage (const bool transparent, const int w, const int h) { - const Image::PixelFormat format = transparent ? Image::ARGB : Image::RGB; + static bool alwaysUseARGB = isGraphicsCard32Bit(); // NB: for 32-bit cards, it's faster to use a 32-bit image. + const Image::PixelFormat format = (transparent || alwaysUseARGB) ? Image::ARGB : Image::RGB; if ((! image.isValid()) || image.getWidth() < w || image.getHeight() < h || image.getFormat() != format) image = Image (new WindowsBitmapImage (format, (w + 31) & ~31, (h + 31) & ~31, false)); @@ -1070,6 +1050,14 @@ private: private: Image image; + static bool isGraphicsCard32Bit() + { + HDC dc = GetDC (0); + const int bitsPerPixel = GetDeviceCaps (dc, BITSPIXEL); + ReleaseDC (0, dc); + return bitsPerPixel > 24; + } + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TemporaryImage); };