Kaydet (Commit) a1e1453f authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Andras Timar

(disabled) Initial work for OpenGL glyph caching on Windows

Shows text roughly correctly, but many problems. Conditional at
run-time on the SAL_ENABLE_GLYPH_CACHING environment variable in
addition to SAL_FORCEGL.

One obvious thing that needs fixing is making sure that the glyphs are
rendered into the texture without overlap. Compensating negative
values in the ABC::abcA and ABC::abdC width is not enough.

Also, the cache should be changed to actually have "cache"
functionality, i.e. entries should expire based on some criterion.

Change-Id: I66a37d3354a09011a654f15a7d2bd8efaa14ad1e
Signed-off-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst af873402
......@@ -187,6 +187,7 @@ class WinSalGraphics : public SalGraphics
friend class ScopedFont;
friend class OpenGLCompatibleDC;
friend class WinLayout;
friend class UniscribeLayout;
protected:
std::unique_ptr<SalGraphicsImpl> mpImpl;
......
......@@ -54,7 +54,9 @@ public:
/// Draw to the provided HDC.
virtual void DrawTextImpl(HDC hDC) const = 0;
protected:
virtual bool CacheGlyphs(SalGraphics& rGraphics) const = 0;
virtual bool DrawCachedGlyphs(SalGraphics& rGraphics) const = 0;
HDC mhDC; // WIN32 device handle
HFONT mhFont; // WIN32 font handle
int mnBaseAdv; // x-offset relative to Layout origin
......@@ -73,6 +75,8 @@ public:
virtual bool LayoutText( ImplLayoutArgs& ) SAL_OVERRIDE;
virtual void AdjustLayout( ImplLayoutArgs& ) SAL_OVERRIDE;
virtual void DrawTextImpl(HDC hDC) const SAL_OVERRIDE;
virtual bool CacheGlyphs(SalGraphics& rGraphics) const SAL_OVERRIDE;
virtual bool DrawCachedGlyphs(SalGraphics& rGraphics) const SAL_OVERRIDE;
virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
DeviceCoordinate* pGlyphAdvances, int* pCharPosAry,
const PhysicalFontFace** pFallbackFonts = NULL ) const SAL_OVERRIDE;
......@@ -160,6 +164,8 @@ public:
virtual bool LayoutText( ImplLayoutArgs& ) SAL_OVERRIDE; // first step of layout
virtual void AdjustLayout( ImplLayoutArgs& ) SAL_OVERRIDE; // adjusting after fallback etc.
virtual void DrawTextImpl(HDC hDC) const SAL_OVERRIDE;
virtual bool CacheGlyphs(SalGraphics& rGraphics) const SAL_OVERRIDE;
virtual bool DrawCachedGlyphs(SalGraphics& rGraphics) const SAL_OVERRIDE;
// methods using string indexing
virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, DeviceCoordinate nCharExtra=0, int nFactor=1) const SAL_OVERRIDE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment