title: View.invalidate() is extremely slow. Alternatives?
body: <p>I'm doing some bitmap animation in native code, so I need to redraw the ImageView every frame:</p>
  
  <pre><code>class MyImageView extends ImageView
  {
      ...
  
      protected void onDraw( Canvas canvas )
      {
          native_drawStuff( handle, canvas );
          invalidate();
      }
  }
  </code></pre>
  
  <p>Seems all well and good, except that Traceview shows this:</p>
  
  <p><img src="https://i.stack.imgur.com/DAzKB.png" alt="enter image description here"></p>
  
  <p>I don't know about you, but that seems kind of absurd. native_drawStuff() is setting every pixel of a bitmap then drawing the bitmap to the canvas, and a simple invalidate() call takes almost <strong>4 times longer</strong> than that? The bitmaps aren't small either (RGBA_8888 and anywhere from 50k to 300k pixels).</p>
  
  <p>Given my need to redraw the entire ImageView every frame, is there a better way to do this? The only advice on this that I've seen is to only invalidate the part of the view that you need to redraw, but in my case that's the entire thing anyway.</p>