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

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

Issue 2208903002: Use sse4.2 CRC32 instructions to hash when available. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 4 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/core/SkOpts.cpp ('k') | src/core/SkResourceCache.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 "SkAutoKern.h" 9 #include "SkAutoKern.h"
10 #include "SkChecksum.h"
11 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
12 #include "SkData.h" 11 #include "SkData.h"
13 #include "SkDraw.h" 12 #include "SkDraw.h"
14 #include "SkFontDescriptor.h" 13 #include "SkFontDescriptor.h"
15 #include "SkGlyphCache.h" 14 #include "SkGlyphCache.h"
16 #include "SkImageFilter.h" 15 #include "SkImageFilter.h"
17 #include "SkMaskFilter.h" 16 #include "SkMaskFilter.h"
18 #include "SkMaskGamma.h" 17 #include "SkMaskGamma.h"
19 #include "SkMutex.h" 18 #include "SkMutex.h"
20 #include "SkReadBuffer.h" 19 #include "SkReadBuffer.h"
21 #include "SkWriteBuffer.h" 20 #include "SkWriteBuffer.h"
21 #include "SkOpts.h"
22 #include "SkPaintDefaults.h" 22 #include "SkPaintDefaults.h"
23 #include "SkPathEffect.h" 23 #include "SkPathEffect.h"
24 #include "SkRasterizer.h" 24 #include "SkRasterizer.h"
25 #include "SkScalar.h" 25 #include "SkScalar.h"
26 #include "SkScalerContext.h" 26 #include "SkScalerContext.h"
27 #include "SkShader.h" 27 #include "SkShader.h"
28 #include "SkStringUtils.h" 28 #include "SkStringUtils.h"
29 #include "SkStroke.h" 29 #include "SkStroke.h"
30 #include "SkStrokeRec.h" 30 #include "SkStrokeRec.h"
31 #include "SkSurfacePriv.h" 31 #include "SkSurfacePriv.h"
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 } 2381 }
2382 } 2382 }
2383 return false; 2383 return false;
2384 } 2384 }
2385 2385
2386 uint32_t SkPaint::getHash() const { 2386 uint32_t SkPaint::getHash() const {
2387 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2387 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2388 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2388 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2389 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t), 2389 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t),
2390 "SkPaint_notPackedTightly"); 2390 "SkPaint_notPackedTightly");
2391 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2391 return SkOpts::hash(reinterpret_cast<const uint32_t*>(this),
2392 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2392 offsetof(SkPaint, fBitfields) + sizeof(fBitfields));
2393 } 2393 }
OLDNEW
« no previous file with comments | « src/core/SkOpts.cpp ('k') | src/core/SkResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698