title: Android canvas drawbitmap xfermode clear is drawing rectangle instead of bitmap
body: <p>I'm making an app in Android using Kotlin. I have a layout that display a mask of a face shape. This is what I want to achieve:</p>
  <p><a href="https://i.stack.imgur.com/GBYwY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GBYwY.png" alt="target" /></a></p>
  <p>This is my result right now:</p>
  <p><a href="https://i.stack.imgur.com/rBJXJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rBJXJ.jpg" alt="result" /></a></p>
  <p>In my code, I have a view which define a black background. This is the onDraw method that I override:</p>
  <pre><code>override fun onDraw(canvas: Canvas?) {
  
      if(canvas != null) {
          val bitmap = mDrawable!!.toBitmap()
          val marginV = 64
  
          val left = mDrawable!!.left.toFloat()
          val top = mDrawable!!.top.toFloat() + marginV
  
          val paint = Paint(Paint.ANTI_ALIAS_FLAG)
          paint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_IN)
  
          // draw hole
          canvas.drawBitmap(bitmap, left, top, paint)
          // draw shape
          canvas.drawBitmap(bitmap, left, top, null)
      }
  
      super.onDraw(canvas)
  }
  </code></pre>
  <p>I really don't know what is the problem here. I already made something similar using a rectangle instead of a bitmap and it works well.</p>
  <p>Maybe the problem is my vector drawable ?</p>