blob: 6baa56fff3774c42d182d4e19cbe254acf154c38 [file] [log] [blame]
reed@google.comac10a2d2010-12-22 21:39:39 +00001/*
2 Copyright 2010 Google Inc.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17
18#ifndef GrFontScaler_DEFINED
19#define GrFontScaler_DEFINED
20
21#include "GrGlyph.h"
22#include "GrKey.h"
23
24class GrPath;
25
26/**
27 * This is a virtual base class which Gr's interface to the host platform's
28 * font scaler.
29 *
30 * The client is responsible for subclassing, and instantiating this. The
31 * instance is create for a specific font+size+matrix.
32 */
33class GrFontScaler : public GrRefCnt {
34public:
35 virtual const GrKey* getKey() = 0;
36 virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds) = 0;
37 virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
38 int rowBytes, void* image) = 0;
39 virtual bool getGlyphPath(uint16_t glyphID, GrPath*) = 0;
40};
41
42#endif
43