title: Why am I getting such bad render glitches using custom paint on Android?
body: <p>I'm trying to implements Rings that are similar to the Apple Watch rings. I'm drawing these rings as arcs using Canvas and a CustomPaint widget.</p>
  
  <pre><code>canvas.drawArc(
    Rect.fromCircle(
        center: Offset(size.width / 2, size.height / 2), radius: radius - 10),
    -pi / 2,
    completion,
    false,
    Paint()
      ..style = PaintingStyle.stroke
      ..strokeWidth = 20
      ..color = color
      ..strokeCap = StrokeCap.round,
  </code></pre>
  
  <p>The rings look like this:
  <a href="https://i.stack.imgur.com/TKPP7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TKPP7.png" alt="enter image description here"></a></p>
  
  <p>I have a stateful widget that I'm using to increment the rings. This works perfectly fine.</p>
  
  <p>However, I also have a background to the rings that is also drawn using Canvas which consists of arcs, circles, shadows and custom paths. I'm
  using a Stack widget to put one on top of the other:</p>
  
  <pre><code>Stack(children: &lt;Widget&gt;[
        RingsBackground(),
        CustomPaint(
          size: Size(300, 300),
          painter: CirclePainter(streak: streak),
        ),
      ])
  </code></pre>
  
  <p>When I do this and increment and complete some of the circles, I'm getting really bad rendering glitches but only on Android and not on iOS. Interestingly if I close my app on android and reopen it (or switch to another app and switch back) it works fine. This is what the glitch looks like.</p>
  
  <p><a href="https://i.stack.imgur.com/0okgG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0okgG.jpg" alt="enter image description here"></a></p>
  
  <p>Does anyone know how to fix this or create a workaround? Have I made a mistake?</p>