summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)AuthorFilesLines
2016-05-18tdf#99574 fix sluggish scrollbar for an immediate paintTomaž Vajngerl1-0/+5
Change-Id: I34e87ac580aa1ddb6bc3851bbe99689189c787f6 (cherry picked from commit 9f0e3802e621fb02efde1778c151b93630cdd2fa) Reviewed-on: https://gerrit.libreoffice.org/24912 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-05-17tdf#98983: Use 'Microsoft Sans Serif' instead of 'MS Sans Serif'Tor Lillqvist1-0/+4
For some reason, in this branch, when OpenGL is used, the fixes by Michael Stahl to make the code avoid non-scalable fonts don't work, and text that uses the old 'MS Sans Serif' raster font just doesn't show up at all. Fix this by bluntly using the metric equivalent 'Microsoft Sans Serif' instead. Change-Id: I218328b0515ee0eb1b5a4a12ace7036322efbbaa Reviewed-on: https://gerrit.libreoffice.org/24951 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-05-17tdf#99383 vcl: don't dispatch events from SolarMutexReleaserMichael Stahl2-3/+9
Having SolarMutexReleaser effectively do Reschedule() on WNT and not on other platforms doesn't seem such a good idea. Let's try to restrict it so that it still calls ImplSalYieldMutexAcquireWithWait() but no longer dispatches messages, timers and idles. (regression from 482c52e91fe41a52e68827e9bf64a9736427d517) Change-Id: I52a2c88e9c2473e35909bf270b9e3ae7acbe0d17 (cherry picked from commit ea3ce0b3073c72f474365e438ddabd19de915b76) Reviewed-on: https://gerrit.libreoffice.org/24623 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-05-17gtk3: min slider size too small since 3.20.0Caolán McNamara1-8/+20
"GtkScrollbar:min-slider-length has been deprecated since version 3.20 and should not be used in newly-written code. Use min-height/min-width CSS properties on the slider element instead. The value of this style property is ignored." sigh.... Change-Id: I0fe44b0a3dd31bd60c07f58ae5245496a7463fe2 (cherry picked from commit 2f5bba2511ef5ef3ad92f8f9547e25128570c324) Reviewed-on: https://gerrit.libreoffice.org/25031 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
2016-05-16vcl: lstrcpynW actually takes length *including* null terminatorMichael Stahl1-2/+2
... which is surprising, but means that these arguments are too small. (cherry picked from commit 5a7b0d2c7f3a305eb5f4eb629c0a08a256cc9ae3) Change-Id: I9c58e7fefa30d19c701df4f04043ddb474b28986 Reviewed-on: https://gerrit.libreoffice.org/24947 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-05-16tdf#97249: Don't crash if BindFont failsTor Lillqvist1-1/+6
For some reason, in this branch, when OpenGL is used, the code crashes when attempting to display a Writer document that uses a non-scalable font. With this change, instead of the crash, text in such a font simply doesn't show up. This of course is not acceptable either, but better than a crash. Change-Id: I702a48fe78f2bec303aa5682dde0035275a7bb26 Reviewed-on: https://gerrit.libreoffice.org/24946 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-05-13tdf#99369: Try harder to bail out for non-horizontal textTor Lillqvist1-4/+8
Look not only for fonts with rotated glyphs (where the first character of the face name is '@') but also for font objects with non-zero orientation or escapement in general. (cherry-picked from the commit 43c95611d2621d1f2f9d60b26c07aad25c62baed) Change-Id: Ia88d38010e52ada8193f2b8057d9f3250108e9f1 Reviewed-on: https://gerrit.libreoffice.org/24929 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2016-05-11Change #include <cairo-svg.h> to <cairo.h>Korrawit Pruegsanusak1-4/+1
Since we don't need cairo's svg feature, and we build internal cairo with --disable-svg. Also remove commented-out codes which use svg. Change-Id: I5a8e8c672588bb6eca28696f21221770972ec3d3 Reviewed-on: https://gerrit.libreoffice.org/23456 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit f9ddd6e317a7bfd662516d197c3caea976aef3b3) Reviewed-on: https://gerrit.libreoffice.org/24890
2016-05-11tdf#99258 bail out if we fail to reserve the texture + moreTomaž Vajngerl5-25/+46
(cherry picked from commit d22ca8d8cb050b9006720f39c612c5c32eab8795) also includes coverity fixes from commits: coverity#1358428 fix "Null pointer dereferences" 4e07c7e279b21c4ae93b832a65e221e2dab5391d cid#1358836 reorganize to silence Resource leak in object 6e970c11645f1a05638e49da9e2911fe59628838 Check if we have an OpenGL context before using API that requires it 347e46da399b8cc96d9dd8dbfd62120db473b555 opengl: Check if texture is valid before asking for Id 0214aa8ce427905477602dbf1d55278c4959fcac Change-Id: I830e313352b69a7665bff953aadb1334be0dc847 Reviewed-on: https://gerrit.libreoffice.org/24829 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-05-10tdf#99207: Fix incorrect RGB ordering in Graphite DWrite pathTim Eves1-6/+8
Direct 2D accepts colours specified as UINT32 ARGB values or floats. However GDI presents colours as COLOREFS which are 32 bit FBGR (F is a flag not an alpha) values. Passing a COLORREF to D2D1:ColorF swaps the red and blue channels. This patch converts the COLORREF into RGB float triples using the GDI colour macros. Change-Id: Iee5c00bfb10fa8771a2a1019976f70633cca4094 Reviewed-on: https://gerrit.libreoffice.org/24819 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Martin Hosken <martin_hosken@sil.org> Reviewed-on: https://gerrit.libreoffice.org/24823
2016-05-06opengl: combined commits for state trackingTomaž Vajngerl9-99/+340
Includes commits: opengl: track state of active and bound textures in context ba0a5708803d899de4c40cfe2c1697ae83b4827a opengl: track the state of scissor test and the dimensions 51e953a3579fb91f30f7f0d6159b737684976959 opengl: track the state of stencil test b8f0e6452cc019744c44997c92831d94086b35b7 opengl: sync scissor and stencil state, generic capability state a57d048f88ba6cac3ce1550e2a8a143a8887eb05 opengl: track the state of glViewport 540fee2dc7553152914f7f1d8a41921e765087ef Change-Id: I770a6a744c0c41850c576b928f027375962088aa Reviewed-on: https://gerrit.libreoffice.org/24508 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: David Tardon <dtardon@redhat.com>
2016-05-06gtk3: various bits means different things againCaolán McNamara1-2/+8
so active tabs don't look active without this on recent gtks (cherry picked from commit 235411c9d47ecba88e46d859ea93bcecefb0c46e) Change-Id: Iafa1e65fb0cc096513cdfe12a09fb0ef4c4d2db0 Reviewed-on: https://gerrit.libreoffice.org/24651 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
2016-05-06Resolves: tdf#98940 (-1 not mapping to maximum string length anymore)Matteo Casalin1-1/+1
Change-Id: I58e4a63bce17b880a97c7ccfb4d42dfb930e54c5 Reviewed-on: https://gerrit.libreoffice.org/24268 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit eca3455190ed9a2c4796e7954f2533dc71cd1ab6) Reviewed-on: https://gerrit.libreoffice.org/24654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
2016-05-03tdf#90319: make image flipping work when aLinearContext(...) code path chosenpasqualm1-14/+5
Image flipping can be processed following different code paths in bitmap.cxx. Has been verified that it was broken in Linux Mint (with cinnamon) because there a buggy code path was chosen which was not fixed in commit 3119440a80282692640378fde5e37974ab63f096 in master. This commit solves the problem for this code path Change-Id: I22257e70761ca5469c0424b5f9925681cfd4e2e3 Reviewed-on: https://gerrit.libreoffice.org/22753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jacobo Aragunde Pérez <jaragunde@igalia.com> (cherry picked from commit 1e3d634e413abf2b4c2a6c70a87586d8c598054c) Reviewed-on: https://gerrit.libreoffice.org/23852 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-05-03Fix failure to print when using the D2DWrite pathTim Eves1-1/+5
It seems that D2D1DCRenderrTarget cannot bind to a DC on a printer device. Now whenever that attempt to bind the DC fails we run the legacy API path as a fallback. Change-Id: I6ad8d82e5280fd2dcf669310bab0f5bfc23a138a Reviewed-on: https://gerrit.libreoffice.org/23366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Martin Hosken <martin_hosken@sil.org> Reviewed-on: https://gerrit.libreoffice.org/24603
2016-04-28tdf#89866 tdf#96504 vcl: fix printing of form controls with imagesMichael Stahl2-14/+2
Originally in 2004 commit 0339e43208cd7b98d302e420b39ac32911acaa56 added a "DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" );" Recently commit f749ffbdf4c007f1a42bcafc9c2723c47bac22d1 made the mistake of trusting this assertion to be correct and added Printer::DrawImage() overrides that do a hard "assert()" now and don't do any drawing. Armin claims that the implementation of OutputDevice::DrawImage() should actually work for Printer as well due to fall-backs and thus the original DBG_ASSERT was misleading. This matters when printing documents that contain form controls such as ImageControl. Additionally, Image::Draw() should not return early when IsDeviceOutputNecessary() is false, because that is the case when printing, where instead a meta-file is recorded. The called OutputDevice::DrawBitmapEx() will check IsDeviceOutputNecessary() internally anyway. This check was actually always there, so i do not understand how this should have worked in LO 4.2, as the bug reporters claim. (cherry picked from commit ef52ce82bf55b37279e344ea5fef67b4277fb009) Change-Id: I92ba19e7036197d1dde88c361f8e1cb59fae3a60 Reviewed-on: https://gerrit.libreoffice.org/24439 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-26-Werror=misleading-indentation (GCC 6)Stephan Bergmann2-4/+8
Change-Id: I50b57b3e78758271411bdb4c3d58a2413578db1c (cherry picked from commit d0e1cb02d87968bdfd6bbedecf41cd5a6ed1c644) Signed-off-by: David Tardon <dtardon@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/24405 Tested-by: Jenkins <ci@libreoffice.org>
2016-04-19Fix showing tooltips in RTL UI with GTK 3Khaled Hosny1-0/+2
Change-Id: I29c2c7988fb97e2472188a600a483e5f6ed12d80 Reviewed-on: https://gerrit.libreoffice.org/24057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-18tdf#94682 limit the number of textures for the glyph texture atlasTomaž Vajngerl3-11/+96
Previously the number of textures in a packed texture atlas was not limited. After some time the number of the textures could grow quite a lot, however the first textures could contain very little glyphs that are valid. In this commit we add a new method ReduceTextureNumber which when called, reduces the number of textures that are tracked by the texutre atlas to the specified input number, and returnes the texture IDs that were removed so the caller can now clean-up any invalid (OpenGLTexutre) objects. Change-Id: I7790e8dddb4586167f860e0ecc81bda1f4dae21a Reviewed-on: https://gerrit.libreoffice.org/24071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-04-18tdf#40863 only use polygons with area for WinClipRegionsArmin Le Grand1-12/+32
Due to a former fix CustomShapes have extra polygons with a single point in the top-left and bottom-right corner of their BoundRect, a workaround to allow getting their correct BoundRect in slideshow. Unfortunately this makes the win command CreatePolyPolygonRgn fail to create the needed ClipRegions so that the geometry is processed without clipping. Changed to only use polygons as input that have an area. Change-Id: I0eeda5776402777ed00de92f42a55f206575f58b Reviewed-on: https://gerrit.libreoffice.org/24059 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> Reviewed-on: https://gerrit.libreoffice.org/24114
2016-04-15lp#1560328: clear cache before disposing rest of VCLBjoern Michaelsen1-0/+3
Change-Id: Iac325cf934953c61cb4dbbb67cfbab1777dc45cc Reviewed-on: https://gerrit.libreoffice.org/24039 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-04-14vcl: fix valgrind warning in g_lo_action_group_query_actionMichael Stahl1-4/+9
Change-Id: I0755254d4d6d24689d4f5b39c3a6c9a29ae53b99 (cherry picked from commit 9a31442171cf8bd79574c318d91ef220ee7389bb) Reviewed-on: https://gerrit.libreoffice.org/24063 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-14tdf#99244 opengl: miter limit for poly linesTomaž Vajngerl1-0/+13
(cherry picked from commit ea6196f0a51d1bf4cd722468406dcc8c64c7435c) also includes commit cb4015bb28dd7430efaaa523d04a155eb7e46305 Change-Id: I1c363a8f1d21bbacab0c5785544aa8becfe39363 Reviewed-on: https://gerrit.libreoffice.org/24072 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-04-12gtk3: the list/combo box hack to get internal buttons no longer worksCaolán McNamara1-33/+2
with gtk3-3.20.2 Change-Id: I608f3476a82233cb49e0b43c95f5a984d7c89c92 (cherry picked from commit 70cc48f17a61296021c035f351c3db68bc5e08ad) Reviewed-on: https://gerrit.libreoffice.org/23907 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-08tdf#94682 optimize texture drawing on Win. (squashed multi commits)Tomaž Vajngerl13-294/+729
Includes commits from master: opengl: deferred and optimized (text) texture drawing 96a098c0e8a009b77a26061dac3318da71d34ee4 opengl: texture atlas impl. to efficiently packs textures 40e9ed91bd8bbfecfc3832d73a81741d0aa97d3a opengl: use packed texture atlas for glyph cache in win. backend 80d0b2916db81a7f47bb1d368677016bbb870df6 opengl: fix wrong clipping when drawing text 094faaae6982472375420e57d6b9e34eefdbced8 opengl: cleanup texture, const internal format f65e77c965bb47d53c994d90b7fd0bf5009b343b Change-Id: I31ecd891d1d69e94973673930b0606e1ac884aab Reviewed-on: https://gerrit.libreoffice.org/23914 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-04-07tdf#98960 - DrawTransformedTexture adapted to the new area scale shaderMarco Cecchetti1-32/+130
Change-Id: I7c911f2aaccbffacfa5673b120b6177b8bea0672 Reviewed-on: https://gerrit.libreoffice.org/23865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-04-06tdf#98989: vcl: fix handling of non-scalable fonts like "Courier"Michael Stahl1-1/+6
For a VirtualDevice only scalable fonts are cloned, but for non-scalable bitmap fonts still an empty PhysicalFontFamily with no PhysicalFontFace is created, which causes text to disappear (height 0). Suppress creation of such families like it was done in LO 4.3, so that the fall-back can handle it and map "Courier" to "Courier New". (regression from 8d6697587776136f3121733e1c29d4200720dbd9) (cherry picked from commit 2f89245fb7e1c94bed49dde10b08ab1cf41b597b) Change-Id: I6542a3f7a01bdf46ae2bcf328fa04064f7f86332 Reviewed-on: https://gerrit.libreoffice.org/23850 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-05opengl: fix loading shader with preamble that uses #versionTomaž Vajngerl1-2/+2
The preamble was inserted into a false position so the shader could was constructed incorrectly and would fail to compile. Change-Id: I4c51adde9014a326bbe38a5d2d17dd0047e33195 Reviewed-on: https://gerrit.libreoffice.org/23463 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
2016-04-01tdf#98960 fix OpenGL crash by optimized image scalingMarco Cecchetti2-9/+76
using area scale shader - 2 passes impl - sqrt scale factor (cherry-picked from the commit f11a228cfd326bc089d7ff1c11a1561cdf5ee986) Change-Id: I973ae0a281735787b045ce8fd5df03f8caa8f189 Reviewed-on: https://gerrit.libreoffice.org/23613 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-03-31tdf#98812: follow-upMarco Cecchetti1-1/+6
pFont->mpFontInstance can be NULL. Reviewed-on: https://gerrit.libreoffice.org/23654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 9fa87bb1a42c45446f78b4d8c8096d7ce90a8022) Signed-off-by: Michael Stahl <mstahl@redhat.com> Change-Id: I934703bc40621dc412e444cc9a370c7031cbbb86
2016-03-30vcl: tdf#98812: acquire reference count of WinFontInstancesMichael Stahl3-0/+20
... when they are inserted in WinSalGraphics::mpWinFontEntry. Not sure why one of these drops to 0 but is not removed from the WinSalGraphics when formatting this particular bugdoc. Acquiring the instances when retaining pointers to them should make the life cycle a little less insane. (cherry picked from commit 99207a26df0083851ba8e23be72d5c6974f98a3b) Change-Id: If1404f46a13736b2a226e198bdf0c3ca8e09bb38 Reviewed-on: https://gerrit.libreoffice.org/23504 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-03-25tdf#94734: fix icon in sidebar disappears when changing font colourBjoern Michaelsen1-1/+9
- properly initalize maImageOriginal along with maImage in various places - this is a regression from 27d94c482e82ea5d4f202109614c6fb3578fb0a4 - that commit is mostly innocent in itself though, only exposing omissions from b8f21298288890d52c06fef6c84441634c56c986 - having both maImage and maImageOriginal is extremely fragile as-is -- likely I'd be helpful to have them private in ImplToolItem and then a SetImage accessor with a tristate eOriginal/eCached/eBoth enum parameter to prevent oversights like this in the future ... Change-Id: I294d7ed8e07be5cadec0ae251cc08c8d089bd059 Reviewed-on: https://gerrit.libreoffice.org/23505 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-03-24tdf#98600 and tdf#98622 fix metafile parsing (part2)Noel Grandin3-1/+7
more regressions from commit db17d3c1 "new loplugin: memoryvar" Change-Id: I611697f2bc818f2f42a704bfb5297637c30060c9 (cherry picked from commit d4163c17ef47fdbc7d45adc5803b9844739b3324) Reviewed-on: https://gerrit.libreoffice.org/23470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-03-24tdf#98600 and tdf#98622 fix metafile parsingNoel Grandin1-0/+2
regression from commit db17d3c1 "new loplugin: memoryvar" Change-Id: I8b11871cadcf50649533680be51c767d6bb98350 (cherry picked from commit c5bee7b8c1055e5052a261c8755bdb150fb27494) Reviewed-on: https://gerrit.libreoffice.org/23469 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-03-24opengl: fix inv.scale values are always integer - cid#1352479Tomaž Vajngerl1-2/+2
Force cast to double to avoid integer division - which gives a wrong inverse scale value. Change-Id: I0135e44ef07f3915619f9dfead9aadf50fc03685 Reviewed-on: https://gerrit.libreoffice.org/23462 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-03-23trying to get a GL context after GL de-initialization - fixedMarco Cecchetti1-14/+25
Change-Id: I5f38f72b0e2c0204875d0dfbb759d6b13415560a Reviewed-on: https://gerrit.libreoffice.org/23433 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-03-21tdf#98324 - PNG prints as black block with OpenGL - fixedMarco Cecchetti2-3/+10
Now the correct color palette is used. Change-Id: Ice532091713788c7c6b380550c65e26bc4b76c74 Reviewed-on: https://gerrit.libreoffice.org/23377 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-03-18Resolves: tdf#98726 sneaky transparent clearlooks-phenix scrollbarsCaolán McNamara1-14/+17
(cherry picked from commit e511f962c0b70e0ce0d19c42be1f198b6191fad1) Change-Id: Idc05d7b6c2b42086eafa9ad8ab8e63116d6f676c Reviewed-on: https://gerrit.libreoffice.org/23346 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2016-03-17tdf#97319: Give up on attempting to cache non-BMP glyphs for SimpleWinLayoutTor Lillqvist1-12/+44
Add code to handle surrogate pairs in glyph caching, but I can't figure out why successive non-BMP glyphs in the bugdoc get drawn on top of each others. So bail out... Change-Id: Id1907cb766b9285d32e484049bec1b99159c5768 Reviewed-on: https://gerrit.libreoffice.org/23292 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-03-15tdf#79679 vcl: dashed lines show as solid lines when importing EMF filesChris Sherlock5-49/+29
Backported to 5.1 Issue is a regression in commit 09c722873b2d378d2d155f5f1dd7d8f3fb2012e9. (EMF/WMF: fix rendering of pen styles (dash, dot, dashdot, dashdotdot). I've looked at how the latest version of Word on the Mac works, and it turns out that the spacings for the PenStyle enumerations in the LogPen objects for all the create pen EMF records are as follows: * PS_DOT - ■ □ ■ □ ■ □ ■ □ ■ □ ■ * PS_DASHDOT - ■ ■ ■ □ ■ □ ■ ■ ■ □ ■ * PS_DASHDOTDOT - ■ ■ ■ □ ■ □ ■ □ ■ ■ ■ (where ■ is the actual filled in area, and □ is the space between the filled in areas) In other words, each dash fills in the space of three dots, and there is the one dot worth of empty space between the dashes and dots. Each "dot" has a width and height equal to the width specified in the pen. So basically, we seem to be arbitrarily setting the dot, dash and distance lengths arbitrarily, which were reasonable guesses but tended to produce very odd lines at different zoom levels. Change-Id: Ie8b5fa396e4fb0f480cb3594c8129a59f472c1b8 Reviewed-on: https://gerrit.libreoffice.org/22886 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/22923 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2016-03-15fix windows buildChristian Lohmaier1-2/+2
34a7b51ea482d4487d4fb8e61cde18aa1ff9b8ff (for 5-1) auto → size_t made 32bit happy, but win64bit still failed with: error C2784: ´_Ty std::min(std::initializer_list<_Elem>,_Pr)´ : could not deduce template argument for ´std::initializer_list<_Elem>´ from ´__int64´ (cherry picked from commit 53f645a9c959d93bde9230862c415c4ab2e3817b) Change-Id: Ib44840f692f1bcdea90decfe443c6eb72806002a Reviewed-on: https://gerrit.libreoffice.org/23288 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2016-03-15vcl: move graph.[hx]xx to graphic.[hc]xxChris Sherlock26-26/+26
It's IMO a bit confusing to see a "graph" header that doesn't strictly deal with graphs, but graphics. Backporting to 5.1 series to allow for easier backporting of other potential hotfixes. Change-Id: Ic37c6cd78e23d05939486f98667144c4453bb0a3 Reviewed-on: https://gerrit.libreoffice.org/22949 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2016-03-15Revert "fix memory leak in headless backend"jan iversen1-5/+1
This reverts commit eaaca6eaf26b0976f1c06f583a8aa35ee1c1b857. Causing tinderbox problems and reverted before making the 5.1.2 tag Change-Id: I987d1c5c839f020da150753f9a997a6824c1af67 Reviewed-on: https://gerrit.libreoffice.org/23286 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-03-15fix memory leak in headless backendMarkus Mohrhard1-1/+5
Reviewed-on: https://gerrit.libreoffice.org/23248 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit c62afab9d4138583eb22afe46608b323f902f095) Change-Id: I90282c86b45845fc35b23b275301be24a2f18a4d Reviewed-on: https://gerrit.libreoffice.org/23261 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2016-03-15vcl: yield more cleanly and do less work for now.Michael Meeks1-3/+2
Change-Id: Ia3469fe4eb53f73fc85ee3c62db1411f9f4d1fb8 Reviewed-on: https://gerrit.libreoffice.org/23250 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-03-15win: tinderbox band-aid for compilers that can't infer this type.Michael Meeks1-1/+1
Change-Id: Ie695a0ca3cdaa7c2b5cd0db9eaa1016aaa5c18a8 Reviewed-on: https://gerrit.libreoffice.org/23252 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-03-14Related: tdf#98419 use gtk_window_begin_move_drag bodge for wayland onlyCaolán McNamara1-1/+10
Change-Id: Ica19aef9b94e0c11e014f48b7801ecb0c110c44b (cherry picked from commit 380e5a98d2f20d77b8fc51bbea74f554dd24cdd1) Reviewed-on: https://gerrit.libreoffice.org/23105 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-03-14Related: tdf#98419 set a min size on un-resizeable non-layout dialogsCaolán McNamara1-0/+4
(see also rhbz#1281906) a min size equates to a size-request which is reliable under gtk3+wayland as the dialog contents size. a default size equates to the size of the dialog, which includes decorations under wayland (cherry picked from commit afeddaf7e0d11ad9b1df0c80bcc3f50caa87e21a) Change-Id: I20baf00fb5952ab93628f4dd6891779ce682783c Reviewed-on: https://gerrit.libreoffice.org/23121 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2016-03-14tdf#97171: Use DirectWrite for OpenGL glyph cachingTim Eves2-194/+647
A squash of several commits. Most important points mentioned below: DirectWrite rendering for Graphite to work around ExtTextOut bug where it incorrectly positions certain diacritics, using DirectWrite and Direct2D fixes this. Implemented on-demand loading of the DLL so the old ExTextOut based renderer will be used when drwite and d2d1 cannot be found allowing this work on Windows XP (where this bug doesn't seem to occur) Make the new D2D Graphite rendering work also in the OpenGL case It used to render just black boxes. The change in DrawTextImpl() semantics from 61085083e4a5060ba7e2135818264d63c6da13c2 was not properly implemented in the new Graphite code. The return value is not some kind of "success" indicator, but tells the caller whether to continue the loop at that level. We do need to call FillRect() to fill the requested rectangle of the HDC with white. On the other hand, the call to Clear() is not needed and in fact makes no text show up. (I now see that that same code snippet that calls FillRect() is used in all the DrawTextImpl() implementations, so it should be factored out to the call site in WinLayout::DrawText().) Factor out the calls to FillRect in the DrawTextImpl() implementations. They were all in fact doing exactly the same, so do it at the call site instead. Fix what seems to have been off-by-one errors in glyph bounds calculation. For some reason the error had a visible impact (as far as I an see, anyway) only for Graphite fonts. The bottommost pixels were cut off. (Also leftmost, but that was not so easily visible.) <tools/gen.hxx> Rectangle type, I love you. Refactor some previously private methods into public ones and reimplement parts of D2DWriteTextOutRenderer to user them. Also apply them to rendering the OpenGL glyph atlas, in an effort to workaround some bugs in legacy Windows text rendering APIs. I assume we want to initialise the rectangle with zero left/right/top/bottom and not using the default constructor, which sets the right and bottom coordinates to the magic value -32767. That made the 'bound' rectangle end up with rather amusing boundaries, like left=-32766, top=-16, right=-32576, bottom=6. Try calculating a chunks ascent & height from the inkboxes rather than using the font metrics which might not alway be correct when glyphs inkboxes are tall than the ascent or lower than the descent. Mark the mnAscent in the chunk bitmap debug output. Fix several miscalulations in positioning glyph to be rendered into that atlas. Fix vertical alignment problems. Inkboxes are returned with all co-ordinates relative to the glyphs not the fonts ascent. Therefor bounds.Top() is not the vertical overhang but the -ve height of the inkbox above the baseline. This fixes the calulation of the per Chunk ascent. Fix horizontal occsional alingment issues in OpenGL cached glyphs. The left edge of the src location rectangle for the first glyph in a cache chunk would set to extraspace and not zero, but all other rectangles in the chunk would be set from the aEnds array. This produced a bug where only certain letters would be mispositioned, proportional to the fonts point size. Rename OpenGLGlyphChunk::mnAscent to mnBaselineOffset to reflect curr use. Changed at Tor's stuggestion to better describe to it's use as it's value would be per chunk and based on the maximum ink box bounds of the glyphs in the chunk, rather than having anything to do with the font's real ascent value. Change-Id: I92ca17609022ae4af187e9a9f452a694fdd976ad Reviewed-on: https://gerrit.libreoffice.org/23246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-03-14tdf#95616 - fix flickering issueMarco Cecchetti1-1/+2
Reviewed-on: https://gerrit.libreoffice.org/23238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Signed-off-by: Michael Meeks <michael.meeks@collabora.com> Conflicts: vcl/opengl/gdiimpl.cxx Change-Id: I0d5bfdf44dde2cd06c193f34e81c6ce71291bba1