blob: f5dcf53a34804372032feb287b6171721bf82153 [file] [log] [blame]
reed@google.comac10a2d2010-12-22 21:39:39 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2010 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.
reed@google.comac10a2d2010-12-22 21:39:39 +00006 */
7
reed@google.comac10a2d2010-12-22 21:39:39 +00008#ifndef GrFontScaler_DEFINED
9#define GrFontScaler_DEFINED
10
11#include "GrGlyph.h"
12#include "GrKey.h"
13
reed@google.com07f3ee12011-05-16 17:21:57 +000014class SkPath;
reed@google.comac10a2d2010-12-22 21:39:39 +000015
16/**
17 * This is a virtual base class which Gr's interface to the host platform's
18 * font scaler.
19 *
20 * The client is responsible for subclassing, and instantiating this. The
21 * instance is create for a specific font+size+matrix.
22 */
23class GrFontScaler : public GrRefCnt {
24public:
reed@google.comfa35e3d2012-06-26 20:16:17 +000025 SK_DECLARE_INST_COUNT(GrFontScaler)
26
reed@google.comac10a2d2010-12-22 21:39:39 +000027 virtual const GrKey* getKey() = 0;
reed@google.com98539c62011-03-15 15:40:16 +000028 virtual GrMaskFormat getMaskFormat() = 0;
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +000029 virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) = 0;
reed@google.comac10a2d2010-12-22 21:39:39 +000030 virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
31 int rowBytes, void* image) = 0;
reed@google.com07f3ee12011-05-16 17:21:57 +000032 virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
reed@google.comfa35e3d2012-06-26 20:16:17 +000033
34private:
35 typedef GrRefCnt INHERITED;
reed@google.comac10a2d2010-12-22 21:39:39 +000036};
37
38#endif