reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * 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.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 8 | #ifndef GrFontScaler_DEFINED |
| 9 | #define GrFontScaler_DEFINED |
| 10 | |
| 11 | #include "GrGlyph.h" |
| 12 | #include "GrKey.h" |
| 13 | |
reed@google.com | 07f3ee1 | 2011-05-16 17:21:57 +0000 | [diff] [blame] | 14 | class SkPath; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 15 | |
| 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 | */ |
commit-bot@chromium.org | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame^] | 23 | class GrFontScaler : public SkRefCnt { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 24 | public: |
reed@google.com | fa35e3d | 2012-06-26 20:16:17 +0000 | [diff] [blame] | 25 | SK_DECLARE_INST_COUNT(GrFontScaler) |
| 26 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 27 | virtual const GrKey* getKey() = 0; |
reed@google.com | 98539c6 | 2011-03-15 15:40:16 +0000 | [diff] [blame] | 28 | virtual GrMaskFormat getMaskFormat() = 0; |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 29 | virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) = 0; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 30 | virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, |
| 31 | int rowBytes, void* image) = 0; |
reed@google.com | 07f3ee1 | 2011-05-16 17:21:57 +0000 | [diff] [blame] | 32 | virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0; |
reed@google.com | fa35e3d | 2012-06-26 20:16:17 +0000 | [diff] [blame] | 33 | |
| 34 | private: |
commit-bot@chromium.org | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame^] | 35 | typedef SkRefCnt INHERITED; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | #endif |