Graphics constructs with an Image reference?


#1

Graphics takes an Image reference, is this a legacy hold over? Because Image objects are now reference counted handles to separately allocated implementation objects, shouldn’t imageToDrawOnto be passed by value?

juce_GraphicsContext.h

explicit Graphics (const Image& imageToDrawOnto);

#2

Not sure I understand your point…? If it passed it by value, the compiler would generate an extra unnecessary copy, which wouldn’t do any harm, but I can’t think of any reason why you’d actually want it to do that…?