aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2015-11-13 07:07:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-13 07:07:47 -0800
commit0274efbd3d2c3b2fba2b4212347159a20050038d (patch)
tree938361c44fba7b2f2b2f8bde112833df571258b0 /src/gpu
parent64c4728c70001ed074fecf5c4e083781987b12e9 (diff)
Revert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of https://codereview.chromium.org/1436973003/ )
Reason for revert: I would not have expected this to change any images. Looks like it's changed both MSAA and non-MSAA GMs: 1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac&unt=true&head=true&query=source_type%3Dgm">https://gold.skia.org/search2?blame=1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac&unt=true&head=true&query=source_type%3Dgm Original issue's description: > Switch uses of SkChecksum::Compute to Murmur3. > > SkChecksum::Compute is a very, very poorly distributed hash function. > This replaces all remaining uses with Murmur3. > > The only interesting stuff is in src/gpu. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac TBR=bsalomon@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1445523003
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrProgramDesc.h3
-rw-r--r--src/gpu/GrResourceCache.cpp8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/GrProgramDesc.h b/src/gpu/GrProgramDesc.h
index 9641195354..05b52cc7cd 100644
--- a/src/gpu/GrProgramDesc.h
+++ b/src/gpu/GrProgramDesc.h
@@ -107,7 +107,8 @@ protected:
*(this->atOffset<uint32_t, GrProgramDesc::kLengthOffset>()) = SkToU32(keyLength);
uint32_t* checksum = this->atOffset<uint32_t, GrProgramDesc::kChecksumOffset>();
- *checksum = SkChecksum::Murmur3(fKey.begin(), keyLength);
+ *checksum = 0;
+ *checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), keyLength);
}
// The key, stored in fKey, is composed of four parts:
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 4a0c9b2b36..cb6bcf75fd 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -42,7 +42,7 @@ GrUniqueKey::Domain GrUniqueKey::GenerateDomain() {
}
uint32_t GrResourceKeyHash(const uint32_t* data, size_t size) {
- return SkChecksum::Murmur3(data, size);
+ return SkChecksum::Compute(data, size);
}
//////////////////////////////////////////////////////////////////////////////
@@ -564,7 +564,7 @@ uint32_t GrResourceCache::getNextTimestamp() {
int currP = 0;
int currNP = 0;
while (currP < sortedPurgeableResources.count() &&
- currNP < fNonpurgeableResources.count()) {
+ currNP < fNonpurgeableResources.count()) {
uint32_t tsP = sortedPurgeableResources[currP]->cacheAccess().timestamp();
uint32_t tsNP = fNonpurgeableResources[currNP]->cacheAccess().timestamp();
SkASSERT(tsP != tsNP);
@@ -596,10 +596,10 @@ uint32_t GrResourceCache::getNextTimestamp() {
// count should be the next timestamp we return.
SkASSERT(fTimestamp == SkToU32(count));
-
+
// The historical timestamps of flushes are now invalid.
this->resetFlushTimestamps();
- }
+ }
}
return fTimestamp++;
}