aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDefaultTextContext.h
blob: 4a935dc4eca687350c61b0899f015dd8277605a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

/*
 * Copyright 2010 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */



#ifndef GrDefaultTextContext_DEFINED
#define GrDefaultTextContext_DEFINED

#include "GrBatchedTextContext.h"

struct GrGpuTextVertex;
class GrTextStrike;

class GrDefaultTextContext: public GrBatchedTextContext {
public:
    GrDefaultTextContext();
    ~GrDefaultTextContext();

    virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top,
                                 GrFontScaler*) SK_OVERRIDE;

protected:
    virtual void flush() SK_OVERRIDE;
    virtual void init(GrContext* context, const GrPaint&,
                      const GrMatrix* extMatrix) SK_OVERRIDE;
    virtual void finish() SK_OVERRIDE;

private:
    GrVertexLayout   fVertexLayout;
    GrGpuTextVertex* fVertices;
    GrIRect          fClipRect;

    GrTextStrike*   fStrike;

    GrMatrix    fExtMatrix;
    GrMatrix    fOrigViewMatrix;    // restore previous viewmatrix

    inline void flushGlyphs();

    typedef GrBatchedTextContext INHERITED;
};

#endif