GrTexture can now create its own cache key

http://codereview.appspot.com/6269047/



git-svn-id: http://skia.googlecode.com/svn/trunk@4148 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 8768528..adceb77 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -109,13 +109,6 @@
     };
 
     /**
-     * Key generated by client. Should be a unique key on the texture data.
-     * Does not need to consider that width and height of the texture. Two
-     * textures with the same TextureKey but different bounds will not collide.
-     */
-    typedef uint64_t TextureKey;
-
-    /**
      *  Create a new entry, based on the specified key and texture, and return
      *  its "locked" entry. Must call be balanced with an unlockTexture() call.
      *
@@ -133,7 +126,7 @@
      * @param rowBytes  The number of bytes between rows of the texture. Zero
      *                  implies tightly packed rows.
      */
-    TextureCacheEntry createAndLockTexture(TextureKey key,
+    TextureCacheEntry createAndLockTexture(GrTexture::TextureKey key,
                                            const GrSamplerState* sampler,
                                            const GrTextureDesc& desc,
                                            void* srcData, size_t rowBytes);
@@ -158,18 +151,16 @@
      *                  filter fields are used. NULL implies clamp wrap modes
      *                  and nearest filtering.
      */
-    TextureCacheEntry findAndLockTexture(TextureKey key,
-                                         int width,
-                                         int height,
+    TextureCacheEntry findAndLockTexture(GrTexture::TextureKey key,
+                                         const GrTextureDesc& desc,
                                          const GrSamplerState* sampler);
     /**
      * Determines whether a texture is in the cache. If the texture is found it
      * will not be locked or returned. This call does not affect the priority of
      * the texture for deletion.
      */
-    bool isTextureInCache(TextureKey key,
-                          int width,
-                          int height,
+    bool isTextureInCache(GrTexture::TextureKey key,
+                          const GrTextureDesc& desc,
                           const GrSamplerState*) const;
 
     /**