I have a strange problem with NSView support with layer support and its siblings, some of them do not display correctly when they are added to an existing view hierarchy attached to a rotated supervisor. See below for details.
Problem
- NSScrollView (layer can be here) - NSClipView (or here) - Document View (or even here) - Some *rotated* subview - { Problematic sublings }
So, the hierarchy itself is quite simple and widespread: scrollview with some document, document previews represent some content. In my case, this is graphic content, and it can be rotated. Rotated views can have several additional views - various markers, control points, etc., And where I encounter unusual problems with skewed graphics when I use CALayer for an external server: 
Camera images are displayed separately, they are not part of this tree of views, pay attention to the markers and buttons.
As you can see in the image, I have several test views with subviews (just random buttons). The object on the right is displayed correctly, always. According to my tests, every NSView with frameRotation between [0, pi/2] displays OK. The object on the left is blurry, it looks like the cache buffer for this element is too small. This happens when frameRotation is in the range [pi/2, pi] .
The strangest thing
This problem does not occur with real-time rotation. That is, if I just changed the frameRoation of the settings hierarchy, with each subzone in it, everything works fine. However, when reinforcement is added to an already rotated object - it bypasses and gives this blurry look.
In my application, a special preview appears when the user clicks on the element, that "the moment when the brother is added to the supervisor.
It looks like the back-end layer has some caching buffer for subviews, and some of them are calculated with the wrong size when the root view is rotated.
How is it implemented and what have I tried
- The views are pretty simple and standard, I tried to click
[view setWantsLayer:YES] on the root views of the hierarchy: view scroll, view clip, view document, each result was the same. no manual layers, no level hosts. - Content views, brothers and sisters, and virtually the entire presentation tree (except for the views mentioned above) do not have layers. Although, I tried to include layers for various elements without any success.
- I tried to force update (setNeedsDisplay) background layer with no luck
- Reinstalling the layer works completely, but is far behind.
Decision?
This is a question, actually. Has anyone encountered such a problem? Perhaps someone knows how to make the layer flush all caches and completely update? So far, I have only had two solutions: either completely remove the layers (it works, but all the blades), or reinstall the layer that calls setWantsLayer:NO , followed by setWantsLayer:YES . It has terrible performance.