Use SkMakeBitmapShader, avoid bitmap copy

CreateBitmapShader now forces a copy. This updates the call sites
to use SkMakeBitmapShader (in SkImagePriv.h) with
kNever_SkCopyPixelsMode.

This maintains the behavior where apps can modify the bitmap in
the shader after creating the shader.

This also ensures that the texture cache will work (since it's
based off of SkPixelRefs).

BUG:31594626
Change-Id: Ic75cb6cdc05c750b7946208e48a8127838d9c2f8
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index 09775496..89af090 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -26,6 +26,7 @@
 #include <SkDrawFilter.h>
 #include <SkGraphics.h>
 #include <SkImage.h>
+#include <SkImagePriv.h>
 #include <SkRSXform.h>
 #include <SkShader.h>
 #include <SkTemplates.h>
@@ -593,10 +594,13 @@
     if (paint) {
         tmpPaint = *paint;
     }
-    SkShader* shader = SkShader::CreateBitmapShader(bitmap,
-                                                    SkShader::kClamp_TileMode,
-                                                    SkShader::kClamp_TileMode);
-    SkSafeUnref(tmpPaint.setShader(shader));
+    sk_sp<SkShader> shader = SkMakeBitmapShader(bitmap,
+                                                SkShader::kClamp_TileMode,
+                                                SkShader::kClamp_TileMode,
+                                                nullptr,
+                                                kNever_SkCopyPixelsMode,
+                                                nullptr);
+    tmpPaint.setShader(std::move(shader));
 
     mCanvas->drawVertices(SkCanvas::kTriangles_VertexMode, ptCount, (SkPoint*)vertices,
                          texs, (const SkColor*)colors, NULL, indices,