helm-0.9.0-gcc91.patch 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. From cb611a80bd5a36d31bfc31212ebbf79aa86c6f08 Mon Sep 17 00:00:00 2001
  2. From: jikstra <jikstra@disroot.org>
  3. Date: Tue, 20 Aug 2019 03:00:51 +0200
  4. Subject: [PATCH] Backport
  5. https://github.com/WeAreROLI/JUCE/commit/4e0adb2af8b424c43d22bd431011c9a6c57d36b6
  6. to the bundled JUCE framework to make helm compile on gcc 9.1 again
  7. ---
  8. .../juce_graphics/colour/juce_PixelFormats.h | 25 +---------
  9. .../native/juce_RenderingHelpers.h | 48 +------------------
  10. 2 files changed, 4 insertions(+), 69 deletions(-)
  11. diff --git a/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h b/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
  12. index 9be9ba09c..3535eab80 100644
  13. --- a/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
  14. +++ b/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
  15. @@ -105,23 +105,9 @@ class JUCE_API PixelARGB
  16. //==============================================================================
  17. forcedinline uint8 getAlpha() const noexcept { return components.a; }
  18. - forcedinline uint8 getRed() const noexcept { return components.r; }
  19. + forcedinline uint8 getRed() const noexcept { return components.r; }
  20. forcedinline uint8 getGreen() const noexcept { return components.g; }
  21. - forcedinline uint8 getBlue() const noexcept { return components.b; }
  22. -
  23. - #if JUCE_GCC
  24. - // NB these are here as a workaround because GCC refuses to bind to packed values.
  25. - forcedinline uint8& getAlpha() noexcept { return comps [indexA]; }
  26. - forcedinline uint8& getRed() noexcept { return comps [indexR]; }
  27. - forcedinline uint8& getGreen() noexcept { return comps [indexG]; }
  28. - forcedinline uint8& getBlue() noexcept { return comps [indexB]; }
  29. - #else
  30. - forcedinline uint8& getAlpha() noexcept { return components.a; }
  31. - forcedinline uint8& getRed() noexcept { return components.r; }
  32. - forcedinline uint8& getGreen() noexcept { return components.g; }
  33. - forcedinline uint8& getBlue() noexcept { return components.b; }
  34. - #endif
  35. -
  36. + forcedinline uint8 getBlue() const noexcept { return components.b; }
  37. //==============================================================================
  38. /** Copies another pixel colour over this one.
  39. @@ -340,9 +326,6 @@ class JUCE_API PixelARGB
  40. {
  41. uint32 internal;
  42. Components components;
  43. - #if JUCE_GCC
  44. - uint8 comps[4]; // helper struct needed because gcc does not allow references to packed union members
  45. - #endif
  46. };
  47. }
  48. #ifndef DOXYGEN
  49. @@ -429,10 +412,6 @@ class JUCE_API PixelRGB
  50. forcedinline uint8 getGreen() const noexcept { return g; }
  51. forcedinline uint8 getBlue() const noexcept { return b; }
  52. - forcedinline uint8& getRed() noexcept { return r; }
  53. - forcedinline uint8& getGreen() noexcept { return g; }
  54. - forcedinline uint8& getBlue() noexcept { return b; }
  55. -
  56. //==============================================================================
  57. /** Copies another pixel colour over this one.
  58. diff --git a/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h b/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
  59. index 1c4cd31ef..29519cb5a 100644
  60. --- a/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
  61. +++ b/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
  62. @@ -581,18 +581,10 @@ namespace EdgeTableFillers
  63. : destData (image), sourceColour (colour)
  64. {
  65. if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType))
  66. - {
  67. areRGBComponentsEqual = sourceColour.getRed() == sourceColour.getGreen()
  68. && sourceColour.getGreen() == sourceColour.getBlue();
  69. - filler[0].set (sourceColour);
  70. - filler[1].set (sourceColour);
  71. - filler[2].set (sourceColour);
  72. - filler[3].set (sourceColour);
  73. - }
  74. else
  75. - {
  76. areRGBComponentsEqual = false;
  77. - }
  78. }
  79. forcedinline void setEdgeTableYPos (const int y) noexcept
  80. @@ -643,7 +635,6 @@ namespace EdgeTableFillers
  81. const Image::BitmapData& destData;
  82. PixelType* linePixels;
  83. PixelARGB sourceColour;
  84. - PixelRGB filler [4];
  85. bool areRGBComponentsEqual;
  86. forcedinline PixelType* getPixel (const int x) const noexcept
  87. @@ -658,43 +649,8 @@ namespace EdgeTableFillers
  88. forcedinline void replaceLine (PixelRGB* dest, const PixelARGB colour, int width) const noexcept
  89. {
  90. - if (destData.pixelStride == sizeof (*dest))
  91. - {
  92. - if (areRGBComponentsEqual) // if all the component values are the same, we can cheat..
  93. - {
  94. - memset (dest, colour.getRed(), (size_t) width * 3);
  95. - }
  96. - else
  97. - {
  98. - if (width >> 5)
  99. - {
  100. - const int* const intFiller = reinterpret_cast<const int*> (filler);
  101. -
  102. - while (width > 8 && (((pointer_sized_int) dest) & 7) != 0)
  103. - {
  104. - dest->set (colour);
  105. - ++dest;
  106. - --width;
  107. - }
  108. -
  109. - while (width > 4)
  110. - {
  111. - int* d = reinterpret_cast<int*> (dest);
  112. - *d++ = intFiller[0];
  113. - *d++ = intFiller[1];
  114. - *d++ = intFiller[2];
  115. - dest = reinterpret_cast<PixelRGB*> (d);
  116. - width -= 4;
  117. - }
  118. - }
  119. -
  120. - while (--width >= 0)
  121. - {
  122. - dest->set (colour);
  123. - ++dest;
  124. - }
  125. - }
  126. - }
  127. + if ((size_t) destData.pixelStride == sizeof (*dest) && areRGBComponentsEqual)
  128. + memset ((void*) dest, colour.getRed(), (size_t) width * 3); // if all the component values are the same, we can cheat..
  129. else
  130. {
  131. JUCE_PERFORM_PIXEL_OP_LOOP (set (colour))