Index: include/gpu/GrResourceKey.h |
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h |
index f662ed5511e36aa29ce3a0ac1ad8bc6d0a723d61..9922c8f5d07249f72b9371088a8a4613c2162e63 100644 |
--- a/include/gpu/GrResourceKey.h |
+++ b/include/gpu/GrResourceKey.h |
@@ -46,9 +46,9 @@ public: |
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; |
} |
@@ -96,6 +96,8 @@ private: |
static const uint32_t kInvalidResourceType = 0; |
static const uint32_t kMetaDataCnt = kLastMetaDataIdx + 1; |
+ friend class TestResource; // For unit test to access kMetaDataCnt. |
+ |
// Stencil and textures each require 2 uint32_t values. |
SkAutoSTArray<kMetaDataCnt + 2, uint32_t> fKey; |
}; |