Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: include/gpu/GrResourceKey.h

Issue 863983003: Reland https://codereview.chromium.org/860333002 with fix for test failures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « no previous file | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698