title: Drawing UIImage on CGContext doesn't show up
body: <p>I'm having a custom NSLayoutManager and I want to draw a blurred rectangle over a word. I'm trying just to draw a red rectangle right now and it doesn't draw anything. I need to do this in an image because on the image you can apply gaussianblur. The image is not nil so that's not the problem.</p>
  
  <p>Drawing code</p>
  
  <pre><code>    guard let context = UIGraphicsGetCurrentContext() else {
          return
      }
  
      UIGraphicsBeginImageContext(blurRect.size);
      let renderer = UIGraphicsImageRenderer(size: blurRect.size)
      let image = renderer.image { ctx in
          ctx.cgContext.setFillColor(UIColor.red.cgColor)
          ctx.cgContext.setStrokeColor(UIColor.black.cgColor)
          ctx.cgContext.setLineWidth(10)
          ctx.cgContext.addRect(blurRect)
          ctx.cgContext.drawPath(using: .fillStroke)
      }
      UIGraphicsEndImageContext()
  
      image.draw(in: blurRect)
      context.draw(image.cgImage!, in: blurRect)
  </code></pre>
  
  <p>I call this code in this method:</p>
  
  <pre><code>override func drawGlyphs(forGlyphRange glyphsToShow: NSRange, at origin: CGPoint) {
  </code></pre>