Age | Commit message (Collapse) | Author |
|
and check it on untrusted data
Change-Id: I7c97a27d70f91b9686adf9dcb8b68c5aa25c2b4c
Reviewed-on: https://gerrit.libreoffice.org/18637
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Unfortunately, since we can have 2x SalGraphics' on a OutputDevice,
and one of these can be a printer - things got very confused around
which context to glFlush. This de-tangles the various reference-counts.
Change-Id: I1062be0b02a91fc9009deaa3ec29c5dbb227df20
Reviewed-on: https://gerrit.libreoffice.org/18604
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: I6b9fb899777d8e460999ac3ff038a1302e434bb5
Reviewed-on: https://gerrit.libreoffice.org/18605
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
We need to ensure that we use an initialized context, and that
(when we re-parent) we DeInit and so reset the previous OpenGLContext.
Make UseContext more paranoid as well for good measure.
Change-Id: Ia45334222045e5d2f48da47560fab8511223a9a5
Reviewed-on: https://gerrit.libreoffice.org/18601
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: I09db7262c2a6180a078620ba086dd7a4c132bd82
Reviewed-on: https://gerrit.libreoffice.org/18459
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Reviewed-by: Martin Hosken <martin_hosken@sil.org>
|
|
There were two problems here:
1) The OpenGLContext ctor registered the instance on the list of
contexts, but platform-specific call (e.g. wglMakeCurrent()) was only
made later. Add a registerAsCurrent() member function that helps
ensuring that the last item in the context list is indeed the current
context.
2) OpenGLContext::prepareForYield() is called without the solar mutex
being locked, but it still assumes that the last context in the context
list is the thread's current context, which may not be true. The result
is that during JunitTest_sd_unoapi, we end up in a situation like:
debug:4640:5240: OpenGLContext::registerAsCurrent: wglGetCurrentContext() is 00010001, pSVData->maGDIData.mpLastContext is 00FA65F8
debug:4640:7944: OpenGLContext::registerAsCurrent: wglGetCurrentContext() is 000D0003, pSVData->maGDIData.mpLastContext is 00FA6C70
debug:4640:5240: OpenGLContext::prepareForYield: start, wglGetCurrentContext() is 00010001, pSVData->maGDIData.mpLastContext is 00FA6C70
I.e. one thread registers as current, an other registers as current, too (while
the other thread has the solar mutex), then once the original thread wants to
release the solar mutex, the real current context and the last item in the
context list won't match, so the assert at the end of prepareForYield() will
fail.
Fix this by releasing the GL context in WinSalInstance::DestroyFrame().
With this, JunitTest_sd_unoapi passes on Windows with GL enabled.
Change-Id: Icfb9c65c871586b5df69b5a2ab3aa91843dfc799
Reviewed-on: https://gerrit.libreoffice.org/18473
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: I4a7199633d0d940ae009ac144989da7d6c9262ec
Reviewed-on: https://gerrit.libreoffice.org/18378
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
|
|
Cached glyphs used to have a 2px border in all font sizes, that's too
small for larger fonts. Make the border size depend on the font size for
larger fonts to make sure that the rendered glyphs are indeed
independent. The introduced GLYPH_SPACE_RATIO = 8 constant is the
smallest value where I don't see overflows anymore for large fonts.
With this, not even the bugdoc renders correctly when presenting, but
also the text is OK when the font size is set to the max allowed by the
UI (96pt).
Change-Id: I52aa5c4444583fc0467291463697a63f2b8fc86c
|
|
These source files relied on pch to include
these missing headers (at least on Windows).
Also included the script used to find the
missing includes. The script is self-contained
and includes unittests. It detects superfluous
includes and required includes (which was used
to restore the includes in this patch).
Change-Id: I7ee09e5c712f42d5f6c3524898bc62dda78f5cc0
Reviewed-on: https://gerrit.libreoffice.org/18208
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Fixes regression from otherwise a nice cleanup in:
d20092259c7ea63885a539f911788715f8147ee9
Also get polarity of debug logging only with a context right.
Change-Id: Id322471f01e5656e758aefc57b0d4d5ad073ec54
|
|
The problem was UniscribeLayout::DrawCachedGlyphs() counted the total
advance value unconditionally from mpGlyphAdvances, while
UniscribeLayout::FillDXArray() (which provides advance values to e.g.
Writer) only used mpGlyphAdvances in case of NULL mpJustifications. Fix
this by first checking mpJustifications in
UniscribeLayout::DrawCachedGlyphs(), too.
With this, e.g. typing "x" in Writer 10 times will not result in a
"misplaced" cursor caret.
Change-Id: I16c7a258ff77b25c5121b9b974e72ad6efe5e9fc
|
|
For one, aPos.Y() is meant to be the baseline position of the text.
Based on the MSDN documentation and
<https://www-user.tu-chemnitz.de/~ygu/petzold/ch05c.htm>, that means if
we want to get top position, we have to only extract tmAscent and not
tmInternalLeading.
For another, ImplWinFontEntry::AddChunkOfGlyphs() adds a border of 2
pixels both horizontally and vertically, which means that then we need
to undo that when counting the vertical position, too.
Change-Id: I4ac8e881ea5910662674c2a1b53ece943487ccd9
|
|
Change-Id: I21726d0dd052fdc87e8dd36ff7122518325f6313
|
|
Should do similarly for vertical text, too.
Change-Id: I51f5ee3ba1686f151b04f98c43388e0bdfac97fb
|
|
Follow-up to 34700400247e378e074ce4164ab2809edb092201; this fixes sw_ww8export
unit test on Windows.
Change-Id: Ic0c3228efb59a182e1562b73117418cd8b5e6017
|
|
SAL_DETAIL_ENABLE_LOG_INFO is always defined, as "true" or "false". It
is SAL_LOG_INFO that is defined or not, and can be used to avoid
unnecessary non-trivial code that the compiler might not be able to
optimise away.
Change-Id: I9903faab64b39fee86bff3b085cdce3614b0d921
|
|
Change-Id: I1491ea35af3b8237a9b8f6357e6452b323139e99
|
|
Can't call a function that as a side effect prints to std::cerr in
SAL_INFO. It will be called even if the log area doesn't match
$SAL_LOG. Just use only SAL_INFO and no plain std::cerr output. It's
fine to output a string with embedded newlines in SAL_INFO.
Also drop the debug output line with the glyph start positions, it was
less than useful.
Change-Id: I9fb5ed068aae1b835e20cf1ec1097bcd55deb05d
|
|
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
|
|
Change-Id: I67d2430aec782efa7916856584028f469d39355c
|
|
Change-Id: I918a47da16a539f981baa9a8c1e5a7a5cf642cf4
|
|
It says there's access to uninitialized variable on that line,
so propbably the loop is running over.
Change-Id: I0226f82b20a6fbbc79af5bbb46af09830c3bc25a
|
|
This reverts commit e16e64dd862c8f386f80de43ad68e831e169d49d.
I somehow forgot that glFlush is context specific, (gl always gets
me that way).
|
|
Change-Id: I45cb0e62278d8c3154ae8ad54ca4c93b3e177969
Reviewed-on: https://gerrit.libreoffice.org/18030
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Can now be turned off with a SAL_DISABLE_GLYPH_CACHING environment variable.
Change-Id: I7ac14d72dc0f85c0682d92492eb96bec1d207609
|
|
That is a too complex and rare case to bother with, I think.
Change-Id: Ica6ef7fa05314d2367dcff32627c1aec6ba8f8df
|
|
Change-Id: I7b06d0ffe53c6ebf2b479951321dcb37cb22c355
|
|
Change-Id: I46e5463aaa5cab41cd69c13314ee98a0c73e7ba2
|
|
Change-Id: I6b19873eef48b625dc3d4f7b3a9afdb348189b38
|
|
The text alignment of DCs is set to TA_BASELINE in
WinSalGraphics::InitGraphics(). In the ScriptTextOut-using old code
path this affects where glyphs are put, so we need to take it into
consideration also in the new code path that uses cached glyph
textures. Adjusting the position up by the ascent plus internal
leading of the font seems to work at least for horizontal scripts.
(We used to bluntly adjust the position up by the height of the glyph
cache texture, which was too much. The glyphs got positioned too high
and the top of tall ones was clipped.)
Change-Id: I86aecd6f3016e14b2f0328555ddfd3129e394c4c
|
|
Change-Id: Id023b43e901b0e41ebf3b208c6e80fd023bf7f9a
|
|
Show the whole height of the cache bitmap after all (when SAL_LOG
contains vcl.gdi.opengl). The interesting pieces are often at the
bottom, like the tip of the hook of the "j" glyphs that used to bleed
over into the preceding glyphs, usually "i", when they were rendered
into the same chunk.
Add more space between glyphs and at top and bottom of the bitmap, for
anti-aliasing. The glyph ABC widths don't take expansions caused by
anti-aliasing into consideration and are misleading. Hopefully
anti-aliasing can expand the (partially) painted pixels of a glyph
just one column/row in each direction, but for safety use a two-pixel
border. (Defensive programming, eek?)
Some getWidth() instead of GetWidth() etc craziness. Using
<tools/gen.hxx> types truly is programming-by-coincidence as Thorsten
says.
In a dbgutil build, setting the environment variable
VCL_GLYPH_CACHING_HACK_NO_ANTIALIAS causes the code to turn off
anti-aliasing for the fonts used. I used this to verify that it indeed
was anti-aliasing that made the ABC widths inconsistent with
reality. Not sure if it makes sense to keep this code in?
Anyway, now I don't see any leaked pixels in "i" glyphs any more,
touch wood.
Change-Id: If527343ff1dcdb1fa208cd5e7fa4d08f812d0d7b
|
|
Change-Id: I29cb771eb059f560b7cbd449257ffda581b40f11
|
|
Change-Id: I934ad7453f35909f4c3ad999e33453b5b6032480
|
|
Now text looks better, for instance the lower-case "t" glyphs on the
Start Centre aren't totally weird any more. But for instance the tip
of the hook of "j" leaks into the "i" texture. I guess I really would
need to render glyphs one by one.
Change-Id: I69ae2d2f7c559530bcfdfc1a4915503fcb3ab4af
|
|
Change-Id: I0bbea4ef62c8e94d8b8f1bfb440712da5839e532
|
|
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
|
|
Polygon is one of these names that Clash with some system objects
A similar work has been done earlier with PolyPolygon.
Change-Id: Icf2217cb2906292b7275760f1a16be0e150312f5
Reviewed-on: https://gerrit.libreoffice.org/17789
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
|
|
Change-Id: Ia41882a4d33e7b148044801902517b2b034d3ee4
|
|
Use Uniscribe also for non-complex text. It is complicated enough to
have separate Graphite and Uniscribe layout engines. Will make further
changes to the code easier to manage, especially as with the
UniscribeLayout code we have access to the actual
glyphs. (Cf. 3e47219e06b9a279ba22a9bbef668731f2d3e07d)
Change-Id: I9c67c172fe3e3d26d1c6cb1c0b7f1516b0b87f12
|
|
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
|
|
It is really ugly to use SAL_OVERRIDE inconsistently.
Change-Id: I8b556a9cc65e6f71198d126d07ce1559216543e9
|
|
Change-Id: I0d0cb1ef1e7b7f4747204b84c7c910f174e9c7b5
|
|
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>
|
|
Change-Id: I6801618efb5a66d24156fa429e026acb6ca03aba
Reviewed-on: https://gerrit.libreoffice.org/17506
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Change-Id: I3170dec0578e0e54a2edb85e0a3a8fcd796b94ae
|
|
Change-Id: If81b165bf910661a2742ab4fd5123ad8b97ae7d2
|
|
after commit b97aa3faa03e5944aac8f3c35a8c198fba295e83
"Remove the unnecessary type definition: HPBYTE"
Change-Id: Ifd73ecb7e923ef38826d24c3d251be29eda472bf
|
|
HPBYTE is a duplicate defintion of Scanline as seen below.
include/vcl/salbtype.hxx:
34: typedef sal_uInt8* HPBYTE;
35: typedef HPBYTE Scanline;
Remove the definition of HPBYTE and inline the definition of
Scanline. Replace all instances with sal_uInt8*.
Change-Id: I8a79a9d6c45af57fbabf8d3e6a04a1b5eba15a7b
Reviewed-on: https://gerrit.libreoffice.org/17175
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
|
|
...to avoid lots of loplugin:staticmethods warnings. Also enables DBG_ASSERT
etc. also for --enable-debug builds in addition to --enable-dbgutil builds.
Change-Id: Ib89ecd9ab8ce7abb2c64790ace248b31f9d2b64d
|