jvanverth@google.com | c7a40fa | 2013-10-16 18:15:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrBitmapTextContext_DEFINED |
| 9 | #define GrBitmapTextContext_DEFINED |
| 10 | |
| 11 | #include "GrTextContext.h" |
| 12 | |
| 13 | class GrTextStrike; |
| 14 | |
| 15 | /* |
| 16 | * This class implements GrTextContext using standard bitmap fonts |
| 17 | */ |
| 18 | class GrBitmapTextContext : public GrTextContext { |
| 19 | public: |
jvanverth@google.com | c7a40fa | 2013-10-16 18:15:34 +0000 | [diff] [blame] | 20 | virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, |
| 21 | GrFontScaler*) SK_OVERRIDE; |
| 22 | |
| 23 | private: |
commit-bot@chromium.org | cc40f06 | 2014-01-24 14:38:27 +0000 | [diff] [blame] | 24 | GrBitmapTextContext(GrContext*, const GrPaint&, const SkPaint&); |
| 25 | virtual ~GrBitmapTextContext(); |
| 26 | friend class GrTTextContextManager<GrBitmapTextContext>; |
| 27 | |
jvanverth@google.com | c7a40fa | 2013-10-16 18:15:34 +0000 | [diff] [blame] | 28 | GrContext::AutoMatrix fAutoMatrix; |
| 29 | GrTextStrike* fStrike; |
| 30 | |
| 31 | void flushGlyphs(); // automatically called by destructor |
| 32 | |
| 33 | enum { |
| 34 | kMinRequestedGlyphs = 1, |
| 35 | kDefaultRequestedGlyphs = 64, |
| 36 | kMinRequestedVerts = kMinRequestedGlyphs * 4, |
| 37 | kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4, |
| 38 | }; |
| 39 | |
jvanverth@google.com | c7a40fa | 2013-10-16 18:15:34 +0000 | [diff] [blame] | 40 | SkPoint* fVertices; |
| 41 | int32_t fMaxVertices; |
| 42 | GrTexture* fCurrTexture; |
| 43 | int fCurrVertex; |
| 44 | }; |
| 45 | |
| 46 | #endif |