OLD | NEW |
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 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkBitmapHasher.h" | 9 #include "SkBitmapHasher.h" |
10 #include "SkEndian.h" | 10 #include "SkEndian.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 /*static*/ bool SkBitmapHasher::ComputeDigest(const SkBitmap& bitmap, uint64_t *
result) { | 52 /*static*/ bool SkBitmapHasher::ComputeDigest(const SkBitmap& bitmap, uint64_t *
result) { |
53 if (ComputeDigestInternal(bitmap, result)) { | 53 if (ComputeDigestInternal(bitmap, result)) { |
54 return true; | 54 return true; |
55 } | 55 } |
56 | 56 |
57 // Hmm, that didn't work. Maybe if we create a new | 57 // Hmm, that didn't work. Maybe if we create a new |
58 // kARGB_8888_Config version of the bitmap it will work better? | 58 // kARGB_8888_Config version of the bitmap it will work better? |
59 SkBitmap copyBitmap; | 59 SkBitmap copyBitmap; |
60 if (!bitmap.copyTo(©Bitmap, kPMColor_SkColorType)) { | 60 if (!bitmap.copyTo(©Bitmap, kN32_SkColorType)) { |
61 return false; | 61 return false; |
62 } | 62 } |
63 return ComputeDigestInternal(copyBitmap, result); | 63 return ComputeDigestInternal(copyBitmap, result); |
64 } | 64 } |
OLD | NEW |