summaryrefslogtreecommitdiffstats
path: root/skia/include
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 00:44:49 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 00:44:49 +0000
commit83f6e08f4c56ef411ad1da5f3bfd4711ec94b052 (patch)
tree6bf8e871963cfc1ab8bf6190dceed5b9631cf8ee /skia/include
parentd5c0e0e416a67e7e8dd98745cdf1bdc7de20517c (diff)
downloadchromium_src-83f6e08f4c56ef411ad1da5f3bfd4711ec94b052.zip
chromium_src-83f6e08f4c56ef411ad1da5f3bfd4711ec94b052.tar.gz
chromium_src-83f6e08f4c56ef411ad1da5f3bfd4711ec94b052.tar.bz2
Add Harfbuzz to third_party and Skia support for such.
Harfbuzz is an open source library which is a unification of the Qt and Pango shaping engines. We'll be using it on Chromium Linux to perform complex text shaping. Additionally, we add support for Harfbuzz into Skia, guarded by SKIA_HARFBUZZ. http://codereview.chromium.org/63035/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13214 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/include')
-rw-r--r--skia/include/SkPaint.h7
-rw-r--r--skia/include/SkScalerContext.h10
2 files changed, 17 insertions, 0 deletions
diff --git a/skia/include/SkPaint.h b/skia/include/SkPaint.h
index bb386c6..dea8de6 100644
--- a/skia/include/SkPaint.h
+++ b/skia/include/SkPaint.h
@@ -39,6 +39,8 @@ class SkDrawLooper;
class SkTypeface;
class SkXfermode;
+typedef struct HB_ShaperItem_ HB_ShaperItem;
+
typedef const SkGlyph& (*SkDrawCacheProc)(SkGlyphCache*, const char**,
SkFixed x, SkFixed y);
@@ -736,6 +738,11 @@ public:
void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y,
SkPath* path) const;
+#ifdef SKIA_HARFBUZZ
+ void setupShaper(HB_ShaperItem* item);
+ void releaseShaper(HB_ShaperItem* item);
+#endif
+
private:
SkTypeface* fTypeface;
SkScalar fTextSize;
diff --git a/skia/include/SkScalerContext.h b/skia/include/SkScalerContext.h
index df846f2..1299f1b 100644
--- a/skia/include/SkScalerContext.h
+++ b/skia/include/SkScalerContext.h
@@ -28,6 +28,8 @@ class SkMaskFilter;
class SkPathEffect;
class SkRasterizer;
+typedef struct HB_ShaperItem_ HB_ShaperItem;
+
// needs to be != to any valid SkMask::Format
#define MASK_FORMAT_JUST_ADVANCE (0xFF)
@@ -192,6 +194,14 @@ public:
static inline void MakeRec(const SkPaint&, const SkMatrix*, Rec* rec);
static SkScalerContext* Create(const SkDescriptor*);
+#ifdef SKIA_HARFBUZZ
+ // This will fill in |item->font| and |item->face| with valid values for
+ // this font.
+ virtual void setupShaper(HB_ShaperItem* item) = 0;
+ // This will release the references held by |item->font| and |item->face|.
+ virtual void releaseShaper(HB_ShaperItem* item) = 0;
+#endif
+
protected:
Rec fRec;
unsigned fBaseGlyphCount;