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

Side by Side Diff: src/core/SkPaint.cpp

Issue 637583002: Add SkPaint::getHash(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better Created 6 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 | « include/core/SkPaint.h ('k') | tests/PaintTest.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkAutoKern.h" 10 #include "SkAutoKern.h"
11 #include "SkChecksum.h"
11 #include "SkColorFilter.h" 12 #include "SkColorFilter.h"
12 #include "SkData.h" 13 #include "SkData.h"
13 #include "SkDeviceProperties.h" 14 #include "SkDeviceProperties.h"
14 #include "SkDraw.h" 15 #include "SkDraw.h"
15 #include "SkFontDescriptor.h" 16 #include "SkFontDescriptor.h"
16 #include "SkFontHost.h" 17 #include "SkFontHost.h"
17 #include "SkGlyphCache.h" 18 #include "SkGlyphCache.h"
18 #include "SkImageFilter.h" 19 #include "SkImageFilter.h"
19 #include "SkMaskFilter.h" 20 #include "SkMaskFilter.h"
20 #include "SkMaskGamma.h" 21 #include "SkMaskGamma.h"
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2453 return 0 == this->getAlpha(); 2454 return 0 == this->getAlpha();
2454 case SkXfermode::kDst_Mode: 2455 case SkXfermode::kDst_Mode:
2455 return true; 2456 return true;
2456 default: 2457 default:
2457 break; 2458 break;
2458 } 2459 }
2459 } 2460 }
2460 return false; 2461 return false;
2461 } 2462 }
2462 2463
2464 uint32_t SkPaint::getHash() const {
2465 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2466 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2467 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * sizeof(uint32_t),
2468 SkPaint_notPackedTightly);
2469 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2470 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2471 }
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698