blob: 657647dea504251d48eaa42f1fbc3cb45b8bc558 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@google.comac10a2d2010-12-22 21:39:39 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * 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.
reed@google.comac10a2d2010-12-22 21:39:39 +00007 */
8
9
epoger@google.comec3ed6a2011-07-28 14:26:00 +000010
reed@google.comac10a2d2010-12-22 21:39:39 +000011#ifndef GrFontScaler_DEFINED
12#define GrFontScaler_DEFINED
13
14#include "GrGlyph.h"
15#include "GrKey.h"
16
reed@google.com07f3ee12011-05-16 17:21:57 +000017class SkPath;
reed@google.comac10a2d2010-12-22 21:39:39 +000018
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;
reed@google.com98539c62011-03-15 15:40:16 +000029 virtual GrMaskFormat getMaskFormat() = 0;
reed@google.comac10a2d2010-12-22 21:39:39 +000030 virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds) = 0;
31 virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
32 int rowBytes, void* image) = 0;
reed@google.com07f3ee12011-05-16 17:21:57 +000033 virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
reed@google.comac10a2d2010-12-22 21:39:39 +000034};
35
36#endif
37