Skip to content

What does one replace NSCopyBits with? #88

@jpetrie

Description

@jpetrie

I've been working on cleaning up all the deprecation warnings in MacVim itself (that is, excluding the PSMTabBarControl library as that appears to be a third-party thing). I've gotten rid of all of them except this last one involving the deprecation of NCCopyBits.

NSCopyBits was marked deprecated in 10.10; it does not have a "use X instead" note associated with it. In fact, the comment next to the function in the header asserts that "this function does nothing," so you'd think this would be an easy fix.

But the comment is wrong; removing the NSCopyBits call completely hoses rendering in MacVim as soon as the window starts to scroll.

I'm somewhat at a loss for how to deal with this function; it appears that we're using it to shift the whole view up and down by one row's worth of pixels, but there isn't a simple analogue in Core Graphics that I've found yet, and as our current CGContext at the time isn't a bitmap context, getting a CGImage out of it is a bit expensive/difficult.

So I am hoping somebody with more modern Core Graphics experience can help me figure out how to deal with this warning.

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