title: Fatal signal 11 when drawing a circle on a canvas with a bitmap shader
body: <p>I am attempting draw a populate a gridview with circles of images i have stored on the phone. similar to 
  <img src="https://i.stack.imgur.com/bspH5.png" alt="enter image description here"></p>
  
  <p>But instead of having the solid / gradient colors i want to use images. Relevant code is </p>
  
  <p>View which is drawn on
      </p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/img_color_selected"
      android:layout_width="35dp"
      android:layout_height="35dp"
      android:src="@drawable/ic_colorpicker_swatch_selected"
      android:layout_centerInParent="true"
      android:visibility="gone" /&gt;
  </code></pre>
  
  <p> </p>
  
  <p>Drawing on canvas </p>
  
  <pre><code>   @Override
      public void draw(Canvas canvas) {
          Bitmap bitmap = BitmapFactory.decodeResource(RaiseTheBarApplication.getInstance().getResources(), patternResource);
          BitmapShader shader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
          Paint paint = new Paint();
          paint.setColorFilter(new LightingColorFilter(progressColor, 1));
          paint.setShader(shader);
          canvas.drawCircle(canvas.getWidth() / 2, canvas.getHeight() / 2, RaiseTheBarApplication.getInstance().getResources().getDimensionPixelSize(R.dimen.choose_color_radius), paint);
      }
  </code></pre>
  
  <p>choose_color_radius is 20dp</p>
  
  <p>Gridview</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:background="@drawable/rtb_dialog"
  android:orientation="vertical"&gt;
  
  &lt;GridView
      android:id="@+id/gv_color_choice"
      android:layout_width="wrap_content"
      android:layout_height="250dp"
      android:columnWidth="65dp"
      android:numColumns="auto_fit"/&gt;
  
  &lt;com.lvl.xpbar.views.baseviews.AFGTextView
      android:id="@+id/submit"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:paddingTop="20dp"
      android:text="@string/button_submit"
      android:textSize="18dp"
      android:gravity="center_horizontal"
      android:background="@drawable/dialog_submit_background_selector"
      android:paddingBottom="20dp"
      android:layout_marginTop="5dp" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>If i use Canvas#drawBitmap it works fine but I i use the logic above it I get</p>
  
  <p>09-06 11:34:06.702  31659-31659/? A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x797ba000 (code=2), thread 31659 (com.lvl.xpbar)</p>
  
  <p>Any help is appreciated</p>