mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Performance increase for some software-renderer image blending ops.
This commit is contained in:
parent
2220c194a7
commit
b153a92bae
1 changed files with 18 additions and 12 deletions
|
|
@ -806,16 +806,19 @@ namespace EdgeTableFillers
|
|||
alphaLevel = (alphaLevel * extraAlpha) >> 8;
|
||||
x -= xOffset;
|
||||
|
||||
jassert (repeatPattern || (x >= 0 && x + width <= srcData.width));
|
||||
|
||||
if (alphaLevel < 0xfe)
|
||||
if (repeatPattern)
|
||||
{
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (repeatPattern ? (x++ % srcData.width) : x++), (uint32) alphaLevel))
|
||||
if (alphaLevel < 0xfe)
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++ % srcData.width), (uint32) alphaLevel))
|
||||
else
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++ % srcData.width)))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (repeatPattern)
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++ % srcData.width)))
|
||||
jassert (x >= 0 && x + width <= srcData.width);
|
||||
|
||||
if (alphaLevel < 0xfe)
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++), (uint32) alphaLevel))
|
||||
else
|
||||
copyRow (dest, getSrcPixel (x), width);
|
||||
}
|
||||
|
|
@ -826,16 +829,19 @@ namespace EdgeTableFillers
|
|||
DestPixelType* dest = getDestPixel (x);
|
||||
x -= xOffset;
|
||||
|
||||
jassert (repeatPattern || (x >= 0 && x + width <= srcData.width));
|
||||
|
||||
if (extraAlpha < 0xfe)
|
||||
if (repeatPattern)
|
||||
{
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (repeatPattern ? (x++ % srcData.width) : x++), (uint32) extraAlpha))
|
||||
if (extraAlpha < 0xfe)
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++ % srcData.width), (uint32) extraAlpha))
|
||||
else
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++ % srcData.width)))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (repeatPattern)
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++ % srcData.width)))
|
||||
jassert (x >= 0 && x + width <= srcData.width);
|
||||
|
||||
if (extraAlpha < 0xfe)
|
||||
JUCE_PERFORM_PIXEL_OP_LOOP (blend (*getSrcPixel (x++), (uint32) extraAlpha))
|
||||
else
|
||||
copyRow (dest, getSrcPixel (x), width);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue