epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * 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.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 11 | #ifndef GrFontScaler_DEFINED |
| 12 | #define GrFontScaler_DEFINED |
| 13 | |
| 14 | #include "GrGlyph.h" |
| 15 | #include "GrKey.h" |
| 16 | |
reed@google.com | 07f3ee1 | 2011-05-16 17:21:57 +0000 | [diff] [blame] | 17 | class SkPath; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 18 | |
| 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 | */ |
| 26 | class GrFontScaler : public GrRefCnt { |
| 27 | public: |
| 28 | virtual const GrKey* getKey() = 0; |
reed@google.com | 98539c6 | 2011-03-15 15:40:16 +0000 | [diff] [blame] | 29 | virtual GrMaskFormat getMaskFormat() = 0; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 30 | 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.com | 07f3ee1 | 2011-05-16 17:21:57 +0000 | [diff] [blame] | 33 | virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | #endif |
| 37 | |