I'm on OSX and JUCE v2.1.2 and have a question regarding using large single-channel (gray scale) images as an alpha mask in the following graphics call (emphasis on the last argument "true" -> fillAlphaChannelWithCurrentBrush):
g.drawImage(image, 0, 0, w, h, sourceX, sourceY, sourceWidth, sourceHeight, true);
When I use this method with very large images at a relatively high repaint rate, I get a bas access error on a CFDataCreate call in createImage. Specifically, the call stack as a result of calling the drawImage function call is:
#4 juce::Graphics::drawImage(juce::Image const&, int, int, int, int, int, int, int, int, bool) const at juce/modules/juce_graphics/contexts/juce_GraphicsContext.cpp:674
#3 juce::Graphics::drawImageTransformed(juce::Image const&, juce::AffineTransform const&, bool) const at /juce/modules/juce_graphics/contexts/juce_GraphicsContext.cpp:689
#1 juce::CoreGraphicsImage::createImage(juce::Image const&, CGColorSpace*, bool) at /juce/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm:84
When I make this change, my bad access error is removed and I do not notice any other associated problems.
So, my question :) ...is there a reason the alpha mask image is copied (mustOutliveSource=true)? Other calls to createImage don't seem to need the copy.
Thanks and let me know if I can clarify anything!