summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-12-07 18:02:33 +0200
committerTor Lillqvist <tml@collabora.com>2015-12-07 18:04:20 +0200
commite9da0f499c39f9607d67ec344dff1b83dae1bfa2 (patch)
treeb352a589241fa0cf2f797d50b8dc318766c9ba4b /vcl/win
parent3decff7736a46e19e4296a4eedb3c917f02d3b97 (diff)
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
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/gdi/winlayout.cxx33
1 files changed, 32 insertions, 1 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 3afa26efdc67..0bed284726e7 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;