1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/gpu/GrFontScaler.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +/* 1.5 + * Copyright 2010 Google Inc. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license that can be 1.8 + * found in the LICENSE file. 1.9 + */ 1.10 + 1.11 +#ifndef GrFontScaler_DEFINED 1.12 +#define GrFontScaler_DEFINED 1.13 + 1.14 +#include "GrGlyph.h" 1.15 +#include "GrKey.h" 1.16 + 1.17 +class SkPath; 1.18 + 1.19 +/** 1.20 + * This is a virtual base class which Gr's interface to the host platform's 1.21 + * font scaler. 1.22 + * 1.23 + * The client is responsible for subclassing, and instantiating this. The 1.24 + * instance is create for a specific font+size+matrix. 1.25 + */ 1.26 +class GrFontScaler : public SkRefCnt { 1.27 +public: 1.28 + SK_DECLARE_INST_COUNT(GrFontScaler) 1.29 + 1.30 + virtual const GrKey* getKey() = 0; 1.31 + virtual GrMaskFormat getMaskFormat() = 0; 1.32 + virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) = 0; 1.33 + virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, 1.34 + int rowBytes, void* image) = 0; 1.35 + virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0; 1.36 + 1.37 +private: 1.38 + typedef SkRefCnt INHERITED; 1.39 +}; 1.40 + 1.41 +#endif