summaryrefslogtreecommitdiff
path: root/vcl/inc
AgeCommit message (Collapse)AuthorFilesLines
2015-08-31gl-checksum: added a minimum size check for using GL versionMarco Cecchetti1-1/+1
(nWidth * nHeight) < (1024*768) || nWidth < 128 || nHeight < 128 Change-Id: Iedda6a333958c76c19b837890eb3fa28e631bc90
2015-08-31CRC is an integer type -> mnChecksum.Michael Meeks1-4/+4
Change-Id: I9e4d36105a59c5f81677d8e062106dae6f709464
2015-08-31squash into Marco's commit.Michael Meeks1-1/+1
g Conflicts: vcl/inc/salbmp.hxx Change-Id: I57d1e4b8e4909ce0b82c9e61ca271768cc73cd8b
2015-08-31vcl_get_checksum wraps the call to the real checksum functionMarco Cecchetti1-2/+2
Change-Id: I72916f18966756ecc99e77f1b164e99377eb456e
2015-08-31Switching to 64-bit checksum: substituted sal_uLong with BitmapChecksumMarco Cecchetti2-2/+2
A typedef sal_uLong BitmapChecksum; has been added to include/vcl/checksum.hxx Wherever needed sal_uLong and sal_Int32 has been substituted with BitmapChecksum. A BITMAP_CHECKSUM_BITS constant equal to the amount of bits used by the BitmapChecksum type has been defined and used in `GraphicID::GetIDString` (vstools/source/graphic/grfcache.cxx). Change-Id: I74bd285089e58a8b18c06233d75b87023c7bf31b
2015-08-31moved chechsum.hxx in include/vclMarco Cecchetti2-156/+1
Change-Id: I70f82f16d5907ce0bbe2d838c4acee226886aab2
2015-08-31Added support for computing 64-bit checksum of bitmap in OpenGLMarco Cecchetti5-6/+211
Added a C++ and a GLSL implementation of a 64-bit CRC algorithm. Changed hardcoded checksum value in ooxmlimport unit test (testN777345). Change-Id: I16bb985a14866775efda49e21fe033ff64645896
2015-08-31vcl: Improve management of mnRef0Count.Jan Holesovsky1-1/+6
Follow-up to 34700400247e378e074ce4164ab2809edb092201; this fixes sw_ww8export unit test on Windows. Change-Id: Ic0c3228efb59a182e1562b73117418cd8b5e6017 Reviewed-on: https://gerrit.libreoffice.org/18175 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-08-29vcl: fix resource management issue in WinSalLayoutMichael Stahl1-0/+2
Since commit 65a66d41fd0e13d0aad9df935091b731b4af650a the sd_exports_test crashes on Windows in UniscribeLayout because it uses a ImplFontEntry that has been removed from the font cache. Tweak the refcount in WinLayout so it will be valid. Change-Id: Ic4bf984ea9fd70de9fa95ca964ae12d95d47d5bf (cherry picked from commit 34700400247e378e074ce4164ab2809edb092201) Reviewed-on: https://gerrit.libreoffice.org/18121 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-28No NO_MAPPERS, NO_TYPE3, NO_TYPE42 or NO_TTCR anywhereTor Lillqvist1-21/+0
Change-Id: Icab5608900108c89e649e78a2e35d02e941d0ac0 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-28Drop code that is dead after 4667db065d34193d99bce82f7e8f3b20a03ecadeTor Lillqvist1-10/+1
Change-Id: Id023b43e901b0e41ebf3b208c6e80fd023bf7f9a Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-28(disabled) Initial work for OpenGL glyph caching on WindowsTor Lillqvist1-0/+1
Shows text roughly correctly, but many problems. Conditional at run-time on the SAL_ENABLE_GLYPH_CACHING environment variable in addition to SAL_FORCEGL. One obvious thing that needs fixing is making sure that the glyphs are rendered into the texture without overlap. Compensating negative values in the ABC::abcA and ABC::abdC width is not enough. Also, the cache should be changed to actually have "cache" functionality, i.e. entries should expire based on some criterion. Change-Id: I66a37d3354a09011a654f15a7d2bd8efaa14ad1e Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-28SimpleWinLayout::mbDisableGlyphs was always trueTor Lillqvist1-2/+0
Remove dead code. Should have no effect on behaviour. Possibly originally the intent was that mbDisableGlyphs would have been false in most cases on NT-based Windows (all versions that we support now). However, since dadfc60873d4dce4e0c46e1d3405f8d45535cdcf, in 2005, mbDisableGlyphs was set to always true in the SimpleWinLayout ctor. Change-Id: Id929224d5656706762c2f44ee26c76f8b20ee8b8 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-26opengl: push mask coords to the shaders along the image coordsTomaž Vajngerl1-0/+2
If using the same texture to store the image and mask data (for example when using texture atlas) the mask and image (RGB) coords aren't the same anymore. With this commit we always define the mask coords separately. (cherry picked from commit bdce4e29191aa5bd029efa242e094aba45c44869) Conflicts: vcl/opengl/program.cxx Change-Id: Ie33f87a6e9ab398972c6a3d5938e5f1364c82d36 Reviewed-on: https://gerrit.libreoffice.org/18012 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2015-08-26Fixed (fixed size) texture atlas for "caching" OpenGL texuresTomaž Vajngerl3-3/+82
Plus two trivial follow-up build fixes. Change-Id: I7fe90c0a0033b4d9a341a4f0b8356d7f7133e93e (cherry picked from commit b26ba85d04e81f48622dfdbb71d9d80b54dacc40) (cherry picked from commit 2792868df58808902a6bc7f58fd50970a0a756c0) (cherry picked from commit 1e8e3a8c4624e9a4f16a7fb7f24c5d7125d7f106) Reviewed-on: https://gerrit.libreoffice.org/18011 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2015-08-26vcl OpenGL program: Cache mvp matrix to reduce ~200 api calls per frame.Lubosz Sarnecki1-0/+5
Change-Id: I86ae50bd8d2148e86a6c8fc0821d3e2bc29a0cd4 (cherry picked from commit e3cd97ce0b2e153b8b6812cc66f2e7d33504a7da) Reviewed-on: https://gerrit.libreoffice.org/18006 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2015-08-26tdf#93614 - detect hanging OpenGL drivers with a watchdog.Michael Meeks2-10/+52
If an OpenGL zone takes >2s to make progress, disable OpenGL. If an OpenGL zone takes >5s to make progress, abort the app. Reviewed-on: https://gerrit.libreoffice.org/17986 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Conflicts: vcl/workben/vcldemo.cxx Change-Id: I776c06a3f8ba460ff9842a9130c21f9ee2147eee Reviewed-on: https://gerrit.libreoffice.org/17995 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-21tdf#93547 - Disable OpenGL if we have a SEGV on windows in that code.Michael Meeks1-0/+34
Annotate when we are in an OpenGL rendering zone. Check for this in the VCL signal handler, and force OpenGL off here if exception occurred inside an OpenGL code-path. Reviewed-on: https://gerrit.libreoffice.org/17881 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Conflicts: vcl/source/opengl/OpenGLHelper.cxx Change-Id: I85a4b3d4a374593dc55d01a39ec4c7c3c262c332 Reviewed-on: https://gerrit.libreoffice.org/17883 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2015-08-12tdf#93364 vcl rendercontext: fix area that is painted in PaintBuffer()Miklos Vajna1-0/+1
Usually the topmost window of a paint hierarchy has a paint rectangle that covers the paint rectangle of all its children, but this is not necessarly true in every case. One example is the cursor travelling described in the bug report, where the topmost DockingAreaWindow only paints a few buttons on the toolbar, and then even if children are painted correctly to the frame-level persistent buffer, only the DockingAreaWindow part of the buffer is copied to the screen. Fix this by building an union rectangle that covers all areas in a buffered paint run, and then paint that rectangle from the buffer, not just the paint rectangle of the topmost parent. Change-Id: Ib0b30413d83c4b3fdec27fa7ddad16c21fd094b6 (cherry picked from commit 7305941b150097123eab664f9ec9e5f3909a5c52) Reviewed-on: https://gerrit.libreoffice.org/17664 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2015-08-07Resolves: tdf#92982 vcl rendercontext: handle buffered paint of vcl::CursorMiklos Vajna1-0/+20
Instead of painting on the vcl::Window directly, take a PaintBufferGuard, and use the vcl::RenderContext of it, that may be either the vcl::Window or the toplevel frame's buffer. Trigger the paint of the buffer by informing the guard what area was painted. In case of direct painting, both the ctor and the dtor of the guard is a NOP. This means that finally we can also assert Invert() calls on the output device, so that direct paint can't happen when double-buffering. Also: - make PaintBufferGuard visible outside paint.cxx - move buffer paint logic to PaintBufferGuard (cherry picked from commits c85b25114a756e1abb3e68a4c7d3630c486917b5, a6c7a0bf105c399d087e2d9f843dbd9b175fdf42 and c64a7ce1fcd1e30956a77530d0b76ad493841024) Change-Id: I0322563369dc63b3c49061cbe7c4a911cb13a2e2 Reviewed-on: https://gerrit.libreoffice.org/17576 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins <ci@libreoffice.org>
2015-08-07opengl: cache native widget textures also for WindowsTomaž Vajngerl2-0/+15
Change-Id: I476f0ffaef383f3227c0c12b50fcdebf393190f6 Reviewed-on: https://gerrit.libreoffice.org/17487 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit dea885f80a80c6a5839ee5dbf8521487186a9522) Reviewed-on: https://gerrit.libreoffice.org/17561 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-08-07opengl: when scaling, create a new texture with equal settingsTomaž Vajngerl1-0/+2
Change-Id: Id0258fe0db89aa06b91233ae2052f018d606cc74 (cherry picked from commit 6d9ddfb9c7a946e9b9cc58ae2cebcf3a21a5bf22) Reviewed-on: https://gerrit.libreoffice.org/17558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-08-07tdf#92018 cache native controls for X11 OpenGL backend (for now)Tomaž Vajngerl3-1/+22
Change-Id: I85c7cc01113bc4ac810c450a6460059463cc8e03 (cherry picked from commit 450727fdffa4a0dc3b2d4e635a5c1bc0411b3c36) Reviewed-on: https://gerrit.libreoffice.org/17554 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-08-07GTK3 HiDPI: disable window scaling and get display DPI via GTK3Tomaž Vajngerl1-0/+1
Change-Id: I66b92146757352408a331f9e23289839f443ff79 (cherry picked from commit 2a19bb85cbe83aa031871a3689b9ff03629da548) Reviewed-on: https://gerrit.libreoffice.org/17553 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-07-31tdf#92982 vcl: stop creating/disposing the paint buffer in PaintHelperMiklos Vajna1-0/+1
Instead: - create it early in Window::ImplInit(), except for the default window (that one is a chicken-and-egg problem, as creating a VirtualDevice invokes ImplGetDefaultWindow(), but creating the default window then would create a VirtualDevice) - only erase the painted area of the buffer, don't create it - use a separate bool in the frame state to track if we're in the middle of a (possibly recursive) buffered paint And with that, rename CreateBuffer() to StartBufferedPaint(), as it does not create the buffer anymore. Change-Id: Ib33e8afa36977aa809f0ea2158a369f288cba8c7 (cherry picked from commit ea5e83abcfa1406c401b8a1ec91efda65373b74b) Reviewed-on: https://gerrit.libreoffice.org/17445 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2015-07-30tdf#92982 vcl rendercontext: move buffer from PaintHelper to ImplFrameDataMiklos Vajna1-0/+1
With this, code that wants to take a persistent render context (e.g. vcl::Cursor) will be able to do so. This commit just moves the buffer, though: it's still created / deleted by PaintHelper. Having it in ImplFrameData means that we'll have one buffer / one system window: i.e. toplevel window and its sub-widgets share a buffer. (cherry picked from commit a33e0379bbe2c7651315f5cdc5925adab33b573b) Conflicts: vcl/source/window/paint.cxx Change-Id: Ic37220a2a483a7389aa04cd4313b6fc61a5408bf Reviewed-on: https://gerrit.libreoffice.org/17414 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2015-07-24Revert "gtk3: draw/paint to the fixed container"Caolán McNamara1-1/+1
bah, didn't mean to push directly without review This reverts commit c19e079bc1a2cce977bd0e2bbba5901108180615.
2015-07-24gtk3: draw/paint to the fixed containerCaolán McNamara1-1/+1
which fills the toplevel window, rather than directly to the toplevel window. It makes no difference for X, but for wayland the window decorations are part of the toplevel window, dropping down a level means we don't draw out menu bar under the window decoration space Change-Id: Icec400efacd16b5d901107c13b6fa90c59cad0e6 (cherry picked from commit 298c089df77d9afe2cf86bb7a6a8544a0151e8c5)
2015-07-23gtk3: native focus rects are fine for flat buttonsCaolán McNamara1-1/+2
(cherry picked from commit f485b2881794244409d71ead39715373e734ed04) Change-Id: I6a70696cd119e681b4850c624c9e4ff28312c152 Reviewed-on: https://gerrit.libreoffice.org/17291 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2015-07-11opengl: use MVP matrix in vertex shaders, pixel offsetsTomaž Vajngerl2-0/+4
ChangChange all vertex shaders to accept model, view, projection matrix to calculate the vertex position. So now we don't need to convert the coordinates to OpenGL coordinate space [-1.0, 1.0] anymore. Additionally make it possible to offset vertex coordinates so we can apply 0.5 px offset (to hit the pixel center) at some operations. Change-Id: I8e0a61d5fd4ab6aaa1c0c94439061725918577a0 (cherry picked from commit 2e99e4e11d33679aed674eea0d6054d16d39d6df) Reviewed-on: https://gerrit.libreoffice.org/16919 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-07-10tdf#92244 Gaps at end of menu separator lines read from GTK theme.Simon Long1-0/+1
Reviewed-on: https://gerrit.libreoffice.org/16886 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f1faa887c0c934484fb32a8ec5fbbc9e89f38037) Change-Id: I3c42d918680ac989c5cd7cd1022e4a6e7b53aa11 Reviewed-on: https://gerrit.libreoffice.org/16930 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-07-08Related tdf#91362: disable paper size & orientation selectionKatarina Behrens1-0/+1
Unless 'Use only papersize from printer prefs' is toggled on, whatever the user sets here doesn't have any effect on the actual printing (page settings from the document are used instead). It is misleading to have the user believe otherwise. It was really challenging to have this one toggle get all the way down through several layers of abstraction, though ... Change-Id: If240084ca23b3946a92882a6ee47dbc161b3b86c Reviewed-on: https://gerrit.libreoffice.org/16822 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-06-30gtk3: listen to state-flags-changed and disable toplevels when in backdropCaolán McNamara1-1/+2
Change-Id: I173618b2e6a2ad69918da8b85ec0eef7099f1d3d (cherry picked from commit 02b1e14743fa48b365f80e76ecb713877c990c34)
2015-06-26Resolves: tdf#92293 gtk3: get a11y workingCaolán McNamara1-0/+1
(cherry picked from commit 093d7b8142d0cb224fcf23506f3b36f7a3a10d2c) Change-Id: I89cfde9b4c97852d36817b716ac08bd32096915b
2015-06-25gtk3: move cairo region clipping to svpCaolán McNamara2-2/+1
Change-Id: I4b4f09ee3fb7edbda3b6bb5af024c0966e3a2082 (cherry picked from commit edf56cb4300f68a3e513420feccbf8d5287a0428)
2015-06-25gtk3: move createCairoContext down to svpgdiCaolán McNamara1-0/+8
(cherry picked from commit 253c0f073715b1d0f6ba063b1182016e45951bf4) Change-Id: Ib3c6d6689c4b79a636a3f2f0f985f3573aa46f3d cairo_format_stride_for_width is 1.6 onwards (cherry picked from commit 5ce9954c5ec244b9a858ab7e996d5201a21dc3fe) Change-Id: Ic233b4b6c7067f2473eb76b0c7e520cfe1dfcd14
2015-06-25implement GtkSalFrame::GetKeyName with some code lying around handyCaolán McNamara1-0/+3
Change-Id: I6a41ae2b8056737008add98c35d06f3859e71171 (cherry picked from commit f47bff9d153b4f0dcbca1cca9ba6df6491805a62)
2015-06-22gtk3: native render the comically oversized gtk3 spinbuttonsCaolán McNamara1-2/+2
(cherry picked from commit 3cb7db75ace1f69d0e03685a8959714424366f13) Change-Id: I3e97200d59a97271617a6e9a88c807a07a33edfe
2015-06-19gtk3: drop manually constructed mpMenuItemStyleCaolán McNamara1-1/+0
Change-Id: Ibc9e93c702e885b14d7c0beac453479e9171f329 (cherry picked from commit 30df42a5a2e98f8eb971341a0cc00018865dbb54)
2015-06-19gtk3: use correct check menu item styleCaolán McNamara1-1/+2
Change-Id: Iee0c33cba80243b39b6de96cf58b8b274346e522 (cherry picked from commit ff123fa1086ae0c72c29c9ed4823ef53e6ff7de5)
2015-06-19gtk3 clipboard supportCaolán McNamara1-0/+4
doesn't work yet, but reports correctly what external formats are available Change-Id: I11cf9440ca516d4358c341fa67cc836b30ca42d6 (cherry picked from commit b461e3189b9a95deef1e6c5e03b0e657b5754dfa)
2015-06-17Resolves: tdf#91880 Invalidate graphics when the gtk window is destroyedCaolán McNamara1-0/+1
not just when the GtkSalFrame is dtored Change-Id: Iec33f4de39224f9b1e60d72c02164402196aaac0 (cherry picked from commit 6dcd81f81be0067425f42f0898316d7f52e279d6)
2015-06-15Resolves: tdf#91393 autotext (etc) not fully drawnCaolán McNamara2-0/+14
the paint timer is activating after we ask gtk to size the window but before we/gtk get the ConfigureNotify that updates gtk knowledge of the size. So the gtk drawing calls are clipped to the previous ConfigureNotify size. So, lets try postponing paints if we have set a size but not received a configure notify yet (cherry picked from commit 8f324aebfb94c4b2023894121b954ad4f35eb395) Change-Id: If5e993f8e0e65053b59234fce0785398b93c1c46 another stab at tdf#91393 block paints only if the new requested size is larger than the original and unblock on explicit expose events as well as configure ones Change-Id: I72829a5b6e55d6bbdaf934af427ee3b50fe11fd4 (cherry picked from commit 6dc1d2706f519d91617ac1a12fc2051d97ef98c0) Reviewed-on: https://gerrit.libreoffice.org/16291 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-05-31rendercontext: Initialize X11SalVirtualDevice with appropriate SalGraphics.Jan Holesovsky4-5/+12
Change-Id: I4230412ccc389b8ba6768229b569d7075e7ac466 Reviewed-on: https://gerrit.libreoffice.org/15979 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2015-05-29loplugin:staticmethodsStephan Bergmann1-1/+0
Change-Id: I20dac7fb627ec202558ed8be4e043bc01837b333 Signed-off-by: Jan Holesovsky <kendy@collabora.com>
2015-05-29convert WINDOW_POSSIZE constants to scoped enumNoel Grandin1-1/+1
Change-Id: Id85137ffc7309a66b04132d588d289db136117b9 Signed-off-by: Jan Holesovsky <kendy@collabora.com>
2015-05-29convert POINTER constants to scoped enumNoel Grandin3-4/+7
Change-Id: Iea29ce5fd6c620535197d3ca8538335078430e19 Reviewed-on: https://gerrit.libreoffice.org/15825 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> Signed-off-by: Jan Holesovsky <kendy@collabora.com>
2015-05-29use RenderContext in user draw, use ApplySettingsTomaž Vajngerl1-4/+4
Change-Id: I6cc22677000459a5f19bfb207007f5c246f187e0 Signed-off-by: Jan Holesovsky <kendy@collabora.com>
2015-05-29rendercontext: Make borderwindow painting via rendercontext.Jan Holesovsky1-4/+4
Change-Id: I51bce6c3af7484d1e5dd42190f14511ba88e1679
2015-05-26gtk3: focus rects for combobox entriesCaolán McNamara1-1/+0
mpComboboxEntryStyle refuses to draw the left side. I have no idea why and have burned too much time on it, so use the normal EntryStyle and set its right junction to get the flat right side Change-Id: Iff5fb1c1b21d2935c3817e7825b86b8e30e899eb (cherry picked from commit 7cf1206e1e0872d8525f6012d0017917a4840783)