diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 17:28:16 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 17:28:16 +0000 |
commit | 7051f73afe986918635f4dd7d0c1610a42df2603 (patch) | |
tree | b3a1ebce3525f70f526b520f286cc544106763bf /skia/include/SkScalerContext.h | |
parent | b5a2bb6a4aea3f2564e1fd1b2746616f5d7161de (diff) | |
download | chromium_src-7051f73afe986918635f4dd7d0c1610a42df2603.zip chromium_src-7051f73afe986918635f4dd7d0c1610a42df2603.tar.gz chromium_src-7051f73afe986918635f4dd7d0c1610a42df2603.tar.bz2 |
Skia: bring us closer to upstream.
I want to bring us closer to upstream Skia. This patch consists of
hunks pulled from code.google.com/p/skia. I'll also be pushing changes
the other way.
Review URL: http://codereview.chromium.org/57018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/include/SkScalerContext.h')
-rw-r--r-- | skia/include/SkScalerContext.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/skia/include/SkScalerContext.h b/skia/include/SkScalerContext.h index ec2cd0d..df846f2 100644 --- a/skia/include/SkScalerContext.h +++ b/skia/include/SkScalerContext.h @@ -85,6 +85,12 @@ struct SkGlyph { size_t computeImageSize() const; + /** Call this to set all of the metrics fields to 0 (e.g. if the scaler + encounters an error measuring a glyph). Note: this does not alter the + fImage, fPath, fID, fMaskFormat fields. + */ + void zeroMetrics(); + enum { kSubBits = 2, kSubMask = ((1 << kSubBits) - 1), @@ -163,10 +169,16 @@ public: SkScalerContext(const SkDescriptor* desc); virtual ~SkScalerContext(); + // remember our glyph offset/base void setBaseGlyphCount(unsigned baseGlyphCount) { fBaseGlyphCount = baseGlyphCount; } + /** Return the corresponding glyph for the specified unichar. Since contexts + may be chained (under the hood), the glyphID that is returned may in + fact correspond to a different font/context. In that case, we use the + base-glyph-count to know how to translate back into local glyph space. + */ uint16_t charToGlyphID(SkUnichar uni); unsigned getGlyphCount() const { return this->generateGlyphCount(); } |