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

Side by Side Diff: src/utils/SkMD5.h

Issue 1006583005: SkCodec: add wbmp class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-27 (Friday) 10:53:14 EDT Created 5 years, 9 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 | « src/codec/SkCodec_wbmp.cpp ('k') | tests/CodexTest.cpp » ('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 2012 Google Inc. 2 * Copyright 2012 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 #ifndef SkMD5_DEFINED 8 #ifndef SkMD5_DEFINED
9 #define SkMD5_DEFINED 9 #define SkMD5_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 return true; 29 return true;
30 } 30 }
31 31
32 size_t bytesWritten() const override { return SkToSizeT(this->byteCount); } 32 size_t bytesWritten() const override { return SkToSizeT(this->byteCount); }
33 33
34 /** Processes input, adding it to the digest. Calling this after finish is u ndefined. */ 34 /** Processes input, adding it to the digest. Calling this after finish is u ndefined. */
35 void update(const uint8_t* input, size_t length); 35 void update(const uint8_t* input, size_t length);
36 36
37 struct Digest { 37 struct Digest {
38 uint8_t data[16]; 38 uint8_t data[16];
39 bool operator ==(Digest const& other) const {
40 return 0 == memcmp(data, other.data, sizeof(data));
41 }
42 bool operator !=(Digest const& other) const {
43 return 0 != memcmp(data, other.data, sizeof(data));
44 }
39 }; 45 };
40 46
41 /** Computes and returns the digest. */ 47 /** Computes and returns the digest. */
42 void finish(Digest& digest); 48 void finish(Digest& digest);
43 49
44 private: 50 private:
45 // number of bytes, modulo 2^64 51 // number of bytes, modulo 2^64
46 uint64_t byteCount; 52 uint64_t byteCount;
47 53
48 // state (ABCD) 54 // state (ABCD)
49 uint32_t state[4]; 55 uint32_t state[4];
50 56
51 // input buffer 57 // input buffer
52 uint8_t buffer[64]; 58 uint8_t buffer[64];
53 }; 59 };
54 60
55 #endif 61 #endif
OLDNEW
« no previous file with comments | « src/codec/SkCodec_wbmp.cpp ('k') | tests/CodexTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698