summaryrefslogtreecommitdiff
path: root/vcl/win
AgeCommit message (Collapse)Author
2016-11-04opengl: change from BGRA to RGBA color arrangement on WindowsTomaž Vajngerl
BGRA is native color arrangement on Windows however some intel drivers have problems with large textures if they read from a BGRA buffer. So with this commit we switch to RGBA color arrangement. This shouldn't cause much performance differences, but we need to convert from RGBA to BGRA when printing. Change-Id: Ic112dc6a6c5d8b70e96041d0de15a03bbbdc406f Reviewed-on: https://gerrit.libreoffice.org/30544 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-11-04Font features are not a Graphite-only featureKhaled Hosny
We parse features appended to font names in CommonSalLayout as well, so code that takes care of their presence (striping them when searching, hashing, etc.) should not be dependent on the old Graphite support or it will not work when old Graphite is disabled (e.g. on macOS). Change-Id: If040782a86ec76d3743baf4d2b1d7a194e8e13f2
2016-11-02tdf#71603: Create a new DC for the font fallbackKhaled Hosny
For some reason re-using the DC from SalGraphics results in GetFontData() returning GDI_ERROR and we fail to read the font’s “cmap” table. The wired thing is that this happens only for fonts that were not used before, so if you open a document directly the fallback works but if you open start center or blank Writer document you get no fallback. GDI is “interesting”. Change-Id: Ic23095cabbd2623717271ce5d89bea75dca76a9a
2016-11-01tdf#71603: Improve font fallback on Windows a bitKhaled Hosny
Check all missing characters, not just the first one. Also the calling sites for GlyphFallbackFontSubstitution hook expect the OUString to be updated to have only any characters not supported by the returned font. Change-Id: Ife56d692c05433f2f7fe02db3ef1562181dc3d53
2016-11-01Use the font language instead of guessing itKhaled Hosny
Similar to what we do with FontConfig. Change-Id: Id01dabe0b52e4e3aea54073d42b719a924025920
2016-11-01Misplaced #if ENABLE_GRAPHITEKhaled Hosny
Change-Id: I2af3fdf100f6aaf435d8ed33d781ea0ca4ec21ec
2016-10-31fix MSVC 2015 build Error C2397lbenes
Change-Id: I4810aa8b0b7d28bcd41b4aa19d40f41757d540cd Reviewed-on: https://gerrit.libreoffice.org/30411 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-31Omit comparator which is the same as default std::less<key_type>Takeshi Abe
Change-Id: I72a0b618577caececaaf3eb4df53d4cb192251da Reviewed-on: https://gerrit.libreoffice.org/30369 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-10-31Avoid excessive text clipping on WindowsKhaled Hosny
Use a better rounding strategy so that when the bounding box involves part of a pixel we include the full pixel, so floor for -ve values and ceil for +ve ones. Without this I see lots of cut text on Windows. Change-Id: I258f63eb37911574cd3f6f08da22349756c0775c
2016-10-31Reduce number of argumentsKhaled Hosny
The font is already a member of the class, and the EM height is unused. Change-Id: Ice2eb2bb3e4b491bcb93123e1c3a08170cdaa50b
2016-10-30ENABLE_GRAPHITE_DWRITE is always set to 1Khaled Hosny
We don’t have a configure option to turn it off and I don’t think anyone tries building without it. Furthermore, we use the code guarded by this even without Graphite. Change-Id: I0fb434af58a51370a66b5ad7eb89b145e4c015de Reviewed-on: https://gerrit.libreoffice.org/30389 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-28tdf#98879: Fix vertical text on Windows for the new layoutKhaled Hosny
The DirectWrite rendering code wasn’t handling vertical text correctly at least when used with CommonSalLayout. It has been fixed and now made the default. We are also doing all vertical text handling on our own, so loading special vertical fonts on Windows is now disabled. Change-Id: I10d150367fe59c77459bb1b813b6f31a0ff0c5d0 Reviewed-on: https://gerrit.libreoffice.org/30346 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-28tdf#103514: Always ignore bitmap fonts on WindowsKhaled Hosny
We should never see any bitmap fonts now, so all the Courier stuff can go away. Since we never list the bitmap fonts in the first place, the old code for replacing some of them with scalable equivalents never kicks in. We instead implement PreMatchFontSubstitution hook for the same effect. Change-Id: I54f3c068bcd64554ed3498f4ba5b0f76bbd38589 Reviewed-on: https://gerrit.libreoffice.org/30345 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-10-25Skip font formats not supported by CommonSalLayoutKhaled Hosny
Don’t list fonts we can’t handle, bad things would happen… Change-Id: Ic88486e34da69090deb3e8c394cb75a8e4e5cbd0
2016-10-22Simplify CommonSalLayout constructor on WindowsKhaled Hosny
We can use GDI to load the font tables after all, no need for all the complications to use DirectWrite to load them. Should also make it work on Windows XP (untested). Change-Id: Id49fc524e6da983d76669a078f8b7d624f955703 Reviewed-on: https://gerrit.libreoffice.org/30156 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-21tdf#103365: Try to fix Windows OpenGL renderingKhaled Hosny
Essentially an adapted copy of WinLayout::DrawText(). Avoiding code duplication would have been nicer, but it is going to be too complicated and the other copy is going away soonish anyway. Change-Id: I7db4008a0db3d01d71d106e06fe413658f9bf42d Reviewed-on: https://gerrit.libreoffice.org/30123 Reviewed-by: akash <akash96j@gmail.com> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-20Incapsulate WinSalVirtualDevice betterMike Kaganski
Change-Id: I8de745e2318c69ccec2ffabb69df598a4bf60480 Reviewed-on: https://gerrit.libreoffice.org/30071 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-10-20Various loplugin warnings (clang-cl)Stephan Bergmann
Change-Id: I9e3720c86f96abc864a52c0469032132808080a4
2016-10-18Check SAL_USE_COMMON_LAYOUT envar in one placeKhaled Hosny
Makes it easier to flip the switch in the future (or even do something more fancy other than checking envvar). Change-Id: Ie42ca012c167b2108f0fca1ce9ff7beee95f1be7
2016-10-18Cache HarfBuzz fontKhaled Hosny
We now create it only once per physical font, saves us few percents from the all over time spent on layout. Change-Id: I8de582cb20a168c93d72921e539c2477fa97fb54
2016-10-18GSoC: Speed up CommonSalLayout by caching hb_faceAkash Jain
Cache hb_face so it is not created again and again. Switch from GDI to DirectWrite on Windows to obtain SFNT table data. Change-Id: I9c532cd72e1f6b57313f3b7d42a6b9b0633eb0ef
2016-10-18GSoC: Move TextOutRenderer definition to winlayout.hxxAkash Jain
Change-Id: I705f92d5ad55d7612c6413436c801de13f5352a6
2016-10-18GSoC: Integrate new CommonSalLayout in win/ codeAkash Jain
Change-Id: Ifeb2fa7ca9e2cd0da1c504d4e770aa0bb1b0b0de
2016-10-18GSoC: Modify DrawServerFontLayout and add DrawSalLayoutAkash Jain
Modify the definiton of the DrawServerFontLayout method. Add new DrawSalLayout method which will be used for drawing text independent of the platform. Change-Id: Ie3eefb172b1781c685def1ef549db2538f672a62
2016-10-18GSoC: Move code from winlayout.cxx to winlayout.hxxAkash Jain
WinFontInstance definition moved to winlayout.hxx. It has to be used in the new layout class. Code and headers which WinFontInstance depends on also moved to winlayout.hxx Change-Id: Idc8f87e6601c220d504398671326b1f23d1779a3
2016-10-18GSoC: Move winlayout header file to vcl/inc/winAkash Jain
The winlayout header file will need to be included in the new layout class. Its better to move it to vcl/inc. Change-Id: Ifb4170e1948dc56b5ec1728380eff7c2b4a07137
2016-10-18GSoC: Add a generic GetTable function for WinFontFaceAkash Jain
Change-Id: Ia10ffd8c4b5e0cef89571204f5f1df32daa9edb7
2016-10-15clang-cl loplugin: vclStephan Bergmann
Change-Id: I40f8a6fef9d66b28a1d72551a6873b041b38b09e Reviewed-on: https://gerrit.libreoffice.org/29841 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-10Expand some silly macrosStephan Bergmann
Change-Id: Idf7b9285c655aef40e2618b44c35248ccd13084d Reviewed-on: https://gerrit.libreoffice.org/29663 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-10tdf#89307: Removed SvRef::operator T*()Jacek Fraczek
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-05InfoFont/Color is not used by vcl nowCaolán McNamara
anywhere anyone wanted to Get[Font|Color] give it the Label ones instead. why this is exposed through uno is bewildering, stubbed those out for the moment Change-Id: I7a31d027287436be1c075c76a370047efd010bf3
2016-10-03Fix typosAndrea Gelmini
Change-Id: Ie75beb4e282a4d1b784a5847262e39cf9c851527 Reviewed-on: https://gerrit.libreoffice.org/29440 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-30vcl: remove WNT ImplFontAttrCacheMichael Stahl
The fontnames.dat cache turns out to be unused in release builds; it contains the fonts in instdir/share/fonts but in the MSI these are always installed into C:/Windows/Fonts nowadays. Change-Id: Ibaac87515310d659566622e006b3b7ec01c7551e
2016-09-29vcl: fix some mysterious WNT font cache fileMichael Stahl
Apparently VCL maintains a mysterious fontnames.dat file in the user config, but it's currently completely borked because the "styleName" is written differently than it is read. Also increment the magic number to ignore existing invalid files. (presumably regression from 5c24789ca33d7b2b0c39626208cf0708fb470d95) Change-Id: Id94eef1c56ab928d3d2e43ec13d9a5d91b37df90
2016-09-15replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)Michael Stahl
... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-07loplugin:constantparam in vcl..xmlscriptNoel Grandin
Change-Id: Icf66c08071b154259c9e551342d30331caf2b15a Reviewed-on: https://gerrit.libreoffice.org/28685 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-06SalI18NImeStatus is stubbed the same way for everyone except...Caolán McNamara
the gen vclplug, which is then unused for the gtk/gtk3 case so only possible to use in gen/kde. Make the default impl the no-op case and override just in gen Change-Id: Id0dd3fe4ae4e5b94bfc56219defab56905ec710a Reviewed-on: https://gerrit.libreoffice.org/28675 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-05convert DuplexMode to scoped enumNoel Grandin
Change-Id: Ic6f6e11437e75d17630683196c1b94dc25dd888f
2016-09-05convert Orientation to scoped enumNoel Grandin
Change-Id: Ifbfcf3557ca2a16d21e7a1d613ee54c1c6625f07
2016-09-05convert OutDevSupportType to scoped enumNoel Grandin
Change-Id: I7a1e4448dfff0ea6909149533d228829d980796c
2016-09-02boost::intrusive_ptr->tools::SvRefCaolán McNamara
Change-Id: I4c913dc62efe3f3747e78670f4efb0216d95c4ad Reviewed-on: https://gerrit.libreoffice.org/28585 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-25-Werror,-Wswitch (clang-cl)Stephan Bergmann
Change-Id: I874e103486dd77842a2299e0f20fe42ef6a7eaf5
2016-08-25-Werror,-Winconsistent-missing-override (clang-cl)Stephan Bergmann
Change-Id: Ie06e9ba94697c40fa03a535ad3f03c5ff181266e
2016-07-30Fix SolarMutex not locked when using IME on dropdown list.Mark Hung
Surround ImplHandleIMEQueryCharPosition() by ImplSalYieldMutexAcquireWithWait() and ImplSalYieldMutexRelease(). Change-Id: I3843ad351f3b92801cd1e0066a3c73f2a52c44bd Reviewed-on: https://gerrit.libreoffice.org/27117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2016-07-28tdf#101026 Create more correct replacement control vectorArmin Le Grand
Change-Id: I909adaab3dca3c1bac4331b164343cdbc1205df2 Reviewed-on: https://gerrit.libreoffice.org/27365 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2016-07-07tdf#82214 optimize PatternFillPrimitive and SVGArmin Le Grand
Use buffering in the drawinglayer, and don't do slow stuff in the windows gdi renderer. Conflicts: svgio/source/svgreader/svgstyleattributes.cxx Change-Id: Id955ee6a3b03e568c2678f02d77af35d2e5ba1d4
2016-07-07tdf#82214 optimize performance for primitivesArmin Le Grand
See svg bug doc, which is processed quite slowly. Beyond needing faster renderers, there is also demand to improve the handling of primitives created by SVG import. Conflicts: drawinglayer/source/primitive2d/patternfillprimitive2d.cxx vcl/win/gdi/gdiimpl.cxx Change-Id: I10992a5746b8b2d6b50e3ee3fe415a035685c9ba
2016-07-04comphelper::OBaseMutex -> cppu::BaseMutexNoel Grandin
convert usage of deprecated class, and remove the old class Change-Id: I19fb9271090d19e5531622b58492e1a848d306e2 Reviewed-on: https://gerrit.libreoffice.org/26843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-04tdf#98710 check the font is bound, substitute FON fontsTomaž Vajngerl
If we can't bind the font then we can't proceed with rendering and caching of the glyphs. This may avoid the crash but the font won't be drawn. This happens for old Windows 3.1 bitmap fonts in FON format which Direct Write doesn't support. So in addition substitute "Script" and "Roman" FON fonts with "Times New Roman". Change-Id: I16b480399b47989738a703ad84c0398493f9f4e3 Reviewed-on: https://gerrit.libreoffice.org/26885 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-06-27loplugin:singlevalfields in vcl(part2)Noel Grandin
Change-Id: I4782c6f6d3d090ba0f9e29af8afdd7d88aa2d382 Reviewed-on: https://gerrit.libreoffice.org/26598 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>