[Libreoffice-commits] core.git: vcl/opengl vcl/workben
vcl/opengl/gdiimpl.cxx |3 vcl/workben/vcldemo.cxx | 287 +++- 2 files changed, 263 insertions(+), 27 deletions(-) New commits: commit 368d7a1a40f14c92e06e0d0e6356f24cfb444707 Author: Michael MeeksDate: Mon Mar 7 17:14:35 2016 + vcldemo: improved text rendering test. Merge in some interesting font / unicode combinations from bugs. Change-Id: I2c89cf505a7850fcc482826328e1cdb8e37508aa Reviewed-on: https://gerrit.libreoffice.org/23056 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 24e1631..ef4f4ae 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -147,6 +147,9 @@ void OpenGLSalGraphicsImpl::Init() if( maOffscreenTex.GetWidth() != GetWidth() || maOffscreenTex.GetHeight() != GetHeight() ) { +// We don't want to be swapping before we've painted. +mpFlush->SetPriority( SchedulerPriority::POST_PAINT ); + if( maOffscreenTex && // don't work to release empty textures mpContext.is() ) // valid context { diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 3726e00..de4dce9 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -193,7 +193,7 @@ public: std::vector aRegions; // Make small cleared area for these guys -long nBorderSize = aSize.Width() / 32; +long nBorderSize = std::min(aSize.Height() / 32, aSize.Width() / 32); long nBoxWidth = (aSize.Width() - nBorderSize*(nX+1)) / nX; long nBoxHeight = (aSize.Height() - nBorderSize*(nY+1)) / nY; for (int y = 0; y < nY; y++) @@ -333,36 +333,41 @@ public: { if (rCtx.meStyle == RENDER_EXPANDED) { -std::vector aRegions(DemoRenderer::partition(rCtx, 4, 2)); -DemoRenderer::clearRects(rDev, aRegions); - -bool bClip=true, bArabicText=true, bRotate=true; - -int nRegions=0; +std::vector aToplevelRegions( +DemoRenderer::partition(rCtx, 1, 3)); +std::vector aSubRegions( +DemoRenderer::partition(aToplevelRegions[0], 4, 2)); +Rectangle aBottom(aToplevelRegions[1].TopLeft(), + aToplevelRegions[2].BottomRight()); +DemoRenderer::clearRects(rDev,aSubRegions); +struct { +bool mbClip; +bool mbArabicText; +bool mbRotate; +} aRenderData[] = { +{ false, false, false }, +{ false, true, false }, +{ false, true, true }, +{ false, false, true }, +{ true, false, true }, +{ true, true, true }, +{ true, true, false }, +{ true, false, false }, +}; -for (int nClipRow=0; nClipRow < 2; nClipRow++) +size_t i = 0; +for (int y = 0; y < 2; y++) { -if (!bArabicText) -bArabicText=true; - -for (int nArabicRow=0; nArabicRow < 2; nArabicRow++) +for (int x = 0; x < 4; x++) { -if (!bRotate) -bRotate=true; - -for (int nRotateRow=0; nRotateRow < 2; nRotateRow++) -{ -drawText( rDev, aRegions[nRegions], bClip, bArabicText, bRotate ); - -nRegions++; -bRotate=false; -} - -bArabicText=false; +assert(i < SAL_N_ELEMENTS(aRenderData)); +drawText(rDev, aSubRegions[i], aRenderData[i].mbClip, + aRenderData[i].mbArabicText, aRenderData[i].mbRotate); +i++; } - -bClip=false; } + +drawComplex(rDev, aBottom); } else { @@ -453,7 +458,7 @@ public: int nHeight = r.GetHeight(); // move the text to the bottom of the bounding rect before rotating -aFontRect.Top() += nHeight; +aFontRect.Top() += nHeight/2; aFontRect.Bottom() += nHeight; int nDegrees = 45; @@ -480,6 +485,171 @@ public: rDev.SetClipRegion(); } + +void drawComplex (OutputDevice , Rectangle r) +{ +const unsigned char pInvalid[] = { 0xfe, 0x1f }; +const
[Libreoffice-commits] core.git: vcl/opengl vcl/workben
vcl/opengl/gdiimpl.cxx |5 + vcl/workben/vcldemo.cxx |1 + 2 files changed, 6 insertions(+) New commits: commit b7d74366a9a15557a1c3dd98f019034ade137b4e Author: Michael Meeks michael.me...@collabora.com Date: Sat Nov 15 17:33:36 2014 +0100 vcldemo: disable broken gradient stencil use. Change-Id: Ifce85b1a7fa8e8b6fc57802a5fb559d2db50ba2a diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 9520c86..3690a6b 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1373,6 +1373,8 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon rPolyPoly, PreDraw(); +#define FIXME_BROKEN_STENCIL_FOR_GRADIENTS 0 +#if FIXME_BROKEN_STENCIL_FOR_GRADIENTS ImplSetClipBit( vcl::Region( rPolyPoly ), 0x02 ); if( mbUseStencil ) { @@ -1384,6 +1386,7 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon rPolyPoly, glEnable( GL_STENCIL_TEST ); glStencilFunc( GL_EQUAL, 2, 0xFF ); } +#endif // if border = 100%, draw solid rectangle with start color if( rGradient.GetBorder() = 100.0 ) @@ -1408,8 +1411,10 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon rPolyPoly, DrawRadialGradient( rGradient, aBoundRect ); } +#if FIXME_BROKEN_STENCIL_FOR_GRADIENTS if( !mbUseStencil ) glDisable( GL_STENCIL_TEST ); +#endif PostDraw(); CHECK_GL_ERROR(); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 6423b0b..a9d3634 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -200,6 +200,7 @@ public: void drawBackground(OutputDevice rDev, Rectangle r) { +rDev.Erase(); Gradient aGradient; aGradient.SetStartColor(COL_BLUE); aGradient.SetEndColor(COL_GREEN); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/opengl vcl/workben
vcl/opengl/gdiimpl.cxx |2 +- vcl/workben/vcldemo.cxx |5 - 2 files changed, 1 insertion(+), 6 deletions(-) New commits: commit 290943d20551a8504efe10f6f954aa16995bf95a Author: Michael Meeks michael.me...@collabora.com Date: Mon Nov 10 21:24:13 2014 + vcl: opengl - alpha masks are unexpectedly inverted. Change-Id: I5ebcd47e10df671bc60492bc80fc26a60f07306d diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index ca5a975..11e7d55 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -450,7 +450,7 @@ void OpenGLSalGraphicsImpl::DrawTextureWithMask( GLuint nTexture, GLuint nMask, glBindTexture( GL_TEXTURE_2D, nMask ); glEnable( GL_BLEND ); -glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); +glBlendFunc( GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA ); DrawTextureRect( rSize, pPosAry ); glDisable( GL_BLEND ); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 1142e37..cd3e32e 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -27,7 +27,6 @@ #if 0 # define FIXME_SELF_INTERSECTING_WORKING -# define FIXME_DRAW_BITMAPEX #endif using namespace css; @@ -273,11 +272,7 @@ public: for (size_t i = 0; i maIcons.size(); i++) { Size aSize(maIcons[i].GetSizePixel()); -#ifdef FIXME_DRAW_BITMAPEX rDev.DrawBitmapEx(p.TopLeft(), maIcons[i]); -#else -rDev.DrawBitmap(p.TopLeft(), maIcons[i].GetBitmap()); -#endif p.Move(aSize.Width(), 0); if (p.Left() = r.Right()) break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits