title: canvas.clipPath() not working even after disabling harware acceleration
body: <p>I have drawn a circle filled with black color in the canvas and I have set the background color of the canvas to red. </p>
  
  <p>I want only the circle which is black color to appear as my view but I get the red color as well.</p>
  
  <p>I tried using canvas.clipPath() it dint work. I searched the net and found out we need to disable hardware acceleration to get it work. I tried that but it still dint work.</p>
  
  <p>Tried disabling the Hardware Acceleration for particular view:</p>
  
  <pre><code>view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
  </code></pre>
  
  <p>And also to whole application:</p>
  
  <pre><code>android:hardwareAccelerated="false"
  </code></pre>
  
  <p>Dint work in both the cases.
  Any ideas on how to make it work ?</p>
  
  <p><img src="https://i.stack.imgur.com/pvtLu.png" alt="enter image description here"></p>
  
  <p>Code:</p>
  
  <p>And here I am clipping </p>
  
  <pre><code>    @Override
  protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
      this.canvas = canvas;
      path.reset();
      left = 50;
      top = 50;
      right = getWidth()- 50;
      bottom = getHeight()-50;
  
  
  
      RectF rectf = new RectF(left, top, right, bottom);
      path.arcTo(rectf, startAngle, sweepAngle);
      path.lineTo(linex, liney);
  
      canvas.clipPath(path);
      canvas.drawPath(path, paint);
  
      //canvas.restore();
  }
  </code></pre>