aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrResourceKey.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2015-01-21 08:05:55 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-21 08:05:55 -0800
commit988018c817f341c0ce09297b7ba5ba60ba76eba9 (patch)
tree9b86071256d9bd14983547836fddd385c1a3fb13 /include/gpu/GrResourceKey.h
parent0f2e055580d98659049dbd5c50149e7c32cbd45b (diff)
Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)
Reason for revert: Our Valgrind bot just spewed out a weird error. I don't know if it's related, but it looks at least like one of the stacks was in the right area, so I'm going to revert this precautionarily. Sorry if this is a false positive. http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/266/steps/dm/logs/stdio Original issue's description: > 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). > > Committed: https://skia.googlesource.com/skia/+/711ef4831363fb8cbdf061dc2c36c65b13c0ccf2 TBR=bsalomon@google.com,kkinnunen@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/864833003
Diffstat (limited to 'include/gpu/GrResourceKey.h')
-rw-r--r--include/gpu/GrResourceKey.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index 43c6ff1770..f662ed5511 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 bytes = that.size();
- fKey.reset(SkToInt(bytes / sizeof(uint32_t)));
- memcpy(fKey.get(), that.fKey.get(), bytes);
+ size_t size = that.size();
+ fKey.reset(SkToInt(size));
+ memcpy(fKey.get(), that.fKey.get(), size);
return *this;
}