summaryrefslogtreecommitdiff
path: root/vcl/inc/win
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-10-25 16:29:49 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-11-27 09:55:12 +0100
commit5ac9a62f3a354db80837bdd1c95b763989b303bb (patch)
tree94a5bd6875589fa3827c20b84a5edee9da60090b /vcl/inc/win
parentaa08385d1a07c530d32de91b633dbe087a3848ba (diff)
fix Skia Windows text rendering
There are two cases in WinSalGraphics::DrawTextLayout(), with and without cached glyphs: - Cached case DeferredTextDraw() gets data as BGRA with the glyph drawn in white, it just needs to be modulated to the proper color and drawn. - Uncached case DrawTextMask() gets data as BGRA with A invalid, it must be used as mask for the color to drawn, but without the inverse alpha VCL idiosyncracy that DrawMask() handles. Change-Id: I05dcec994df68d5986cd85cffa42a8f9f23c42c4
Diffstat (limited to 'vcl/inc/win')
-rw-r--r--vcl/inc/win/salgdi.h7
-rw-r--r--vcl/inc/win/wingdiimpl.hxx4
2 files changed, 7 insertions, 4 deletions
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index f7fb206624b5..fc12bc823b93 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -138,11 +138,14 @@ public:
/// Base texture class (OpenGL and Skia will provide their implementations).
struct Texture;
- /// Obtain the texture.
- virtual std::unique_ptr<Texture> getTexture() { abort(); };
+ /// Obtain the texture in format for WinSalGraphicsImplBase::DrawTextMask().
+ virtual std::unique_ptr<Texture> getAsMaskTexture() { abort(); };
/// Copy bitmap data to the texture. Texture must be initialized and the correct size to hold the bitmap.
virtual bool copyToTexture(Texture& /*aTexture*/) { abort(); };
+
+ /// Return true if text glyphs should be drawn as white instead of black.
+ virtual bool wantsTextColorWhite() const { return false; }
};
struct CompatibleDC::Texture
diff --git a/vcl/inc/win/wingdiimpl.hxx b/vcl/inc/win/wingdiimpl.hxx
index 2264eecf353d..84884220318f 100644
--- a/vcl/inc/win/wingdiimpl.hxx
+++ b/vcl/inc/win/wingdiimpl.hxx
@@ -39,8 +39,8 @@ public:
virtual bool UseTextDraw() const { return false; }
virtual void PreDrawText() {}
virtual void PostDrawText() {}
- virtual void DrawMask(CompatibleDC::Texture* /*rTexture*/, Color /*nMaskColor*/,
- const SalTwoRect& /*rPosAry*/)
+ virtual void DrawTextMask(CompatibleDC::Texture* /*rTexture*/, Color /*nMaskColor*/,
+ const SalTwoRect& /*rPosAry*/)
{
abort();
};