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

Side by Side Diff: dm/DM.cpp

Issue 1405053002: SkTHash: hash from fnptr to functor type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/private/SkChecksum.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 Gold() : SkString("") {} 137 Gold() : SkString("") {}
138 Gold(ImplicitString sink, ImplicitString src, ImplicitString srcOptions, 138 Gold(ImplicitString sink, ImplicitString src, ImplicitString srcOptions,
139 ImplicitString name, ImplicitString md5) 139 ImplicitString name, ImplicitString md5)
140 : SkString("") { 140 : SkString("") {
141 this->append(sink); 141 this->append(sink);
142 this->append(src); 142 this->append(src);
143 this->append(srcOptions); 143 this->append(srcOptions);
144 this->append(name); 144 this->append(name);
145 this->append(md5); 145 this->append(md5);
146 } 146 }
147 static uint32_t Hash(const Gold& g) { return SkGoodHash((const SkString&)g); } 147 struct Hash {
148 uint32_t operator()(const Gold& g) const {
149 return SkGoodHash()((const SkString&)g);
150 }
151 };
148 }; 152 };
149 static SkTHashSet<Gold, Gold::Hash> gGold; 153 static SkTHashSet<Gold, Gold::Hash> gGold;
150 154
151 static void add_gold(JsonWriter::BitmapResult r) { 155 static void add_gold(JsonWriter::BitmapResult r) {
152 gGold.add(Gold(r.config, r.sourceType, r.sourceOptions, r.name, r.md5)); 156 gGold.add(Gold(r.config, r.sourceType, r.sourceOptions, r.name, r.md5));
153 } 157 }
154 158
155 static void gather_gold() { 159 static void gather_gold() {
156 if (!FLAGS_readPath.isEmpty()) { 160 if (!FLAGS_readPath.isEmpty()) {
157 SkString path(FLAGS_readPath[0]); 161 SkString path(FLAGS_readPath[0]);
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 #endif // SK_PDF_IMAGE_STATS 1106 #endif // SK_PDF_IMAGE_STATS
1103 return 0; 1107 return 0;
1104 } 1108 }
1105 1109
1106 #if !defined(SK_BUILD_FOR_IOS) 1110 #if !defined(SK_BUILD_FOR_IOS)
1107 int main(int argc, char** argv) { 1111 int main(int argc, char** argv) {
1108 SkCommandLineFlags::Parse(argc, argv); 1112 SkCommandLineFlags::Parse(argc, argv);
1109 return dm_main(); 1113 return dm_main();
1110 } 1114 }
1111 #endif 1115 #endif
OLDNEW
« no previous file with comments | « no previous file | include/private/SkChecksum.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698