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    virtual const GrKey* getKey() = 0;
29    virtual GrMaskFormat getMaskFormat() = 0;
30    virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds) = 0;
31    virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
32                                     int rowBytes, void* image) = 0;
33    virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
34};
35
36#endif
37
38