[Libreoffice-commits] core.git: vcl/win
Tor Lillqvist
tml at collabora.com
Mon Dec 7 08:05:11 PST 2015
vcl/win/gdi/winlayout.cxx | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
New commits:
commit e9da0f499c39f9607d67ec344dff1b83dae1bfa2
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Dec 7 18:02:33 2015 +0200
Do turn on GL_BLEND for the GLyphy crack
That is what GLyphy's demo_glstate_setup() does, and it does seems to
help a bit.
Change-Id: I03703def86558a8689c427bcbb62cd218b9a111f
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 3afa26e..0bed284 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -1867,6 +1867,20 @@ bool UniscribeLayout::DrawCachedGlyphsUsingGLyphy(SalGraphics& rGraphics) const
pImpl->PreDraw();
rGraphics.GetOpenGLContext()->UseNoProgram();
+
+#if 0
+ HDC hDC = rGraphics.GetOpenGLContext()->getOpenGLWindow().hDC;
+ HBITMAP hbitmap = (HBITMAP)GetCurrentObject(hDC, OBJ_BITMAP);
+
+ SAL_ DEBUG("hdc=" << hDC << " hbitmap=" << hbitmap);
+ if (hbitmap != NULL) {
+ BITMAP bm;
+ GetObjectW(hbitmap, sizeof(bm), &bm);
+ SAL_ DEBUG(" size=" << bm.bmWidth << "x" << bm.bmHeight <<
+ " bpp=" << bm.bmBitsPixel);
+ }
+#endif
+
glUseProgram( mrWinFontEntry.mnGLyphyProgram );
CHECK_GL_ERROR();
demo_atlas_set_uniforms( mrWinFontEntry.mpGLyphyAtlas );
@@ -1875,7 +1889,7 @@ bool UniscribeLayout::DrawCachedGlyphsUsingGLyphy(SalGraphics& rGraphics) const
nLoc = glGetUniformLocation( mrWinFontEntry.mnGLyphyProgram, "u_debug" );
CHECK_GL_ERROR();
- glUniform1f( nLoc, 0 ); // FIXME: Try to get the "debug" thing displayed first
+ glUniform1f( nLoc, 0 );
CHECK_GL_ERROR();
nLoc = glGetUniformLocation( mrWinFontEntry.mnGLyphyProgram, "u_contrast" );
@@ -1903,6 +1917,23 @@ bool UniscribeLayout::DrawCachedGlyphsUsingGLyphy(SalGraphics& rGraphics) const
glUniform1f( nLoc, 0 );
CHECK_GL_ERROR();
+ glEnable(GL_BLEND);
+ CHECK_GL_ERROR();
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ CHECK_GL_ERROR();
+
+#if 0
+ // glyphy-demo sets sRGB on initially, and there it has a perhaps beneficial effect,
+ // but doesn't help very much here, if at all
+ GLboolean available = false;
+ if ((glewIsSupported("GL_ARB_framebuffer_sRGB") || glewIsSupported("GL_EXT_framebuffer_sRGB")) &&
+ (glGetBooleanv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, &available), available))
+ {
+ glEnable(GL_FRAMEBUFFER_SRGB);
+ CHECK_GL_ERROR();
+ }
+#endif
+
// FIXME: This code snippet is mostly copied from the one in
// UniscribeLayout::DrawTextImpl. Should be factored out.
int nBaseClusterOffset = 0;
More information about the Libreoffice-commits
mailing list