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

Side by Side Diff: src/gpu/text/GrAtlasTextBlob.h

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/gpu/effects/GrTextureStripAtlas.h ('k') | src/gpu/text/GrStencilAndCoverTextContext.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 2015 Google Inc. 2 * Copyright 2015 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 GrAtlasTextBlob_DEFINED 8 #ifndef GrAtlasTextBlob_DEFINED
9 #define GrAtlasTextBlob_DEFINED 9 #define GrAtlasTextBlob_DEFINED
10 10
11 #include "GrBatchAtlas.h" 11 #include "GrBatchAtlas.h"
12 #include "GrBatchFontCache.h" 12 #include "GrBatchFontCache.h"
13 #include "GrColor.h" 13 #include "GrColor.h"
14 #include "GrMemoryPool.h" 14 #include "GrMemoryPool.h"
15 #include "SkDescriptor.h" 15 #include "SkDescriptor.h"
16 #include "SkMaskFilter.h" 16 #include "SkMaskFilter.h"
17 #include "SkOpts.h"
17 #include "SkPathEffect.h" 18 #include "SkPathEffect.h"
18 #include "SkRasterizer.h" 19 #include "SkRasterizer.h"
19 #include "SkSurfaceProps.h" 20 #include "SkSurfaceProps.h"
20 #include "SkTInternalLList.h" 21 #include "SkTInternalLList.h"
21 22
22 class GrBlobRegenHelper; 23 class GrBlobRegenHelper;
23 struct GrDistanceFieldAdjustTable; 24 struct GrDistanceFieldAdjustTable;
24 class GrMemoryPool; 25 class GrMemoryPool;
25 class SkDrawFilter; 26 class SkDrawFilter;
26 class SkTextBlob; 27 class SkTextBlob;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 fStrokeInfo.fMiterLimit = paint.getStrokeMiter(); 83 fStrokeInfo.fMiterLimit = paint.getStrokeMiter();
83 fStrokeInfo.fJoin = paint.getStrokeJoin(); 84 fStrokeInfo.fJoin = paint.getStrokeJoin();
84 } 85 }
85 } 86 }
86 87
87 static const Key& GetKey(const GrAtlasTextBlob& blob) { 88 static const Key& GetKey(const GrAtlasTextBlob& blob) {
88 return blob.fKey; 89 return blob.fKey;
89 } 90 }
90 91
91 static uint32_t Hash(const Key& key) { 92 static uint32_t Hash(const Key& key) {
92 return SkChecksum::Murmur3(&key, sizeof(Key)); 93 return SkOpts::hash(&key, sizeof(Key));
93 } 94 }
94 95
95 void operator delete(void* p) { 96 void operator delete(void* p) {
96 GrAtlasTextBlob* blob = reinterpret_cast<GrAtlasTextBlob*>(p); 97 GrAtlasTextBlob* blob = reinterpret_cast<GrAtlasTextBlob*>(p);
97 blob->fPool->release(p); 98 blob->fPool->release(p);
98 } 99 }
99 void* operator new(size_t) { 100 void* operator new(size_t) {
100 SkFAIL("All blobs are created by placement new."); 101 SkFAIL("All blobs are created by placement new.");
101 return sk_malloc_throw(0); 102 return sk_malloc_throw(0);
102 } 103 }
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 // We can reuse distance field text, but only if the new viewmatrix would no t result in 558 // We can reuse distance field text, but only if the new viewmatrix would no t result in
558 // a mip change. Because there can be multiple runs in a blob, we track the overall 559 // a mip change. Because there can be multiple runs in a blob, we track the overall
559 // maximum minimum scale, and minimum maximum scale, we can support before w e need to regen 560 // maximum minimum scale, and minimum maximum scale, we can support before w e need to regen
560 SkScalar fMaxMinScale; 561 SkScalar fMaxMinScale;
561 SkScalar fMinMaxScale; 562 SkScalar fMinMaxScale;
562 int fRunCount; 563 int fRunCount;
563 uint8_t fTextType; 564 uint8_t fTextType;
564 }; 565 };
565 566
566 #endif 567 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.h ('k') | src/gpu/text/GrStencilAndCoverTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698