osx - Layer-backed NSView rotation and skewed siblings -
i have unusual issue layer-backed nsview , it's siblings, of them not rendered correctly when added existing view hierarchy attached rotated superview. below details.
the problem- nsscrollview (layer can here) - nsclipview (or here) - document view (or here) - *rotated* subview - { problematic sublings }
so, hierarchy rather simple , common: scrollview document, document subviews represent content. in case it's graphics content , can rotated. rotated views can have additional subviews - various markers, command points , on , that's face unusual issues skewed graphics 1 time utilize calayer back-end:
camera pictures rendered separately, not part of view tree, pay attending markers , buttons.
as can see on image, have test views subviews (just random buttons). object on right rendered correctly, always. according tests, each , every nsview framerotation between [0, pi/2]
renders ok. object on left rendered blurry, looks caching buffer item small. happens when framerotation in [pi/2, pi]
range.
this issue doesn't happen in "real-time rotation". i.e. if alter frameroation of set-up hierarchy, each subview on it's place, works fine. however, when subling added rotated object - bugs , gives blurred look.
in application special subview appear when user clicks on item, that' moment when sibling added superview.
it seems back-end layer has caching buffer subviews , of them computed wrong size when root view rotated.
how implemented , have tried the views quite simple , standard, have tried force[view setwantslayer:yes]
root views of hierarchy: scroll view, clip view, document view, each tme result same. no hand-made layers, no layer hosts. content views, siblings , whole views tree (except of views mentioned above) have no layers. although, have tried turn layers on various item without success. i have tried forcefulness update (setneedsdisplay) back-end layer no luck re-setting layer seems working, lags hard. the solution? that's question, actually. has faced such issue? of maybe knows way forcefulness layer drop caches , renew completely? far have 2 solutions: either drop layers (works, turns of eye-candy well), or re-set layer calling setwantslayer:no
followed setwantslayer:yes
. 1 has terrible performance.
you've written tried "setneedsdisplay". calling method main thread? in 1 of applications nil happened if called setneedsdisplay thread. if want create sure display invalid, utilize dispatch so:
dispatch_async(dispatch_get_main_queue(), ^{ [view setneedsdisplay:yes]; });
additionally have in ib inspector. layer backed views don't beingness mixed non layer backed views. create sure, in "view effects inspector" layer back upwards turned on subviews of root layer.
(in programme nsbuttons vanished if layer back upwards turned off)
osx cocoa calayer nsview
No comments:
Post a Comment