title: Canvas returns black image on rotate
body: <p>I'm ussing <strong>OpenCV</strong>, the <a href="https://github.com/ayuso2013/face-recognition" rel="nofollow">face recognizer project example</a> one, made by Robotic Apps team, for <strong>Android</strong>, but camera is not as expected, the rotation has bugs and in order to rotate the camera view to use in Portrait orientation, we have to rotate the canvas inside of <strong>CameraBridgeViewBase</strong> <em>class</em> in the <strong>deliverAndDrawFrame</strong> <em>method</em>, i have the next canvas rotation method:</p>
  
  <pre><code>canvas.drawColor(0, android.graphics.PorterDuff.Mode.CLEAR);
  canvas.rotate(180);
  mScale = canvas.getWidth() / (float) mCacheBitmap.getHeight();
  float scale2 = canvas.getHeight() / (float) mCacheBitmap.getWidth();
  if (scale2 &gt; mScale) {
      mScale = scale2;
  }
  if (mScale != 0) {
       canvas.scale(mScale, mScale, 0, 0);
  }
  Log.d(TAG, "mStretch value: " + mScale);
  canvas.drawBitmap(mCacheBitmap, 0, -mCacheBitmap.getHeight(), null);
  // ...
  </code></pre>
  
  <p>When i use the rotate method with value 90 <strong>canvas.rotate(90);</strong> it returns the image rotated 90 degrees as expected, but when i rotate more than 90 or less than 90 like, 0, -90, 180, 270, etc. <strong>It returns a black image</strong> :(</p>
  
  <p>What's the problem with this code?</p>