title: Cocoa Layer-Backed Views: When can I NOT enable layer-backing on a window content view?
body: <p>This line appears in Apple's Core Animation docs (link: <a href="https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/SettingUpLayerObjects/SettingUpLayerObjects.html#//apple_ref/doc/uid/TP40004514-CH13-SW5" rel="nofollow noreferrer">https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/SettingUpLayerObjects/SettingUpLayerObjects.html#//apple_ref/doc/uid/TP40004514-CH13-SW5</a>)</p>
  <pre><code>It is recommended that you enable layer support in the content view 
  of your window whenever possible.
  </code></pre>
  <p>My question is: <strong>When can I NOT do that safely?</strong></p>
  <h3>Explanation:</h3>
  <p>I've got a few buttons in my UI that I want to animate (rotate) using Core Animation. To do that, they need to be layer-backed. Right now, I've got <em>just</em> the buttons layer-backed and the rest of my views are not. This is working fine. However, Apple does not elaborate on the sentence above, so I'm worried that the animations may break in future releases because the parent views are not layer-backed.</p>
  <p>There are two reasons I do not want to layer-back my entire view hierarchy:</p>
  <ol>
  <li>It increases my memory footprint by roughly 230%.</li>
  <li>It causes LOTS of minor glitches (especially since I do a lot of custom drawing).</li>
  </ol>
  <p>So, is it safe to enable layer-backing for just a few buttons here and there and NOT enable it for the whole view hierarchy, or am I flirting with disaster? Thanks!</p>