I have custom NSView
class which I am porting from OpenGL to Metal for GPU rendering. A lot of places in the code, earlier we used to call setNeedsDisplayInRect
with an invalidated rect on the NSView
, which I queried during the call to drawRect
for rendering final content to the screen.
For moving to Metal, I have added a CAMetalLayer
to my custom NSView
class. With the addition of this CAMetalLayer
, getRectsBeingDrawn
returns NULL
.
- Are we saying that
getRectsBeingDrawn
only works for non-layer/non-metal layer backed NSViews?
Moreover, I also see a setNeedsDisplayInRect
in CALayer
, but I don't see a getter like getRectsBeingDrawn
in CALayer
.
- Should I move to
setNeedsDisplayInRect
inCALayer
for dirty rects in case of layer backed views? But, then again how do I retrieve those dirty rects?