Move offset and CTM from LayerCache Key to per-hoisted-layer info

This CL reduces the amount of information used in the layer cache key:
- the stop value isn't needed since the start value uniquely identifies the layer in the picture.
- only the upper-left 2x2 portion of the CTM should be used as a key for looking up cached layers.
- individual layers can be redraw in different locations so the final offset cannot be a part of the key.

Since this data is no longer stored in the cached layer, but is still required to draw the cached layer, it is now stored in the per-layer information (i.e., HoistedLayer).

This is split out of (Fix sub-picture layer rendering bugs - https://codereview.chromium.org/597293002/).

BUG=skia:2315
R=egdaniel@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/609403003
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp
index 11a97e4..6ec0758 100644
--- a/src/gpu/GrLayerCache.cpp
+++ b/src/gpu/GrLayerCache.cpp
@@ -14,7 +14,7 @@
 #ifdef SK_DEBUG
 void GrCachedLayer::validate(const GrTexture* backingTexture) const {
     SkASSERT(SK_InvalidGenID != fKey.pictureID());
-    SkASSERT(fKey.start() > 0 && fKey.stop() > 0);
+    SkASSERT(fKey.start() > 0);
 
 
     if (fTexture) {
@@ -119,33 +119,30 @@
 
 GrCachedLayer* GrLayerCache::createLayer(uint32_t pictureID, 
                                          int start, int stop, 
-                                         const SkIPoint& offset,
                                          const SkMatrix& ctm,
                                          const SkPaint* paint) {
     SkASSERT(pictureID != SK_InvalidGenID && start > 0 && stop > 0);
 
-    GrCachedLayer* layer = SkNEW_ARGS(GrCachedLayer, (pictureID, start, stop, offset, ctm, paint));
+    GrCachedLayer* layer = SkNEW_ARGS(GrCachedLayer, (pictureID, start, stop, ctm, paint));
     fLayerHash.add(layer);
     return layer;
 }
 
 GrCachedLayer* GrLayerCache::findLayer(uint32_t pictureID,
-                                       int start, int stop, 
-                                       const SkIPoint& offset,
+                                       int start, 
                                        const SkMatrix& ctm) {
-    SkASSERT(pictureID != SK_InvalidGenID && start > 0 && stop > 0);
-    return fLayerHash.find(GrCachedLayer::Key(pictureID, start, stop, offset, ctm));
+    SkASSERT(pictureID != SK_InvalidGenID && start > 0);
+    return fLayerHash.find(GrCachedLayer::Key(pictureID, start, ctm));
 }
 
 GrCachedLayer* GrLayerCache::findLayerOrCreate(uint32_t pictureID,
                                                int start, int stop,
-                                               const SkIPoint& offset,
                                                const SkMatrix& ctm,
                                                const SkPaint* paint) {
     SkASSERT(pictureID != SK_InvalidGenID && start > 0 && stop > 0);
-    GrCachedLayer* layer = fLayerHash.find(GrCachedLayer::Key(pictureID, start, stop, offset, ctm));
+    GrCachedLayer* layer = fLayerHash.find(GrCachedLayer::Key(pictureID, start, ctm));
     if (NULL == layer) {
-        layer = this->createLayer(pictureID, start, stop, offset, ctm, paint);
+        layer = this->createLayer(pictureID, start, stop, ctm, paint);
     }
 
     return layer;