Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 686108
Collapse All | Expand All

(-)file_not_specified_in_diff (-74 / +6 lines)
Line  Link Here
0
-- a/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
0
++ b/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
Lines 109-127 Link Here
109
    forcedinline uint8 getGreen() const noexcept      { return components.g; }
109
    forcedinline uint8 getGreen() const noexcept      { return components.g; }
110
    forcedinline uint8 getBlue() const noexcept       { return components.b; }
110
    forcedinline uint8 getBlue() const noexcept       { return components.b; }
111
111
112
   #if JUCE_GCC
113
    // NB these are here as a workaround because GCC refuses to bind to packed values.
114
    forcedinline uint8& getAlpha() noexcept           { return comps [indexA]; }
115
    forcedinline uint8& getRed() noexcept             { return comps [indexR]; }
116
    forcedinline uint8& getGreen() noexcept           { return comps [indexG]; }
117
    forcedinline uint8& getBlue() noexcept            { return comps [indexB]; }
118
   #else
119
    forcedinline uint8& getAlpha() noexcept           { return components.a; }
120
    forcedinline uint8& getRed() noexcept             { return components.r; }
121
    forcedinline uint8& getGreen() noexcept           { return components.g; }
122
    forcedinline uint8& getBlue() noexcept            { return components.b; }
123
   #endif
124
125
    //==============================================================================
112
    //==============================================================================
126
    /** Copies another pixel colour over this one.
113
    /** Copies another pixel colour over this one.
127
114
Lines 340-348 Link Here
340
    {
327
    {
341
        uint32 internal;
328
        uint32 internal;
342
        Components components;
329
        Components components;
343
       #if JUCE_GCC
344
        uint8 comps[4];  // helper struct needed because gcc does not allow references to packed union members
345
       #endif
346
    };
330
    };
347
}
331
}
348
#ifndef DOXYGEN
332
#ifndef DOXYGEN
Lines 429-438 Link Here
429
    forcedinline uint8 getGreen() const noexcept    { return g; }
413
    forcedinline uint8 getGreen() const noexcept    { return g; }
430
    forcedinline uint8 getBlue() const noexcept     { return b; }
414
    forcedinline uint8 getBlue() const noexcept     { return b; }
431
415
432
    forcedinline uint8& getRed() noexcept           { return r; }
433
    forcedinline uint8& getGreen() noexcept         { return g; }
434
    forcedinline uint8& getBlue() noexcept          { return b; }
435
436
    //==============================================================================
416
    //==============================================================================
437
    /** Copies another pixel colour over this one.
417
    /** Copies another pixel colour over this one.
438
418
Lines 646-653 Link Here
646
626
647
    //==============================================================================
627
    //==============================================================================
648
    forcedinline uint8 getAlpha() const noexcept    { return a; }
628
    forcedinline uint8 getAlpha() const noexcept    { return a; }
649
    forcedinline uint8& getAlpha() noexcept         { return a; }
650
651
    forcedinline uint8 getRed() const noexcept      { return 0; }
629
    forcedinline uint8 getRed() const noexcept      { return 0; }
652
    forcedinline uint8 getGreen() const noexcept    { return 0; }
630
    forcedinline uint8 getGreen() const noexcept    { return 0; }
653
    forcedinline uint8 getBlue() const noexcept     { return 0; }
631
    forcedinline uint8 getBlue() const noexcept     { return 0; }
654
-- a/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
632
++ b/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
Lines 581-598 Link Here
581
            : destData (image), sourceColour (colour)
581
            : destData (image), sourceColour (colour)
582
        {
582
        {
583
            if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType))
583
            if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType))
584
            {
585
                areRGBComponentsEqual = sourceColour.getRed() == sourceColour.getGreen()
584
                areRGBComponentsEqual = sourceColour.getRed() == sourceColour.getGreen()
586
                                            && sourceColour.getGreen() == sourceColour.getBlue();
585
                                            && sourceColour.getGreen() == sourceColour.getBlue();
587
                filler[0].set (sourceColour);
588
                filler[1].set (sourceColour);
589
                filler[2].set (sourceColour);
590
                filler[3].set (sourceColour);
591
            }
592
            else
586
            else
593
            {
594
                areRGBComponentsEqual = false;
587
                areRGBComponentsEqual = false;
595
            }
596
        }
588
        }
597
589
598
        forcedinline void setEdgeTableYPos (const int y) noexcept
590
        forcedinline void setEdgeTableYPos (const int y) noexcept
Lines 643-649 Link Here
643
        const Image::BitmapData& destData;
635
        const Image::BitmapData& destData;
644
        PixelType* linePixels;
636
        PixelType* linePixels;
645
        PixelARGB sourceColour;
637
        PixelARGB sourceColour;
646
        PixelRGB filler [4];
647
        bool areRGBComponentsEqual;
638
        bool areRGBComponentsEqual;
648
639
649
        forcedinline PixelType* getPixel (const int x) const noexcept
640
        forcedinline PixelType* getPixel (const int x) const noexcept
Lines 658-704 Link Here
658
649
659
        forcedinline void replaceLine (PixelRGB* dest, const PixelARGB colour, int width) const noexcept
650
        forcedinline void replaceLine (PixelRGB* dest, const PixelARGB colour, int width) const noexcept
660
        {
651
        {
661
            if (destData.pixelStride == sizeof (*dest))
652
            if ((size_t) destData.pixelStride == sizeof (*dest) && areRGBComponentsEqual)
662
            {
653
                memset ((void*) dest, colour.getRed(), (size_t) width * 3);   // if all the component values are the same, we can cheat..
663
                if (areRGBComponentsEqual)  // if all the component values are the same, we can cheat..
654
            else
664
                {
655
                JUCE_PERFORM_PIXEL_OP_LOOP (set (colour));
665
                    memset (dest, colour.getRed(), (size_t) width * 3);
666
                }
667
                else
668
                {
669
                    if (width >> 5)
670
                    {
671
                        const int* const intFiller = reinterpret_cast<const int*> (filler);
672
673
                        while (width > 8 && (((pointer_sized_int) dest) & 7) != 0)
674
                        {
675
                            dest->set (colour);
676
                            ++dest;
677
                            --width;
678
                        }
679
680
                        while (width > 4)
681
                        {
682
                            int* d = reinterpret_cast<int*> (dest);
683
                            *d++ = intFiller[0];
684
                            *d++ = intFiller[1];
685
                            *d++ = intFiller[2];
686
                            dest = reinterpret_cast<PixelRGB*> (d);
687
                            width -= 4;
688
                        }
689
                    }
690
691
                    while (--width >= 0)
692
                    {
693
                        dest->set (colour);
694
                        ++dest;
695
                    }
696
                }
697
            }
698
            else
699
            {
700
                JUCE_PERFORM_PIXEL_OP_LOOP (set (colour))
701
            }
702
        }
656
        }
703
657
704
        forcedinline void replaceLine (PixelAlpha* dest, const PixelARGB colour, int width) const noexcept
658
        forcedinline void replaceLine (PixelAlpha* dest, const PixelARGB colour, int width) const noexcept

Return to bug 686108