Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrBitmapTextContext_DEFINED | 8 #ifndef GrDistanceFieldTextContext_DEFINED |
| 9 #define GrBitmapTextContext_DEFINED | 9 #define GrDistanceFieldTextContext_DEFINED |
| 10 | 10 |
| 11 #include "GrTextContext.h" | 11 #include "GrTextContext.h" |
| 12 | 12 |
| 13 class GrTextStrike; | 13 class GrTextStrike; |
| 14 | 14 |
| 15 /* | 15 /* |
|
robertphillips
2013/11/05 15:30:26
remove "standard"?
jvanverth1
2013/11/05 17:09:22
Done.
| |
| 16 * This class implements GrTextContext using standard bitmap fonts | 16 * This class implements GrTextContext using standard DistanceField fonts |
| 17 */ | 17 */ |
| 18 class GrBitmapTextContext : public GrTextContext { | 18 class GrDistanceFieldTextContext : public GrTextContext { |
| 19 public: | 19 public: |
| 20 GrBitmapTextContext(GrContext*, const GrPaint&, SkColor); | 20 GrDistanceFieldTextContext(GrContext*, const GrPaint&, SkColor, SkScalar tex tSize); |
| 21 virtual ~GrBitmapTextContext(); | 21 virtual ~GrDistanceFieldTextContext(); |
| 22 | 22 |
| 23 virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, | 23 virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, |
|
robertphillips
2013/11/05 15:30:26
indent here?
jvanverth1
2013/11/05 17:09:22
Done.
| |
| 24 GrFontScaler*) SK_OVERRIDE; | 24 GrFontScaler*) SK_OVERRIDE; |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 GrContext::AutoMatrix fAutoMatrix; | 27 GrTextStrike* fStrike; |
| 28 GrTextStrike* fStrike; | 28 SkScalar fTextSize; |
| 29 | 29 |
| 30 void flushGlyphs(); // automatically called by destructor | 30 void flushGlyphs(); // automatically called by destructor |
| 31 | 31 |
|
robertphillips
2013/11/05 15:30:26
If this is required in both GrBitmapTextContext an
jvanverth1
2013/11/05 17:09:22
Not necessarily -- GrNVPathRenderingTextContext (o
| |
| 32 enum { | 32 enum { |
| 33 kMinRequestedGlyphs = 1, | 33 kMinRequestedGlyphs = 1, |
| 34 kDefaultRequestedGlyphs = 64, | 34 kDefaultRequestedGlyphs = 64, |
| 35 kMinRequestedVerts = kMinRequestedGlyphs * 4, | 35 kMinRequestedVerts = kMinRequestedGlyphs * 4, |
| 36 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4, | 36 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4, |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 SkColor fSkPaintColor; | 39 SkColor fSkPaintColor; |
| 40 SkPoint* fVertices; | 40 SkPoint* fVertices; |
| 41 int32_t fMaxVertices; | 41 int32_t fMaxVertices; |
| 42 GrTexture* fCurrTexture; | 42 GrTexture* fCurrTexture; |
| 43 int fCurrVertex; | 43 int fCurrVertex; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 #endif | 46 #endif |
| OLD | NEW |