diff options
author | Akash Jain <akash96j@gmail.com> | 2016-07-06 10:15:49 +0530 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-10-18 20:41:29 +0200 |
commit | 07492d483bf4bbcc288bcca0e874142b2d9b9ae2 (patch) | |
tree | bd58fad8825f629d7e7342a5e98e436617252c98 /vcl | |
parent | 8f70e847a100295da92698dd922d9b349ccdd513 (diff) |
GSoC: Modify DrawServerFontLayout and add DrawSalLayout
Modify the definiton of the DrawServerFontLayout method.
Add new DrawSalLayout method which will be used for drawing text
independent of the platform.
Change-Id: Ie3eefb172b1781c685def1ef549db2538f672a62
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svptext.cxx | 10 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 4 | ||||
-rw-r--r-- | vcl/inc/salgdi.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/textrender.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/cairotextrender.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/genpspgraphics.h | 4 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 3 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 4 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/CommonSalLayout.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/cairotextrender.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/font.cxx | 10 | ||||
-rw-r--r-- | vcl/unx/generic/glyphs/gcach_layout.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/generic/print/genpspgraphics.cxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 2 |
16 files changed, 44 insertions, 21 deletions
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 5202109bad3e..494cadafccc7 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -23,6 +23,7 @@ #include "headless/svpgdi.hxx" #include <config_cairo_canvas.h> #include "impfontmetricdata.hxx" +#include "CommonSalLayout.hxx" void SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel ) { @@ -116,9 +117,14 @@ SalLayout* SvpSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe return m_aTextRenderImpl.GetTextLayout(rArgs, nFallbackLevel); } -void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) +void SvpSalGraphics::DrawServerFontLayout( const GenericSalLayout& rSalLayout, const ServerFont& rServerFont ) { - m_aTextRenderImpl.DrawServerFontLayout(rSalLayout ); + m_aTextRenderImpl.DrawServerFontLayout( rSalLayout, rServerFont ); +} + +void SvpSalGraphics::DrawSalLayout( const CommonSalLayout& rSalLayout ) +{ + DrawServerFontLayout( rSalLayout, rSalLayout.getFontData() ); } void SvpSalGraphics::SetTextColor( SalColor nSalColor ) diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 7d111387973c..ef723dafa029 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -166,7 +166,8 @@ public: virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) override; virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; - virtual void DrawServerFontLayout( const ServerFontLayout& ) override; + virtual void DrawSalLayout( const CommonSalLayout& ) override; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) override; virtual bool supportsOperation( OutDevSupportType ) const override; virtual void drawPixel( long nX, long nY ) override; virtual void drawPixel( long nX, long nY, SalColor nSalColor ) override; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 0f5c9f564523..ba0200b36180 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -50,6 +50,7 @@ class AquaSalFrame; class FontAttributes; class CoreTextStyle; class XorEmulation; +class CommonSalLayout; typedef sal_uInt32 sal_GlyphId; @@ -402,7 +403,8 @@ public: virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; - virtual void DrawServerFontLayout( const ServerFontLayout& ) override; + virtual void DrawSalLayout( const CommonSalLayout& ) override; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) override {}; virtual bool supportsOperation( OutDevSupportType ) const override; #ifdef MACOSX diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 0a151d25ae21..5bab4e8e930e 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -43,7 +43,8 @@ class Rectangle; class FontSubsetInfo; class OpenGLContext; class OutputDevice; -class ServerFontLayout; +class ServerFont; +class CommonSalLayout; struct SystemGraphicsData; #if ENABLE_CAIRO_CANVAS @@ -216,7 +217,8 @@ public: virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) = 0; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0; - virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0; + virtual void DrawSalLayout( const CommonSalLayout& ) = 0; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) = 0; virtual bool supportsOperation( OutDevSupportType ) const = 0; diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 70fc9d2d688c..5c4335e70fb0 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -26,7 +26,6 @@ class ImplLayoutArgs; class ImplFontMetricData; -class ServerFontLayout; class PhysicalFontCollection; class PhysicalFontFace; @@ -71,7 +70,7 @@ public: virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0; virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) = 0; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0; - virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) = 0; #if ENABLE_CAIRO_CANVAS virtual SystemFontData GetSysFontData( int nFallbackLevel ) const = 0; #endif // ENABLE_CAIRO_CANVAS diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx index 5cb39d3994a6..2eb87df615ab 100644 --- a/vcl/inc/unx/cairotextrender.hxx +++ b/vcl/inc/unx/cairotextrender.hxx @@ -88,7 +88,7 @@ public: virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) override; virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; - virtual void DrawServerFontLayout( const ServerFontLayout& ) override; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) override; #if ENABLE_CAIRO_CANVAS virtual SystemFontData GetSysFontData( int nFallbackLevel ) const override; #endif diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h index 9810d5d1e748..7691e1c7f076 100644 --- a/vcl/inc/unx/genpspgraphics.h +++ b/vcl/inc/unx/genpspgraphics.h @@ -34,6 +34,7 @@ class PhysicalFontCollection; namespace psp { struct JobData; class PrinterGfx; } class ServerFont; +class ServerFontLayout; class FontAttributes; class SalInfoPrinter; class GlyphCache; @@ -131,7 +132,8 @@ public: virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) override; virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; - virtual void DrawServerFontLayout( const ServerFontLayout& ) override; + virtual void DrawSalLayout( const CommonSalLayout& ) override {}; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) override; virtual bool supportsOperation( OutDevSupportType ) const override; virtual void drawPixel( long nX, long nY ) override; virtual void drawPixel( long nX, long nY, SalColor nSalColor ) override; diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 28d0628ba24e..63eb80a3257b 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -154,7 +154,8 @@ public: virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) override; virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; - virtual void DrawServerFontLayout( const ServerFontLayout& ) override; + virtual void DrawSalLayout( const CommonSalLayout& ) override; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) override; virtual bool supportsOperation( OutDevSupportType ) const override; virtual void drawPixel( long nX, long nY ) override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 3d5cf6286ef2..c4fb26d48a45 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -52,6 +52,7 @@ class PhysicalFontCollection; class SalGraphicsImpl; class WinOpenGLSalGraphicsImpl; class ImplFontMetricData; +class CommonSalLayout; #define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000) #define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff) @@ -449,7 +450,8 @@ public: virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; - virtual void DrawServerFontLayout( const ServerFontLayout& ) override; + virtual void DrawSalLayout( const CommonSalLayout& ) override; + virtual void DrawServerFontLayout( const GenericSalLayout&, const ServerFont& ) {}; virtual bool supportsOperation( OutDevSupportType ) const override; // Query the platform layer for control support diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 7aa50af968c1..5645a610e016 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -41,6 +41,7 @@ #include "impfont.hxx" #include "impfontcharmap.hxx" #include "impfontmetricdata.hxx" +#include "CommonSalLayout.hxx" #ifdef MACOSX #include "osx/salframe.h" @@ -413,7 +414,7 @@ bool AquaSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect return bRC; } -void AquaSalGraphics::DrawServerFontLayout( const ServerFontLayout& ) +void AquaSalGraphics::DrawSalLayout( const CommonSalLayout& ) { } diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 291153db26bc..c096f62d8ffb 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -224,9 +224,10 @@ void CommonSalLayout::AdjustLayout(ImplLayoutArgs& rArgs) } } -void CommonSalLayout::DrawText(SalGraphics&) const +void CommonSalLayout::DrawText(SalGraphics& rSalGraphics) const { //call platform dependent DrawText functions + rSalGraphics.DrawSalLayout( *this ); } bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs) diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index f697a0c84528..372cd4d135ae 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -186,7 +186,7 @@ namespace } } -void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout ) +void CairoTextRender::DrawServerFontLayout( const GenericSalLayout& rLayout, const ServerFont& rFont ) { std::vector<cairo_glyph_t> cairo_glyphs; std::vector<int> glyph_extrarotation; @@ -219,7 +219,6 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout ) if (cairo_glyphs.empty()) return; - ServerFont& rFont = rLayout.GetServerFont(); const FontSelectPattern& rFSD = rFont.GetFontSelData(); int nHeight = rFSD.mnHeight; int nWidth = rFSD.mnWidth ? rFSD.mnWidth : nHeight; diff --git a/vcl/unx/generic/gdi/font.cxx b/vcl/unx/generic/gdi/font.cxx index 36c7ecba8456..7353e24397f9 100644 --- a/vcl/unx/generic/gdi/font.cxx +++ b/vcl/unx/generic/gdi/font.cxx @@ -24,6 +24,7 @@ #include "unx/salgdi.h" #include "unx/salvd.h" #include "textrender.hxx" +#include "CommonSalLayout.hxx" GC X11SalGraphics::GetFontGC() @@ -52,9 +53,14 @@ X11SalGraphics::GetFontGC() return pFontGC_; } -void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) +void X11SalGraphics::DrawServerFontLayout( const GenericSalLayout& rLayout, const ServerFont& rServerFont ) { - mxTextRenderImpl->DrawServerFontLayout(rLayout); + mxTextRenderImpl->DrawServerFontLayout(rLayout, rServerFont); +} + +void X11SalGraphics::DrawSalLayout( const CommonSalLayout& rLayout ) +{ + DrawServerFontLayout( rLayout, rLayout.getFontData() ); } const FontCharMapRef X11SalGraphics::GetFontCharMap() const diff --git a/vcl/unx/generic/glyphs/gcach_layout.cxx b/vcl/unx/generic/glyphs/gcach_layout.cxx index 46420cb7aaad..fff581c3fd18 100644 --- a/vcl/unx/generic/glyphs/gcach_layout.cxx +++ b/vcl/unx/generic/glyphs/gcach_layout.cxx @@ -21,6 +21,7 @@ #include <sallayout.hxx> #include <salgdi.hxx> #include <scrptrun.h> +#include <unx/genpspgraphics.h> #include <i18nlangtag/mslangid.hxx> @@ -46,7 +47,7 @@ ServerFontLayout::ServerFontLayout( ServerFont& rFont ) void ServerFontLayout::DrawText( SalGraphics& rSalGraphics ) const { - rSalGraphics.DrawServerFontLayout( *this ); + rSalGraphics.DrawServerFontLayout( *this, mrServerFont ); } bool ServerFontLayout::LayoutText( ImplLayoutArgs& rArgs ) diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index 9695e979a2da..9e65be611240 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -761,7 +761,7 @@ void PspFontLayout::DrawText( SalGraphics& ) const DrawPrinterLayout( *this, mrPrinterGfx, false ); } -void GenPspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) +void GenPspGraphics::DrawServerFontLayout( const GenericSalLayout& rLayout, const ServerFont& /*unused*/ ) { // print complex text DrawPrinterLayout( rLayout, *m_pPrinterGfx, true ); diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 2fefa79deb09..55f3a2747e7d 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -2454,7 +2454,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, } } -void WinSalGraphics::DrawServerFontLayout( const ServerFontLayout& ) +void WinSalGraphics::DrawSalLayout( const CommonSalLayout& ) {} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |