diff options
author | Luboš Luňák <l.lunak@centrum.cz> | 2020-12-04 20:25:06 +0000 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-12-07 20:47:18 +0100 |
commit | daa0e2629e13883da0cb41c29fccbcff48b930c5 (patch) | |
tree | 32d5c1f2f7fe2418cca2c49388d55a61d54331e5 /vcl/inc | |
parent | db89f53c31af997b9bf422b0e784afba8d62a42e (diff) |
remove WinGlyphCache and related code
The code for separately rendering glyphs was used only by OpenGL
code (and temporarily by Skia code).
Change-Id: I8eee764045273705c108f3734b330a2237de15f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107291
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/skia/win/gdiimpl.hxx | 14 | ||||
-rw-r--r-- | vcl/inc/win/saldata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 17 | ||||
-rw-r--r-- | vcl/inc/win/wingdiimpl.hxx | 14 | ||||
-rw-r--r-- | vcl/inc/win/winlayout.hxx | 88 |
5 files changed, 0 insertions, 135 deletions
diff --git a/vcl/inc/skia/win/gdiimpl.hxx b/vcl/inc/skia/win/gdiimpl.hxx index 167b57147bf3..fd39ca273609 100644 --- a/vcl/inc/skia/win/gdiimpl.hxx +++ b/vcl/inc/skia/win/gdiimpl.hxx @@ -31,21 +31,7 @@ class SkiaCompatibleDC : public CompatibleDC public: SkiaCompatibleDC(SalGraphics& rGraphics, int x, int y, int width, int height); - virtual std::unique_ptr<Texture> getAsMaskTexture() const override; - - sk_sp<SkImage> getAsImage() const; - sk_sp<SkImage> getAsMaskImage() const; sk_sp<SkImage> getAsImageDiff(const SkiaCompatibleDC& white) const; - - struct Texture; -}; - -struct SkiaCompatibleDC::Texture : public CompatibleDC::Texture -{ - sk_sp<SkImage> image; - virtual bool isValid() const { return image.get(); } - virtual int GetWidth() const { return image->width(); } - virtual int GetHeight() const { return image->height(); } }; class WinSkiaSalGraphicsImpl : public SkiaSalGraphicsImpl, public WinSalGraphicsImplBase diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index 8d2935216d87..80286d87d347 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -42,7 +42,6 @@ class WinSalFrame; class WinSalVirtualDevice; class WinSalPrinter; namespace vcl { class Font; } -struct GlobalWinGlyphCache; struct HDCCache; struct TempFontItem; class TextOutRenderer; @@ -128,7 +127,6 @@ public: std::unique_ptr<TextOutRenderer> m_pD2DWriteTextOutRenderer; // tdf#107205 need 2 instances because D2DWrite can't rotate text std::unique_ptr<TextOutRenderer> m_pExTextOutRenderer; - std::unique_ptr<GlobalWinGlyphCache> m_pGlobalWinGlyphCache; #if HAVE_FEATURE_SKIA std::unique_ptr<SkiaControlsCache> m_pSkiaControlsCache; #endif diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index c01e9794160b..52b04aaf26b9 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -135,20 +135,6 @@ public: /// Reset the DC with the defined color. void fill(sal_uInt32 color); - - /// Base texture class (OpenGL and Skia will provide their implementations). - struct Texture; - - /// Obtain the texture in format for WinSalGraphicsImplBase::DrawTextMask(). - virtual std::unique_ptr<Texture> getAsMaskTexture() const { abort(); }; -}; - -struct CompatibleDC::Texture -{ - virtual ~Texture() {}; - virtual bool isValid() const = 0; - virtual int GetWidth() const = 0; - virtual int GetHeight() const = 0; }; class WinSalGraphics : public SalGraphics @@ -179,9 +165,6 @@ private: RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data int mnPenWidth; // line width - bool CacheGlyphs(const GenericSalLayout& rLayout); - bool DrawCachedGlyphs(const GenericSalLayout& rLayout); - public: HFONT ImplDoSetFont(FontSelectPattern const & i_rFont, const PhysicalFontFace * i_pFontFace, HFONT& o_rOldFont); diff --git a/vcl/inc/win/wingdiimpl.hxx b/vcl/inc/win/wingdiimpl.hxx index 2b1355cae9bf..6fc08f0a355a 100644 --- a/vcl/inc/win/wingdiimpl.hxx +++ b/vcl/inc/win/wingdiimpl.hxx @@ -42,20 +42,6 @@ public: // Implementation for WinSalGraphics::DrawTextLayout(). // Returns true if handled, if false, then WinSalGraphics will handle it itself. virtual bool DrawTextLayout(const GenericSalLayout&) { return false; } - // If true is returned, the following functions are used for text rendering. - virtual bool UseTextDraw() const { return false; } - virtual void PreDrawText() {} - virtual void PostDrawText() {} - virtual void DrawTextMask(CompatibleDC::Texture* /*rTexture*/, Color /*nMaskColor*/, - const SalTwoRect& /*rPosAry*/) - { - abort(); - }; - virtual void DeferredTextDraw(const CompatibleDC::Texture* /*pTexture*/, Color /*nMaskColor*/, - const SalTwoRect& /*rPosAry*/) - { - abort(); - }; }; #endif // INCLUDED_VCL_INC_WIN_WINGDIIMPL_HXX diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 35a855a3722e..b4e51d8dc4bb 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -27,90 +27,6 @@ #include <win/salgdi.h> #include <o3tl/sorted_vector.hxx> -class WinFontInstance; - -namespace -{ -// Extra space at the top and bottom of the glyph in total = tmHeight / GLYPH_SPACE_RATIO; -const int GLYPH_SPACE_RATIO = 8; -// Border size at the top of the glyph = tmHeight / GLYPH_OFFSET_RATIO; -const int GLYPH_OFFSET_RATIO = GLYPH_SPACE_RATIO * 2; -} - -struct WinGlyphDrawElement -{ - tools::Rectangle maLocation; - int maLeftOverhangs; - std::unique_ptr<CompatibleDC::Texture> maTexture; - int mnBaselineOffset; - int mnHeight; - bool mbVertical; - - int getExtraSpace() const - { - return std::max(mnHeight / GLYPH_SPACE_RATIO, 4); - } - - int getExtraOffset() const - { - return std::max(mnHeight / GLYPH_OFFSET_RATIO, 2); - } -}; - -class WinGlyphCache; - -struct GlobalWinGlyphCache -{ - o3tl::sorted_vector<WinGlyphCache*> maWinGlyphCaches; - - static GlobalWinGlyphCache * get(); - - virtual ~GlobalWinGlyphCache() {} - virtual bool AllocateTexture(WinGlyphDrawElement& rElement, CompatibleDC* dc) = 0; - virtual void NotifyElementUsed(WinGlyphDrawElement& /*rElement*/) {} - virtual void Prune() {} -}; - -class WinGlyphCache -{ -protected: - std::unordered_map<int, WinGlyphDrawElement> maWinTextureCache; - -public: - WinGlyphCache() - { - if(GlobalWinGlyphCache* c = GlobalWinGlyphCache::get()) - c->maWinGlyphCaches.insert(this); - } - - virtual ~WinGlyphCache() - { - if(GlobalWinGlyphCache* c = GlobalWinGlyphCache::get()) - c->maWinGlyphCaches.erase(this); - } - - void PutDrawElementInCache(WinGlyphDrawElement&& rElement, int nGlyphIndex) - { - assert(GlobalWinGlyphCache::get()); - assert(!IsGlyphCached(nGlyphIndex)); - maWinTextureCache[nGlyphIndex] = std::move( rElement ); - } - - WinGlyphDrawElement& GetDrawElement(int nGlyphIndex) - { - assert(GlobalWinGlyphCache::get()); - assert(IsGlyphCached(nGlyphIndex)); - WinGlyphDrawElement& element = maWinTextureCache[nGlyphIndex]; - GlobalWinGlyphCache::get()->NotifyElementUsed(element); - return element; - } - - bool IsGlyphCached(int nGlyphIndex) const - { - return maWinTextureCache.find(nGlyphIndex) != maWinTextureCache.end(); - } -}; - // win32 specific logical font instance class WinFontInstance : public LogicalFontInstance { @@ -135,9 +51,6 @@ public: const WinFontFace * GetFontFace() const { return static_cast<const WinFontFace *>(LogicalFontInstance::GetFontFace()); } WinFontFace * GetFontFace() { return static_cast<WinFontFace *>(LogicalFontInstance::GetFontFace()); } - bool CacheGlyphToAtlas(HDC hDC, HFONT hFont, int nGlyphIndex, SalGraphics& rGraphics, const GenericSalLayout& rLayout); - WinGlyphCache& GetWinGlyphCache() { return maWinGlyphCache; } - bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const override; private: @@ -149,7 +62,6 @@ private: WinSalGraphics *m_pGraphics; HFONT m_hFont; float m_fScale; - WinGlyphCache maWinGlyphCache; }; class TextOutRenderer |