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

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

Issue 1011403004: BitmapTextBatch and BitmapTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@dfpr_take_2
Patch Set: feedback inc Created 5 years, 9 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
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
11 #include "GrBatchAtlas.h"
11 #include "GrRect.h" 12 #include "GrRect.h"
12 #include "GrTypes.h" 13 #include "GrTypes.h"
13 14
14 #include "SkChecksum.h" 15 #include "SkChecksum.h"
15 #include "SkPath.h" 16 #include "SkPath.h"
16 17
17 class GrPlot; 18 class GrPlot;
18 19
19 /* Need this to be quad-state: 20 /* Need this to be quad-state:
20 - complete w/ image 21 - complete w/ image
21 - just metrics 22 - just metrics
22 - failed to get image, but has metrics 23 - failed to get image, but has metrics
23 - failed to get metrics 24 - failed to get metrics
24 */ 25 */
25 struct GrGlyph { 26 struct GrGlyph {
26 enum MaskStyle { 27 enum MaskStyle {
27 kCoverage_MaskStyle, 28 kCoverage_MaskStyle,
28 kDistance_MaskStyle 29 kDistance_MaskStyle
29 }; 30 };
30 31
31 typedef uint32_t PackedID; 32 typedef uint32_t PackedID;
32 33
34 // TODO either plot or AtlasID will be valid, not both
bsalomon 2015/03/24 16:27:53 Is this b/c we have both batch and nonbatch impls
joshualitt 2015/03/25 14:13:37 yes
35 GrBatchAtlas::AtlasID fID;
33 GrPlot* fPlot; 36 GrPlot* fPlot;
34 SkPath* fPath; 37 SkPath* fPath;
35 PackedID fPackedID; 38 PackedID fPackedID;
36 GrMaskFormat fMaskFormat; 39 GrMaskFormat fMaskFormat;
37 GrIRect16 fBounds; 40 GrIRect16 fBounds;
38 SkIPoint16 fAtlasLocation; 41 SkIPoint16 fAtlasLocation;
39 42
40 void init(GrGlyph::PackedID packed, const SkIRect& bounds, GrMaskFormat form at) { 43 void init(GrGlyph::PackedID packed, const SkIRect& bounds, GrMaskFormat form at) {
44 fID = GrBatchAtlas::kInvalidAtlasID;
41 fPlot = NULL; 45 fPlot = NULL;
42 fPath = NULL; 46 fPath = NULL;
43 fPackedID = packed; 47 fPackedID = packed;
44 fBounds.set(bounds); 48 fBounds.set(bounds);
45 fMaskFormat = format; 49 fMaskFormat = format;
46 fAtlasLocation.set(0, 0); 50 fAtlasLocation.set(0, 0);
47 } 51 }
48 52
49 void free() { 53 void free() {
50 if (fPath) { 54 if (fPath) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 static inline const GrGlyph::PackedID& GetKey(const GrGlyph& glyph) { 95 static inline const GrGlyph::PackedID& GetKey(const GrGlyph& glyph) {
92 return glyph.fPackedID; 96 return glyph.fPackedID;
93 } 97 }
94 98
95 static inline uint32_t Hash(GrGlyph::PackedID key) { 99 static inline uint32_t Hash(GrGlyph::PackedID key) {
96 return SkChecksum::Murmur3(&key, sizeof(key)); 100 return SkChecksum::Murmur3(&key, sizeof(key));
97 } 101 }
98 }; 102 };
99 103
100 #endif 104 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698