michael@0: /* michael@0: * Copyright 2010 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef GrFontScaler_DEFINED michael@0: #define GrFontScaler_DEFINED michael@0: michael@0: #include "GrGlyph.h" michael@0: #include "GrKey.h" michael@0: michael@0: class SkPath; michael@0: michael@0: /** michael@0: * This is a virtual base class which Gr's interface to the host platform's michael@0: * font scaler. michael@0: * michael@0: * The client is responsible for subclassing, and instantiating this. The michael@0: * instance is create for a specific font+size+matrix. michael@0: */ michael@0: class GrFontScaler : public SkRefCnt { michael@0: public: michael@0: SK_DECLARE_INST_COUNT(GrFontScaler) michael@0: michael@0: virtual const GrKey* getKey() = 0; michael@0: virtual GrMaskFormat getMaskFormat() = 0; michael@0: virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) = 0; michael@0: virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, michael@0: int rowBytes, void* image) = 0; michael@0: virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0; michael@0: michael@0: private: michael@0: typedef SkRefCnt INHERITED; michael@0: }; michael@0: michael@0: #endif