Skip to content

Change argument type from &CGImage to &CGImageRef #466

@gyk

Description

@gyk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions