[Libreoffice-commits] core.git: Branch 'feature/commonsallayout' - 10 commits - configure.ac external/harfbuzz vcl/headless vcl/inc vcl/Library_vcl.mk vcl/quartz vcl/README.vars vcl/source vcl/unx vcl

2016-08-26 Thread Akash Jain
Rebased ref, commits from common ancestor:
commit 76f46abe3cac3174b95f21868422bb616dbd85e8
Author: Akash Jain 
Date:   Wed Aug 17 21:31:22 2016 +0530

GSoC: Speed up CommonSalLayout by caching hb_face

Cache hb_face so it is not created again and again.
Switch from GDI to DirectWrite on Windows to obtain SFNT table data.

Change-Id: I9c532cd72e1f6b57313f3b7d42a6b9b0633eb0ef

diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index 53d4468..fdb74a3 100755
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -40,6 +40,7 @@ class CommonSalLayout : public GenericSalLayout
 #ifdef _WIN32
 HDC   mhDC;
 HFONT mhFont;
+D2DWriteTextOutRenderer* mpD2DRenderer;
 #elif defined(MACOSX) || defined(IOS)
 const CoreTextStyle& mrCoreTextStyle;
 #else
@@ -49,7 +50,7 @@ class CommonSalLayout : public GenericSalLayout
 hb_font_t*  GetHBFont();
 public:
 #if defined(_WIN32)
-explicitCommonSalLayout(HDC, WinFontInstance&);
+explicitCommonSalLayout(WinSalGraphics*, WinFontInstance&, 
const WinFontFace&);
 virtual voidInitFont() const override;
 #elif defined(MACOSX) || defined(IOS)
 explicitCommonSalLayout(const CoreTextStyle&);
@@ -59,7 +60,6 @@ public:
 const ServerFont&   getFontData() const { return mrServerFont; };
 #endif
 
-virtual ~CommonSalLayout();
 voidSetNeedFallback(ImplLayoutArgs&, sal_Int32, bool);
 voidAdjustLayout(ImplLayoutArgs&) override;
 virtual boolLayoutText(ImplLayoutArgs&) override;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 7578768..678b0d1 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -45,6 +45,7 @@
 
 #include "quartz/salgdicommon.hxx"
 #include 
+#include 
 
 class AquaSalFrame;
 class FontAttributes;
@@ -98,6 +99,8 @@ public:
 void   GetFontMetric( ImplFontMetricDataPtr& ) const;
 bool   GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const;
 bool   GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const;
+hb_face_t* GetHBFace() const { return mpHBFace; }
+void   SetHBFace(hb_face_t* pHBFace) const { mpHBFace = pHBFace; }
 
 const CoreTextFontFace*  mpFontData;
 /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0
@@ -109,6 +112,7 @@ public:
 private:
 /// CoreText text style object
 CFMutableDictionaryRef  mpStyleDict;
+mutable hb_face_t*  mpHBFace;
 
 friend class CTLayout;
 friend class AquaSalGraphics;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 04723cb..1c356c5 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -35,6 +35,7 @@
 #include 
 #include "fontattributes.hxx"
 #include "impfontmetricdata.hxx"
+#include "hb-ot.h"
 
 #include 
 
@@ -181,6 +182,8 @@ public:
 sal_GlyphId FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 ) 
const;
 boolGetGlyphOutline( sal_GlyphId aGlyphId, 
basegfx::B2DPolyPolygon& ) const;
 boolGetAntialiasAdvice() const;
+hb_face_t*  GetHBFace() { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) { 
mpHBFace=pHBFace; }
 
 private:
 friend class GlyphCache;
@@ -240,6 +243,7 @@ private:
 GlyphSubstitution   maGlyphSubstitution;
 
 ServerFontLayoutEngine* mpLayoutEngine;
+hb_face_t*  mpHBFace;
 };
 
 // a class for cache entries for physical font instances that are based on 
serverfonts
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index bc5165d..961cb47 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -44,6 +44,9 @@
 #  include "postwin.h"
 #endif
 
+#include 
+#include 
+
 class FontSelectPattern;
 class WinFontInstance;
 class ImplFontAttrCache;
@@ -139,10 +142,12 @@ private:
 
 mutable std::unordered_set  maGsubTable;
 mutable boolmbGsubRead;
+mutable hb_face_t*  mpHBFace;
 public:
 boolHasGSUBstitutions( HDC ) const;
 boolIsGSUBstituted( sal_UCS4 ) const;
-static int  GetTable( const char pTagName[5], const unsigned 
char*&, HDC );
+hb_face_t*  GetHBFace() const { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) const { mpHBFace = 
pHBFace; }
 };
 
 /** Class that creates (and destroys) a compatible Device Context.
@@ -354,6 +359,7 @@ private:
 sal_uLong   GetKernPairs();
 
 public:
+sal_uLong   GetTable( const char pTagName[5], const unsigned 
char*&, void*&, IDWriteFontFace*& );
 // public SalGraphics methods, the interface to the independent vcl part
 
 // get device resolution
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index c7b54d3..d315705 

[Libreoffice-commits] core.git: Branch 'feature/commonsallayout' - 10 commits - configure.ac external/harfbuzz vcl/headless vcl/inc vcl/Library_vcl.mk vcl/quartz vcl/README.vars vcl/source vcl/unx vcl

2016-08-26 Thread Akash Jain
Rebased ref, commits from common ancestor:
commit 0f4202b37a5662954caa6587025b0d2afe789c31
Author: Akash Jain 
Date:   Wed Aug 17 21:31:22 2016 +0530

GSoC: Speed up CommonSalLayout by caching hb_face

Cache hb_face so it is not created again and again.
Switch from GDI to DirectWrite on Windows to obtain SFNT table data.

Change-Id: I9c532cd72e1f6b57313f3b7d42a6b9b0633eb0ef

diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index 01641ad..90aa84b 100755
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -40,6 +40,7 @@ class CommonSalLayout : public GenericSalLayout
 #ifdef _WIN32
 HDC   mhDC;
 HFONT mhFont;
+D2DWriteTextOutRenderer* mpD2DRenderer;
 #elif defined(MACOSX) || defined(IOS)
 const CoreTextStyle& mrCoreTextStyle;
 #else
@@ -48,7 +49,7 @@ class CommonSalLayout : public GenericSalLayout
 
 public:
 #if defined(_WIN32)
-explicitCommonSalLayout(HDC, WinFontInstance&);
+explicitCommonSalLayout(WinSalGraphics*, WinFontInstance&, 
const WinFontFace&);
 virtual voidInitFont() const override;
 #elif defined(MACOSX) || defined(IOS)
 explicitCommonSalLayout(const CoreTextStyle&);
@@ -58,7 +59,6 @@ public:
 const ServerFont&   getFontData() const { return mrServerFont; };
 #endif
 
-virtual ~CommonSalLayout();
 voidSetNeedFallback(ImplLayoutArgs&, sal_Int32, bool);
 voidAdjustLayout(ImplLayoutArgs&) override;
 virtual boolLayoutText(ImplLayoutArgs&) override;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 7578768..678b0d1 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -45,6 +45,7 @@
 
 #include "quartz/salgdicommon.hxx"
 #include 
+#include 
 
 class AquaSalFrame;
 class FontAttributes;
@@ -98,6 +99,8 @@ public:
 void   GetFontMetric( ImplFontMetricDataPtr& ) const;
 bool   GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const;
 bool   GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const;
+hb_face_t* GetHBFace() const { return mpHBFace; }
+void   SetHBFace(hb_face_t* pHBFace) const { mpHBFace = pHBFace; }
 
 const CoreTextFontFace*  mpFontData;
 /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0
@@ -109,6 +112,7 @@ public:
 private:
 /// CoreText text style object
 CFMutableDictionaryRef  mpStyleDict;
+mutable hb_face_t*  mpHBFace;
 
 friend class CTLayout;
 friend class AquaSalGraphics;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 04723cb..1c356c5 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -35,6 +35,7 @@
 #include 
 #include "fontattributes.hxx"
 #include "impfontmetricdata.hxx"
+#include "hb-ot.h"
 
 #include 
 
@@ -181,6 +182,8 @@ public:
 sal_GlyphId FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 ) 
const;
 boolGetGlyphOutline( sal_GlyphId aGlyphId, 
basegfx::B2DPolyPolygon& ) const;
 boolGetAntialiasAdvice() const;
+hb_face_t*  GetHBFace() { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) { 
mpHBFace=pHBFace; }
 
 private:
 friend class GlyphCache;
@@ -240,6 +243,7 @@ private:
 GlyphSubstitution   maGlyphSubstitution;
 
 ServerFontLayoutEngine* mpLayoutEngine;
+hb_face_t*  mpHBFace;
 };
 
 // a class for cache entries for physical font instances that are based on 
serverfonts
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index bc5165d..961cb47 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -44,6 +44,9 @@
 #  include "postwin.h"
 #endif
 
+#include 
+#include 
+
 class FontSelectPattern;
 class WinFontInstance;
 class ImplFontAttrCache;
@@ -139,10 +142,12 @@ private:
 
 mutable std::unordered_set  maGsubTable;
 mutable boolmbGsubRead;
+mutable hb_face_t*  mpHBFace;
 public:
 boolHasGSUBstitutions( HDC ) const;
 boolIsGSUBstituted( sal_UCS4 ) const;
-static int  GetTable( const char pTagName[5], const unsigned 
char*&, HDC );
+hb_face_t*  GetHBFace() const { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) const { mpHBFace = 
pHBFace; }
 };
 
 /** Class that creates (and destroys) a compatible Device Context.
@@ -354,6 +359,7 @@ private:
 sal_uLong   GetKernPairs();
 
 public:
+sal_uLong   GetTable( const char pTagName[5], const unsigned 
char*&, void*&, IDWriteFontFace*& );
 // public SalGraphics methods, the interface to the independent vcl part
 
 // get device resolution
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index c7b54d3..d315705 100644
--- a/vcl/quartz/ctfonts.cxx
+++ 

[Libreoffice-commits] core.git: Branch 'feature/commonsallayout' - 10 commits - configure.ac external/harfbuzz vcl/headless vcl/inc vcl/Library_vcl.mk vcl/quartz vcl/README.vars vcl/source vcl/unx vcl

2016-08-19 Thread Akash Jain
Rebased ref, commits from common ancestor:
commit 566a458af57f20bead84de7daf6b56b620345c32
Author: Akash Jain 
Date:   Wed Aug 17 21:31:22 2016 +0530

GSoC: Speed up CommonSalLayout by caching hb_face

Cache hb_face so it is not created again and again.
Switch from GDI to DirectWrite on Windows to obtain SFNT table data.

Change-Id: I9c532cd72e1f6b57313f3b7d42a6b9b0633eb0ef

diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index 01641ad..90aa84b 100755
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -40,6 +40,7 @@ class CommonSalLayout : public GenericSalLayout
 #ifdef _WIN32
 HDC   mhDC;
 HFONT mhFont;
+D2DWriteTextOutRenderer* mpD2DRenderer;
 #elif defined(MACOSX) || defined(IOS)
 const CoreTextStyle& mrCoreTextStyle;
 #else
@@ -48,7 +49,7 @@ class CommonSalLayout : public GenericSalLayout
 
 public:
 #if defined(_WIN32)
-explicitCommonSalLayout(HDC, WinFontInstance&);
+explicitCommonSalLayout(WinSalGraphics*, WinFontInstance&, 
const WinFontFace&);
 virtual voidInitFont() const override;
 #elif defined(MACOSX) || defined(IOS)
 explicitCommonSalLayout(const CoreTextStyle&);
@@ -58,7 +59,6 @@ public:
 const ServerFont&   getFontData() const { return mrServerFont; };
 #endif
 
-virtual ~CommonSalLayout();
 voidSetNeedFallback(ImplLayoutArgs&, sal_Int32, bool);
 voidAdjustLayout(ImplLayoutArgs&) override;
 virtual boolLayoutText(ImplLayoutArgs&) override;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 7578768..678b0d1 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -45,6 +45,7 @@
 
 #include "quartz/salgdicommon.hxx"
 #include 
+#include 
 
 class AquaSalFrame;
 class FontAttributes;
@@ -98,6 +99,8 @@ public:
 void   GetFontMetric( ImplFontMetricDataPtr& ) const;
 bool   GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const;
 bool   GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const;
+hb_face_t* GetHBFace() const { return mpHBFace; }
+void   SetHBFace(hb_face_t* pHBFace) const { mpHBFace = pHBFace; }
 
 const CoreTextFontFace*  mpFontData;
 /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0
@@ -109,6 +112,7 @@ public:
 private:
 /// CoreText text style object
 CFMutableDictionaryRef  mpStyleDict;
+mutable hb_face_t*  mpHBFace;
 
 friend class CTLayout;
 friend class AquaSalGraphics;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 04723cb..1c356c5 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -35,6 +35,7 @@
 #include 
 #include "fontattributes.hxx"
 #include "impfontmetricdata.hxx"
+#include "hb-ot.h"
 
 #include 
 
@@ -181,6 +182,8 @@ public:
 sal_GlyphId FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 ) 
const;
 boolGetGlyphOutline( sal_GlyphId aGlyphId, 
basegfx::B2DPolyPolygon& ) const;
 boolGetAntialiasAdvice() const;
+hb_face_t*  GetHBFace() { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) { 
mpHBFace=pHBFace; }
 
 private:
 friend class GlyphCache;
@@ -240,6 +243,7 @@ private:
 GlyphSubstitution   maGlyphSubstitution;
 
 ServerFontLayoutEngine* mpLayoutEngine;
+hb_face_t*  mpHBFace;
 };
 
 // a class for cache entries for physical font instances that are based on 
serverfonts
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index bc5165d..961cb47 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -44,6 +44,9 @@
 #  include "postwin.h"
 #endif
 
+#include 
+#include 
+
 class FontSelectPattern;
 class WinFontInstance;
 class ImplFontAttrCache;
@@ -139,10 +142,12 @@ private:
 
 mutable std::unordered_set  maGsubTable;
 mutable boolmbGsubRead;
+mutable hb_face_t*  mpHBFace;
 public:
 boolHasGSUBstitutions( HDC ) const;
 boolIsGSUBstituted( sal_UCS4 ) const;
-static int  GetTable( const char pTagName[5], const unsigned 
char*&, HDC );
+hb_face_t*  GetHBFace() const { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) const { mpHBFace = 
pHBFace; }
 };
 
 /** Class that creates (and destroys) a compatible Device Context.
@@ -354,6 +359,7 @@ private:
 sal_uLong   GetKernPairs();
 
 public:
+sal_uLong   GetTable( const char pTagName[5], const unsigned 
char*&, void*&, IDWriteFontFace*& );
 // public SalGraphics methods, the interface to the independent vcl part
 
 // get device resolution
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index c7b54d3..d315705 100644
--- a/vcl/quartz/ctfonts.cxx
+++ 

[Libreoffice-commits] core.git: Branch 'feature/commonsallayout' - 10 commits - configure.ac external/harfbuzz vcl/headless vcl/inc vcl/Library_vcl.mk vcl/quartz vcl/README.vars vcl/source vcl/unx vcl

2016-08-19 Thread Akash Jain
Rebased ref, commits from common ancestor:
commit d9fc8e39c5456b6cbc1b4e643f58606ea2d82a7c
Author: Akash Jain 
Date:   Wed Aug 17 21:31:22 2016 +0530

GSoC: Speed up CommonSalLayout by caching hb_face

Cache hb_face so it is not created again and again.
Switch from GDI to DirectWrite on Windows to obtain SFNT table data.

Change-Id: I9c532cd72e1f6b57313f3b7d42a6b9b0633eb0ef

diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx
index 01641ad..90aa84b 100755
--- a/vcl/inc/CommonSalLayout.hxx
+++ b/vcl/inc/CommonSalLayout.hxx
@@ -40,6 +40,7 @@ class CommonSalLayout : public GenericSalLayout
 #ifdef _WIN32
 HDC   mhDC;
 HFONT mhFont;
+D2DWriteTextOutRenderer* mpD2DRenderer;
 #elif defined(MACOSX) || defined(IOS)
 const CoreTextStyle& mrCoreTextStyle;
 #else
@@ -48,7 +49,7 @@ class CommonSalLayout : public GenericSalLayout
 
 public:
 #if defined(_WIN32)
-explicitCommonSalLayout(HDC, WinFontInstance&);
+explicitCommonSalLayout(WinSalGraphics*, WinFontInstance&, 
const WinFontFace&);
 virtual voidInitFont() const override;
 #elif defined(MACOSX) || defined(IOS)
 explicitCommonSalLayout(const CoreTextStyle&);
@@ -58,7 +59,6 @@ public:
 const ServerFont&   getFontData() const { return mrServerFont; };
 #endif
 
-virtual ~CommonSalLayout();
 voidSetNeedFallback(ImplLayoutArgs&, sal_Int32, bool);
 voidAdjustLayout(ImplLayoutArgs&) override;
 virtual boolLayoutText(ImplLayoutArgs&) override;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 7578768..678b0d1 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -45,6 +45,7 @@
 
 #include "quartz/salgdicommon.hxx"
 #include 
+#include 
 
 class AquaSalFrame;
 class FontAttributes;
@@ -98,6 +99,8 @@ public:
 void   GetFontMetric( ImplFontMetricDataPtr& ) const;
 bool   GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const;
 bool   GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const;
+hb_face_t* GetHBFace() const { return mpHBFace; }
+void   SetHBFace(hb_face_t* pHBFace) const { mpHBFace = pHBFace; }
 
 const CoreTextFontFace*  mpFontData;
 /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0
@@ -109,6 +112,7 @@ public:
 private:
 /// CoreText text style object
 CFMutableDictionaryRef  mpStyleDict;
+mutable hb_face_t*  mpHBFace;
 
 friend class CTLayout;
 friend class AquaSalGraphics;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 04723cb..1c356c5 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -35,6 +35,7 @@
 #include 
 #include "fontattributes.hxx"
 #include "impfontmetricdata.hxx"
+#include "hb-ot.h"
 
 #include 
 
@@ -181,6 +182,8 @@ public:
 sal_GlyphId FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 ) 
const;
 boolGetGlyphOutline( sal_GlyphId aGlyphId, 
basegfx::B2DPolyPolygon& ) const;
 boolGetAntialiasAdvice() const;
+hb_face_t*  GetHBFace() { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) { 
mpHBFace=pHBFace; }
 
 private:
 friend class GlyphCache;
@@ -240,6 +243,7 @@ private:
 GlyphSubstitution   maGlyphSubstitution;
 
 ServerFontLayoutEngine* mpLayoutEngine;
+hb_face_t*  mpHBFace;
 };
 
 // a class for cache entries for physical font instances that are based on 
serverfonts
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index bc5165d..961cb47 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -44,6 +44,9 @@
 #  include "postwin.h"
 #endif
 
+#include 
+#include 
+
 class FontSelectPattern;
 class WinFontInstance;
 class ImplFontAttrCache;
@@ -139,10 +142,12 @@ private:
 
 mutable std::unordered_set  maGsubTable;
 mutable boolmbGsubRead;
+mutable hb_face_t*  mpHBFace;
 public:
 boolHasGSUBstitutions( HDC ) const;
 boolIsGSUBstituted( sal_UCS4 ) const;
-static int  GetTable( const char pTagName[5], const unsigned 
char*&, HDC );
+hb_face_t*  GetHBFace() const { return mpHBFace; }
+voidSetHBFace( hb_face_t* pHBFace ) const { mpHBFace = 
pHBFace; }
 };
 
 /** Class that creates (and destroys) a compatible Device Context.
@@ -354,6 +359,7 @@ private:
 sal_uLong   GetKernPairs();
 
 public:
+sal_uLong   GetTable( const char pTagName[5], const unsigned 
char*&, void*&, IDWriteFontFace*& );
 // public SalGraphics methods, the interface to the independent vcl part
 
 // get device resolution
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index c7b54d3..d315705 100644
--- a/vcl/quartz/ctfonts.cxx
+++ 

[Libreoffice-commits] core.git: Branch 'feature/commonsallayout' - 10 commits - configure.ac external/harfbuzz vcl/headless vcl/inc vcl/Library_vcl.mk vcl/quartz vcl/README.vars vcl/source vcl/unx vcl

2016-07-23 Thread Akash Jain
Rebased ref, commits from common ancestor:
commit 87c73cba22d64ebd2f4ae05365b038463e700598
Author: Akash Jain 
Date:   Sat Jul 23 21:41:40 2016 +0530

GSoC: Add Graphite support in CommonSalLayout

Enable Graphite font rendering in CommonSalLayout through Harfbuzz

Change-Id: Ia6a00a1bb6ea1a7bd705ed91d4f4f6cb9803e062

diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx 
b/vcl/unx/generic/gdi/cairotextrender.cxx
index 10079c9..9340e02 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -504,7 +504,14 @@ SalLayout* CairoTextRender::GetTextLayout( ImplLayoutArgs& 
rArgs, int nFallbackL
 if (!bDisableGraphite_ &&
 
GraphiteServerFontLayout::IsGraphiteEnabledFont(*mpServerFont[nFallbackLevel]))
 {
-pLayout = new 
GraphiteServerFontLayout(*mpServerFont[nFallbackLevel]);
+if(getenv("SAL_USE_COMMON_LAYOUT"))
+{
+pLayout = new CommonSalLayout( *mpServerFont[ nFallbackLevel ] 
);
+}
+else
+{
+pLayout = new 
GraphiteServerFontLayout(*mpServerFont[nFallbackLevel]);
+}
 }
 else
 #endif
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 64540c7..ddeb7b7 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -68,7 +68,7 @@ public:
 
 virtual ~TextOutRenderer() = default;
 
-virtual bool operator ()(WinLayout const , HDC hDC,
+virtual bool operator ()(SalLayout const , HDC hDC,
 const Rectangle* pRectToErase,
 Point* pPos, int* pGetNextGlypInfo) = 0;
 };
@@ -82,7 +82,7 @@ public:
 explicit ExTextOutRenderer() = default;
 virtual ~ExTextOutRenderer() override = default;
 
-bool operator ()(WinLayout const , HDC hDC,
+bool operator ()(SalLayout const , HDC hDC,
 const Rectangle* pRectToErase,
 Point* pPos, int* pGetNextGlypInfo) override;
 };
@@ -106,7 +106,7 @@ public:
 explicit D2DWriteTextOutRenderer();
 virtual ~D2DWriteTextOutRenderer() override;
 
-bool operator ()(WinLayout const , HDC hDC,
+bool operator ()(SalLayout const , HDC hDC,
 const Rectangle* pRectToErase,
 Point* pPos, int* pGetNextGlypInfo) override;
 
@@ -138,7 +138,7 @@ private:
 D2DWriteTextOutRenderer & operator = (const D2DWriteTextOutRenderer &) = 
delete;
 
 bool GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** ppFontFace, float * 
lfSize) const;
-bool GetDWriteInkBox(IDWriteFontFace & rFontFace, WinLayout const 
, float const lfEmHeight, Rectangle &) const;
+bool GetDWriteInkBox(IDWriteFontFace & rFontFace, SalLayout const 
, float const lfEmHeight, Rectangle &) const;
 bool DrawGlyphs(const Point & origin, uint16_t * pGid, uint16_t * pGidEnd,
 float * pAdvances, Point * pOffsets) /*override*/;
 
@@ -3474,7 +3474,7 @@ TextOutRenderer & TextOutRenderer::get()
 }
 
 
-bool ExTextOutRenderer::operator ()(WinLayout const , HDC hDC,
+bool ExTextOutRenderer::operator ()(SalLayout const , HDC hDC,
 const Rectangle* pRectToErase,
 Point* pPos, int* pGetNextGlypInfo)
 {
@@ -3533,7 +3533,7 @@ D2DWriteTextOutRenderer::~D2DWriteTextOutRenderer()
 CleanupModules();
 }
 
-bool D2DWriteTextOutRenderer::operator ()(WinLayout const , HDC hDC,
+bool D2DWriteTextOutRenderer::operator ()(SalLayout const , HDC hDC,
 const Rectangle* pRectToErase,
 Point* pPos, int* pGetNextGlypInfo)
 {
@@ -3773,7 +3773,7 @@ bool D2DWriteTextOutRenderer::GetDWriteFaceFromHDC(HDC 
hDC, IDWriteFontFace ** p
 return succeeded;
 }
 
-bool D2DWriteTextOutRenderer::GetDWriteInkBox(IDWriteFontFace & rFontFace, 
WinLayout const , float const /*lfEmHeight*/, Rectangle & rOut) const
+bool D2DWriteTextOutRenderer::GetDWriteInkBox(IDWriteFontFace & rFontFace, 
SalLayout const , float const /*lfEmHeight*/, Rectangle & rOut) const
 {
 rOut.SetEmpty();
 
@@ -4148,20 +4148,28 @@ void WinSalGraphics::DrawSalLayout( const 
GenericSalLayout& rLayout )
 {
 HDC hDC = getHDC();
 
-Point aPos;
-sal_GlyphId aGlyphId;
-int nFetchedGlyphs = 0 ;
-
-UINT oldTa = GetTextAlign( hDC );
-SetTextAlign( hDC, ( oldTa & ~TA_NOUPDATECP ) );
-
-while( rLayout.GetNextGlyphs( 1, , aPos, nFetchedGlyphs ) )
+if((std::getenv("SAL_DWRITE_COMMON_LAYOUT")))
 {
-ExtTextOutW( hDC, aPos.X(), aPos.Y(), ETO_GLYPH_INDEX, nullptr, 
reinterpret_cast(  ),
- 1, nullptr);
+Point aPos(0, 0);
+int nGlyphCount(0);
+TextOutRenderer  = TextOutRenderer::get();
+bool result = render( rLayout, hDC, nullptr, ,  );
+assert( !result );
+}
+else
+{
+Point aPos;
+sal_GlyphId aGlyphId;
+int nFetchedGlyphs = 0;
+UINT oldTa = GetTextAlign( hDC );
+SetTextAlign( hDC, ( oldTa & ~TA_NOUPDATECP ) );
+while( rLayout.GetNextGlyphs( 1, , aPos, nFetchedGlyphs ) )
+