OLD | NEW |
---|---|
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 GrTextContext_DEFINED | 8 #ifndef GrTextContext_DEFINED |
9 #define GrTextContext_DEFINED | 9 #define GrTextContext_DEFINED |
10 | 10 |
11 #include "GrContext.h" | 11 #include "GrContext.h" |
12 #include "GrGlyph.h" | 12 #include "GrGlyph.h" |
13 #include "GrPaint.h" | 13 #include "GrPaint.h" |
14 | 14 |
15 class GrContext; | 15 class GrContext; |
16 class GrTextStrike; | 16 class GrDrawTarget; |
17 class GrFontScaler; | 17 class GrFontScaler; |
18 class GrDrawTarget; | |
19 | 18 |
19 /* | |
20 * This class wraps the state for a single text render | |
21 */ | |
20 class GrTextContext { | 22 class GrTextContext { |
21 public: | 23 public: |
22 GrTextContext(GrContext*, const GrPaint&); | 24 GrTextContext(GrContext*, const GrPaint&); |
bsalomon
2013/10/14 19:32:47
private?
jvanverth1
2013/10/16 17:56:29
Can't make it private (the child classes need acce
| |
23 ~GrTextContext(); | 25 virtual ~GrTextContext(); |
24 | 26 |
25 void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, | 27 virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, |
26 GrFontScaler*); | 28 GrFontScaler*) = 0; |
27 | 29 |
28 void flush(); // optional; automatically called by destructor | 30 virtual void flush() = 0; // optional |
bsalomon
2013/10/14 19:32:47
the comment now seems weird... as though overridin
jvanverth1
2013/10/16 17:56:29
Just removed it, no one seems to be using it.
| |
29 | 31 |
30 private: | 32 protected: |
31 GrPaint fPaint; | 33 GrPaint fPaint; |
32 GrContext* fContext; | 34 GrContext* fContext; |
33 GrDrawTarget* fDrawTarget; | 35 GrDrawTarget* fDrawTarget; |
34 | 36 |
35 GrFontScaler* fScaler; | 37 SkIRect fClipRect; |
36 GrTextStrike* fStrike; | 38 GrContext::AutoMatrix fAutoMatrix; |
37 | |
38 inline void flushGlyphs(); | |
39 void setupDrawTarget(); | |
40 | |
41 enum { | |
42 kMinRequestedGlyphs = 1, | |
43 kDefaultRequestedGlyphs = 64, | |
44 kMinRequestedVerts = kMinRequestedGlyphs * 4, | |
45 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4, | |
46 }; | |
47 | |
48 SkPoint* fVertices; | |
49 int32_t fMaxVertices; | |
50 GrTexture* fCurrTexture; | |
51 int fCurrVertex; | |
52 | |
53 SkIRect fClipRect; | |
54 GrContext::AutoMatrix fAutoMatrix; | |
55 }; | 39 }; |
56 | 40 |
57 #endif | 41 #endif |
OLD | NEW |