title: CALayer cornerRadius + masksToBounds 10.11 glitch?
body: <p>I have a 30x30 view which is rounded:</p>
  
  <pre><code>CALayer * layer = self.layer;
  layer.backgroundColor = [NSColor redColor].CGColor;
  layer.cornerRadius = 10.0f;
  layer.masksToBounds = YES;
  </code></pre>
  
  <p>So far, so good: <a href="https://i.stack.imgur.com/V4V15.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V4V15.png" alt="enter image description here"></a></p>
  
  <p>Then I add a sublayer, like so:</p>
  
  <pre><code>CALayer * subLayer = [CALayer layer];
  subLayer.backgroundColor = [NSColor yellowColor].CGColor;
  subLayer.frame = CGRectMake(0.0f, 0.0f, 10.0f, 10.0f);
  [layer addSublayer:subLayer];
  </code></pre>
  
  <p>And I end up with this, which is not what I want! <a href="https://i.stack.imgur.com/oGWqp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oGWqp.png" alt="enter image description here"></a></p>
  
  <p>This is a problem that has only surfaced since my upgrade to El Capitan.  In Yosemite the masking worked for the above code.  What am I missing?</p>
  
  <p><em>Update</em>: this issue does not occur when I set <code>layer.shouldRasterize = YES;</code> however I want to keep memory down so I would prefer another solution.</p>