Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.

Committed: https://skia.googlesource.com/skia/+/fcffaf22d697f06f903c3193308f9dc54a959f79

Committed: https://skia.googlesource.com/skia/+/1a197ea31e0aac7ea312e9a6c0d9f5df626b0350

Review URL: https://codereview.chromium.org/1409163002
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index 6cfa90f..9958cfc 100644
--- a/include/gpu/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -138,8 +138,8 @@
 
     friend class TestResource; // For unit test to access kMetaDataCnt.
 
-    // bmp textures require 4 uint32_t values.
-    SkAutoSTMalloc<kMetaDataCnt + 4, uint32_t> fKey;
+    // bmp textures require 5 uint32_t values.
+    SkAutoSTMalloc<kMetaDataCnt + 5, uint32_t> fKey;
 };
 
 /**
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 591d3d8..17625c4 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -65,9 +65,11 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-
+/** Returns a texture representing the bitmap that is compatible with the GrTextureParams. The
+    texture is inserted into the cache (unless the bitmap is marked volatile) and can be
+    retrieved again via this function. */
 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTextureParams&);
-    
+
 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWindow its subclasses).
 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfileType);