1
2/*
3 * Copyright 2010 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10
11#ifndef GrFontScaler_DEFINED
12#define GrFontScaler_DEFINED
13
14#include "GrGlyph.h"
15#include "GrKey.h"
16
17class SkPath;
18
19/**
20 *  This is a virtual base class which Gr's interface to the host platform's
21 *  font scaler.
22 *
23 *  The client is responsible for subclassing, and instantiating this. The
24 *  instance is create for a specific font+size+matrix.
25 */
26class GrFontScaler : public GrRefCnt {
27public:
28    SK_DECLARE_INST_COUNT(GrFontScaler)
29
30    virtual const GrKey* getKey() = 0;
31    virtual GrMaskFormat getMaskFormat() = 0;
32    virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds) = 0;
33    virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
34                                     int rowBytes, void* image) = 0;
35    virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
36
37private:
38    typedef GrRefCnt INHERITED;
39};
40
41#endif
42