fast blitting with Quartz

  • Hi All.

    Part of this is more curiosity than anything, but I hope you will
    indulge me.

    The situation is this: I would like to have very fast on-screen
    blitting to support a scrolling-chart like drawing.

    In the old NeXTstep days of pswraps, there was this cool PostScript
    operator called "composite" that would blit bits in the current
    graphics context. So if you were doing a scrolling chart, you would
    just have to composite the 99% of stuff you already had on-screen,
    and draw the 1% of new data.

    Question 1: Does anybody know of the current Quartz equivalent for
    doing this? I image that the NSScrollView/NSClipView combination
    knows how to do this, but I have not been able to find the function
    to do it.

    Question 2: If you can no longer do this, what would be an efficient
    strategy to do this? Seems like the same could be achieved using 2
    NSImages - composite 99% from one to the other, draw the 1%,
    composite on-screen, flip, rinse, lather, repeat. But that seems high
    on both memory usage, and takes one more composite than the optimal
    version.

    Thanks for any insight into this!

    -Kenny

    P.S. If any of you remember my NeXTstep program KPerfmon, it used
    this trick.
  • On 28 Sep 2007, at 17:28, Kenny Leung wrote:

    > In the old NeXTstep days of pswraps, there was this cool PostScript
    > operator called "composite" that would blit bits in the current
    > graphics context. So if you were doing a scrolling chart, you would
    > just have to composite the 99% of stuff you already had on-screen,
    > and draw the 1% of new data.
    >
    > Question 1: Does anybody know of the current Quartz equivalent for
    > doing this? I image that the NSScrollView/NSClipView combination
    > knows how to do this, but I have not been able to find the function
    > to do it.

    You probably want NSView's -scrollRect:by:.

    Kind regards,

    Alastair.

    --
    http://alastairs-place.net
  • Yes! Exactly what I want.

    Thanks!

    -Kenny

    On Sep 28, 2007, at 12:47 PM, Alastair Houghton wrote:

    > On 28 Sep 2007, at 17:28, Kenny Leung wrote:
    >
    >> In the old NeXTstep days of pswraps, there was this cool
    >> PostScript operator called "composite" that would blit bits in the
    >> current graphics context. So if you were doing a scrolling chart,
    >> you would just have to composite the 99% of stuff you already had
    >> on-screen, and draw the 1% of new data.
    >>
    >> Question 1: Does anybody know of the current Quartz equivalent for
    >> doing this? I image that the NSScrollView/NSClipView combination
    >> knows how to do this, but I have not been able to find the
    >> function to do it.
    >
    > You probably want NSView's -scrollRect:by:.
    >
    > Kind regards,
    >
    > Alastair.
    >
    > --
    > http://alastairs-place.net
    >
    >
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today