title: Android Paint setShadowLayer() ignores color of its Paint
body: <p>I'm trying to create a Bitmap programmatically and am finding drawing a shadowed Rect is ignoring the color arg passed in. I've simplified things down to this case - the code just draws a rotated blue square which is supposed to have a grey shadow, but the shadow is always blue:</p>
  
  <pre><code>main.xml:
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="#fff"
      android:padding="40dp"
      &gt;
  &lt;/LinearLayout&gt;
  
  RotateRectShadowActivity.java:
  public class RotateRectShadowActivity extends Activity {
      private LinearLayout mMainLayout;
      private ImageView mImageView;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          LayoutInflater factory = LayoutInflater.from( this );
          mMainLayout = (LinearLayout) factory.inflate( R.layout.main, null );
  
          mImageView = new ImageView(this);
  
          Rect rect = new Rect(0, 0, 300, 300);
  
          Bitmap outerBm = Bitmap.createBitmap(
                  rect.width(), rect.height(), Bitmap.Config.ARGB_8888);
          Bitmap innerBm = Bitmap.createBitmap(
                  rect.width()-50, rect.height()-50, Bitmap.Config.ARGB_8888);
  
          Canvas outerCanvas = new Canvas(outerBm);
          Canvas innerCanvas = new Canvas(innerBm);
          outerCanvas.rotate(3);
  
          rect.left += 25;
          rect.top += 25;
          rect.right += 25;
          rect.bottom += 25;
  
          Paint shadowPaint = new Paint();
          shadowPaint.setShadowLayer(12, 12, 12, 0xFF555555);
          shadowPaint.setColor(0xFF555555);
  
          innerCanvas.drawRect(rect, shadowPaint);
  
          Paint rectPaint = new Paint();
          rectPaint.setColor(Color.BLUE);
          innerCanvas.drawRect(rect, rectPaint);
          outerCanvas.drawBitmap(innerBm, 0, 0, shadowPaint);
  
          mImageView.setImageBitmap(outerBm);
          mMainLayout.addView(mImageView);
          setContentView(mMainLayout);
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Boytc.png" alt="RotateRectShadow"></p>
  
  <p>I don't see why the call to outerCanvas.drawBitmap(innerBm, 0, 0, shadowPaint); needs a Paint at all, since I'm trying to draw the shadow on the innerBm itself, via innerCanvas, but when I pass null in there's no shadow at all.</p>