Make GrScratchKey memory buffer correct size on copy

Scratch key memory buffer of a copy of a key was too big. The (new) copy
was N times uint32_t bytes instead of N bytes.

Adds few tests to resource cache. These tests would not catch the too
big buffer. This is just a precaution for too small buffers. The main
idea of the test change is that the scratch key should contain some
information, so that lookup with a scratch key can also return no
match. Otherwise testing of scratch lookup result is not indicative of
correct code (eg. no-information scratch key will always match).

Review URL: https://codereview.chromium.org/860333002
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index f662ed5..43c6ff1 100644
--- a/include/gpu/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -46,9 +46,9 @@
     const uint32_t* data() const { return &fKey[kMetaDataCnt]; }
 
     GrScratchKey& operator=(const GrScratchKey& that) {
-        size_t size = that.size();
-        fKey.reset(SkToInt(size));
-        memcpy(fKey.get(), that.fKey.get(), size);
+        size_t bytes = that.size();
+        fKey.reset(SkToInt(bytes / sizeof(uint32_t)));
+        memcpy(fKey.get(), that.fKey.get(), bytes);
         return *this;
     }