You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some methods of CGContext accept an argument image: &CGImage. CGImage will automatically call CGImageRelease when it is dropped.
The problem is, sometimes we don't actually own the CGImage. For example, I try to obtain a sys::CGImageRef from an NSImage using CGImageForProposedRect, and draw it on some CGBitmapContext with CGContext::draw_image. As the documentation says, the caller should not release the returned value. So it should be only possible to convert the raw pointer to a&CGImageRef rather than a CGImage. Changing the argument type to &CGImageRef will make the interface more flexible.
The text was updated successfully, but these errors were encountered:
Some methods of
CGContext
accept an argumentimage: &CGImage
.CGImage
will automatically callCGImageRelease
when it is dropped.The problem is, sometimes we don't actually own the CGImage. For example, I try to obtain a
sys::CGImageRef
from an NSImage usingCGImageForProposedRect
, and draw it on someCGBitmapContext
withCGContext::draw_image
. As the documentation says, the caller should not release the returned value. So it should be only possible to convert the raw pointer to a&CGImageRef
rather than aCGImage
. Changing the argument type to&CGImageRef
will make the interface more flexible.The text was updated successfully, but these errors were encountered: