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

Side by Side Diff: src/gpu/GrGlyph.h

Issue 1093083003: Some simple optimizations for improving GrAtlasTextContext perf (Closed) Base URL: https://skia.googlesource.com/skia.git@atdfregen
Patch Set: simple optimizations Created 5 years, 8 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/GrBatchFontCache.cpp ('k') | no next file » | 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 2010 Google Inc. 2 * Copyright 2010 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 GrGlyph_DEFINED 8 #ifndef GrGlyph_DEFINED
9 #define GrGlyph_DEFINED 9 #define GrGlyph_DEFINED
10 10
(...skipping 21 matching lines...) Expand all
32 typedef uint32_t PackedID; 32 typedef uint32_t PackedID;
33 33
34 // TODO either plot or AtlasID will be valid, not both 34 // TODO either plot or AtlasID will be valid, not both
35 GrBatchAtlas::AtlasID fID; 35 GrBatchAtlas::AtlasID fID;
36 GrPlot* fPlot; 36 GrPlot* fPlot;
37 SkPath* fPath; 37 SkPath* fPath;
38 PackedID fPackedID; 38 PackedID fPackedID;
39 GrMaskFormat fMaskFormat; 39 GrMaskFormat fMaskFormat;
40 GrIRect16 fBounds; 40 GrIRect16 fBounds;
41 SkIPoint16 fAtlasLocation; 41 SkIPoint16 fAtlasLocation;
42 bool fTooLargeForAtlas;
42 43
43 void init(GrGlyph::PackedID packed, const SkIRect& bounds, GrMaskFormat form at) { 44 void init(GrGlyph::PackedID packed, const SkIRect& bounds, GrMaskFormat form at) {
44 fID = GrBatchAtlas::kInvalidAtlasID; 45 fID = GrBatchAtlas::kInvalidAtlasID;
45 fPlot = NULL; 46 fPlot = NULL;
46 fPath = NULL; 47 fPath = NULL;
47 fPackedID = packed; 48 fPackedID = packed;
48 fBounds.set(bounds); 49 fBounds.set(bounds);
49 fMaskFormat = format; 50 fMaskFormat = format;
50 fAtlasLocation.set(0, 0); 51 fAtlasLocation.set(0, 0);
52 fTooLargeForAtlas = GrBatchAtlas::GlyphTooLargeForAtlas(bounds.width(), bounds.height());
51 } 53 }
52 54
53 void free() { 55 void free() {
54 if (fPath) { 56 if (fPath) {
55 delete fPath; 57 delete fPath;
56 fPath = NULL; 58 fPath = NULL;
57 } 59 }
58 } 60 }
59 61
60 int width() const { return fBounds.width(); } 62 int width() const { return fBounds.width(); }
(...skipping 29 matching lines...) Expand all
90 92
91 static inline uint16_t UnpackID(PackedID packed) { 93 static inline uint16_t UnpackID(PackedID packed) {
92 return (uint16_t)packed; 94 return (uint16_t)packed;
93 } 95 }
94 96
95 static inline const GrGlyph::PackedID& GetKey(const GrGlyph& glyph) { 97 static inline const GrGlyph::PackedID& GetKey(const GrGlyph& glyph) {
96 return glyph.fPackedID; 98 return glyph.fPackedID;
97 } 99 }
98 100
99 static inline uint32_t Hash(GrGlyph::PackedID key) { 101 static inline uint32_t Hash(GrGlyph::PackedID key) {
100 return SkChecksum::Murmur3(&key, sizeof(key)); 102 return SkChecksum::Mix(key);
101 } 103 }
102 }; 104 };
103 105
104 #endif 106 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrBatchFontCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698