blob: e0900ecd7d625629418dd26e29a40d6617070bee [file] [log] [blame]
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +00001/*
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
13class GrTextStrike;
14
15/*
16 * This class implements GrTextContext using standard bitmap fonts
17 */
18class GrBitmapTextContext : public GrTextContext {
19public:
commit-bot@chromium.orgf1d63aa2014-01-22 22:01:41 +000020 GrBitmapTextContext(GrContext*, const GrPaint&, SkColor);
21 virtual ~GrBitmapTextContext();
22
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000023 virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top,
24 GrFontScaler*) SK_OVERRIDE;
25
26private:
27 GrContext::AutoMatrix fAutoMatrix;
28 GrTextStrike* fStrike;
29
30 void flushGlyphs(); // automatically called by destructor
31
32 enum {
33 kMinRequestedGlyphs = 1,
34 kDefaultRequestedGlyphs = 64,
35 kMinRequestedVerts = kMinRequestedGlyphs * 4,
36 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4,
37 };
38
commit-bot@chromium.orgf1d63aa2014-01-22 22:01:41 +000039 SkColor fSkPaintColor;
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000040 SkPoint* fVertices;
41 int32_t fMaxVertices;
42 GrTexture* fCurrTexture;
43 int fCurrVertex;
44};
45
46#endif