Age | Commit message (Collapse) | Author | Files | Lines |
|
We can get polypolgons with polygons that have 0 or 1 point only,
so we need to guard agains division-by-zero errors by skipping if
we detect such polygons (as we can't draw them anyway).
Change-Id: I08c4f4c9bb946fcbaedede4b4ae23c96e431190e
Reviewed-on: https://gerrit.libreoffice.org/31790
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Some intel drivers crash when areaScale shader with "large" array
is used. This adds a "reduced register" version of the areaScale
shader. We still use the first version of the shader for other
drivers and switch between the 2 implementations with a runtime
detection.
Change-Id: I1860f898c03b40a600eb1b41f7262719382a7171
Reviewed-on: https://gerrit.libreoffice.org/30571
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit d115a235bf3ff5366d992d01fb418a3eacb9d125)
Reviewed-on: https://gerrit.libreoffice.org/30764
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: Ied73966633e5ffd56faccea7ec1408bd83642b58
Reviewed-on: https://gerrit.libreoffice.org/27862
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/27922
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
To get the anti-aliased polygon we draw a anti-aliased line around
every trapezoid. This works fine until we draw a transparent
polygon where the lines become visible because of blending. A much
better and faster way is to just draw the polygon outline with
anti-aliased lines. This is done with this commit.
Same fix as aeb0c407a620ea8c28903f61d9d53e6d9ae7c53a in master,
but the code differs in 5.2 from master so much that it is generally
a separate implementation.
Change-Id: I95f98cc930caa7138a59048af68d4015046334d4
Reviewed-on: https://gerrit.libreoffice.org/27923
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
When we batch a draw command we need to start the flush timer
(if not already started) as otherwise it could happen that we
won't flush the offscreen texture at the correct time or at all.
This fixes a problem with drawing of pop-up "help" text.
(cherry picked from commit e1296e295e7d4f1104d2c90b1f51d52251358bea)
Change-Id: I6afcf173c3ac517ed0612cd413d95e28c19faa81
Reviewed-on: https://gerrit.libreoffice.org/26629
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
|
|
drawAlphaBitmap didn't use a high quality scaler for scaling
the texture but used the default scaling method in OpenGL (either
GL_NEAREST or GL_LINEAR, whichever is defined when texture
is created) which are low quality scalers - especially when
downscaling textures.
Change-Id: I6236b2ee92b9e5044b176a40a444027072b09b58
(cherry picked from commit 19baa61e1d7b140b9e24717f7080617ab3d324d4)
Reviewed-on: https://gerrit.libreoffice.org/26096
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
|
|
AMD drivers don't work well if a shader has a defined but not
enabled shader attributes. For this reason we need to make sure
that all attributes are set to some value even if the shader
doesn't use that attribute. Intel drivers, on the other hand,
crash if you enable an attribute and don't set it (set it
to null) - so we can't use this workaround.
Change-Id: Ic076cf8a5fac8ef048d0054e6e4340b47b4d5188
Reviewed-on: https://gerrit.libreoffice.org/25591
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit fdcd13c1c2b8b9fbc3480c8fa92920d8c8d4e5a7)
Reviewed-on: https://gerrit.libreoffice.org/25594
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Combine most common shaders for non-texture drawing and texture
drawing into two combined shaders. Inside the shader we switch
between the code paths with if statements.
Using if statements (or any other branching statements) is
discouraged inside shaders but on the other hand we reduce program
state changes if we have less shader changes - which is more
important for us as we want to push more work to the GPU.
Change-Id: I6701b93faa9b0f55dd0af6d983ce4c2de4539c70
Reviewed-on: https://gerrit.libreoffice.org/25357
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I9c2d5c5ca4761867a0a38cb3bc3c4973454ee992
Reviewed-on: https://gerrit.libreoffice.org/25157
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Rendering polylines, polygons, polypolygons which take an array
as parameter ("legacy" code) can re-use the other, already
existing code paths (same thing as "headless" svp backend does).
Change-Id: Ie45812d7fce6bc70484e9f0c05cc81e995800bcb
Reviewed-on: https://gerrit.libreoffice.org/25156
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: Ib3d2367fc5c0e97b269e6a4b18f85c20ca89221e
|
|
This adds tracking of GL_BLEND and glBlendFunc which are usually
set when setting up the current draw call on OpenGLProgram with
SetBlendFunc method.
Until now the final draw call (glDrawArrays) was called outside
of OpenGLProgram. This is a problem because we need to know if
we did call SetBlendFunc or not between when we used or reused
the current program. So we added DrawArrays to OpenGLProgram and
refactored all draw calls in OpenGLSalGraphicsImpl to use this.
From now on glDrawArrays should not be called directly but always
through OpenGLProgram.
Change-Id: I530b4b948af8a962669a3751e1a95ff3986ffec9
Reviewed-on: https://gerrit.libreoffice.org/25083
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Remove the subdivider we used until now as there is a better
way to subdivide a polygon with getDefaultAdaptiveSubdivision,
which in additiona also caches the result. The subdivider used in
getDefaultAdaptiveSubdivision was a limited count based subdivider
so this exchanges that with an angle based one which gives much
better results.
Change-Id: I95c009ccf3d54305df0d8eef177cab0df0a23bea
Reviewed-on: https://gerrit.libreoffice.org/25033
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I79e97a4826bfe3918de223cccf48646a1404f901
Reviewed-on: https://gerrit.libreoffice.org/24922
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Change-Id: Iaaef4d90d7fe817a32cd51652d41c2e49c8909a4
Reviewed-on: https://gerrit.libreoffice.org/24832
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Probably what is meant is the name of the function, which is doFlush().
Change-Id: Ia949a2f8ce19950b1cd0b676c5146488ce7182ee
|
|
Change-Id: If9f725c791f9d01efba098caed8387f21862fa04
Reviewed-on: https://gerrit.libreoffice.org/24825
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Avoid GL errors when glDisable() is called without a context.
Change-Id: Ie9eae498c207a82934228ad2f74b7096308f5530
|
|
We don't want to set the viewport over and over again.
Change-Id: I60b84a009d4058743e30587616604f9b6fc0f601
Reviewed-on: https://gerrit.libreoffice.org/24507
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Scissor and stencil test needed to be disabled in flush() (which
means every postDraw call) because sometimes the state became out
of sync with the current state. This commit adds sync() function
which synchronises the actual OpenGL state and adds debugging
mechanisms to warn when the state becomes out of sync (so we can
inspect the exact moment in apitrace).
Added a GenericCapabilityState for GL capabilities like
GL_SCISSORS_TEST, GL_STENCIL_TEST, GL_BLEND,... and refactored
existing ScissorState and StencilState to inherit from it.
Change-Id: Ifc159108a5ce850c78a89b1f5b8d12ecdd84f459
Reviewed-on: https://gerrit.libreoffice.org/24506
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: Id3e15e91316df740f04a42ed8c95b77d83240b5a
Reviewed-on: https://gerrit.libreoffice.org/24505
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
For performance reasons we shouldn't set glScissors if it is not
necessary so we remember to what dimensions we set the glScissor
and don't set it again if this is not necessary. The same goes for
enabling/disabling the GL_SCISSOR_TEST.
Change-Id: I5e1383081b4e76bdded04525c780d3a724f9db5c
Reviewed-on: https://gerrit.libreoffice.org/24504
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
The property stroke-miterlimit is transported to the renderers
via a new member mfMiterMinimumAngle in class LineAttribute
Several drawPolyLine methods are adapted. This patch does not
include changes in MetaAction. Presentation mode, printing, and
PDF-export is still wrong.
Corrected LineJoinMiter to LineJoinBevel in canvas, that s closer
to NONE. Removed DrawPolyLine method without MiterMinimumAngle
and adapted calls accordingly.
Change-Id: I6bcd24add5d85c4d9a39e3788e0682091c5fc9c4
Reviewed-on: https://gerrit.libreoffice.org/23946
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
|
|
Some system glm libs don't (yet) have atan2 available and it is not
really needed in this case anyway (as we don't use it for glm::vec2
for example) so just replace it with std::atan2.
Change-Id: I5d417338ec167489f0252821650c64be454cca8a
|
|
Change-Id: I1c363a8f1d21bbacab0c5785544aa8becfe39363
|
|
Change-Id: I403f148060891feec56d7d2ef173a9c4934baf9e
Reviewed-on: https://gerrit.libreoffice.org/23995
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Change-Id: I41a182c5309586337032328dfe82b1c6715f0dc2
|
|
Change-Id: I6a627699d49bad47213788877fa3947ad2ef83f4
|
|
Switching between textures is not cheap, so minimizing the amount
of switching performs better. So instead of immediate drawing we
can accumulate texture draw actions and defer drawing as long as
possible. After that switch all accumulated textures and draw
everything needed with one GL draw call.
This is beneficial for text drawing as we cache many glyphs in
per textue.
Change-Id: I1b94b9ac6a5f2c1a3dbbd75f4df76436a5d40f31
|
|
Change-Id: I35551656e5d5d65fd94d60b04e7a07cf1f4be003
|
|
Change-Id: I7c911f2aaccbffacfa5673b120b6177b8bea0672
Reviewed-on: https://gerrit.libreoffice.org/23864
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
also some improvements to the plugin
Change-Id: I0e3a519d70756e577fcb1bd47dd66864b5b4c871
Reviewed-on: https://gerrit.libreoffice.org/23289
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Change-Id: I0d5bfdf44dde2cd06c193f34e81c6ce71291bba1
Reviewed-on: https://gerrit.libreoffice.org/23238
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Merge in some interesting font / unicode combinations from bugs.
Change-Id: I2c89cf505a7850fcc482826328e1cdb8e37508aa
Reviewed-on: https://gerrit.libreoffice.org/23056
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Force cast to double to avoid integer division - which gives a
wrong inverse scale value.
Change-Id: I0135e44ef07f3915619f9dfead9aadf50fc03685
|
|
Adds native opengl polyline rendering to draw polylines, line joins
and line caps as triangle strips. The vertex shader allows for the
dynamic line width by calculating the correct vertex posiitons,
and the fragment shader is used for anti-aliasing.
Change-Id: If7982c828cae1fae59c57194c8ac77e5ad7f1d26
|
|
Change-Id: I27efebcc1c24d45c17da2ad2959b673153c3eead
Reviewed-on: https://gerrit.libreoffice.org/22297
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
When image was rotated towards 90 degree the ixscale and iyscale
went towards infinity. That caused problems in fragment shader
areaScaleFastFragmentShader. The problem was with calculation
of destination width and height which didn't take rotation
into account correctly. This commit takes this calculation
from WinSalGraphicsImpl::drawTransformedBitmap.
Change-Id: I30f14a1ecda21ef167e58eda8e2fcef00bdfa2b7
Reviewed-on: https://gerrit.libreoffice.org/22289
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: I664e3815bcdaff82a03309ae387154914471a80b
|
|
Initially we start with a very low priority, so that the lame
bits of code that do eg. focus, and cursor rendering before the
document is visible do not cause a swap, flash. Then after we've
processed a REPAINT priority idle (hopefully our first paint) we
adjust the swap priority to highest.
Essentially a fusion of Tor's approach and mine.
Change-Id: Ib9b78a18fb9359ac8c3dee1cfeb30177c08fe162
Reviewed-on: https://gerrit.libreoffice.org/21405
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
|
|
Change-Id: I422ea8cfb8a81cca36203d496b92e15ea5b449d2
Reviewed-on: https://gerrit.libreoffice.org/21291
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Also revert "tdf#96257: Silly work-around to produce same result ..."
from commit ec8bc265050d86a749140c353360a78cce4e3fce.
XOR rendering (it turns out) behaves oddly, and not for all operations.
Change-Id: Ie07d988bbf7fed10fb5625ac547a01a306b05319
Reviewed-on: https://gerrit.libreoffice.org/21282
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: Ic5bfc72c75745d0a4d9ff165d840ab51c90a8690
|
|
Re-work the makeSomeOpenGLContextCurrent logic into a shared function
with the existing AcquireContext logic in the SalOpenGLGraphics impl.
Use an OpenGLVCLContextZone placeholder to do both context and zone
management - to include destructors into the zone.
Fix a number of error cases around SalBitmaps where we did not have
a GL context associated when allocating, and/or freeing textures..
Don't drag a (potentially) slower context around in the
OpenGLSalBitmap when we're going to check / fetch a better VCL
context anyway.
Change-Id: Ibbb2358c47156cd078ad28b6aad4f03af36aaf23
Reviewed-on: https://gerrit.libreoffice.org/21127
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: Ic9d90bb7f652599b5a6ce303aa026b7e4e255324
|
|
Also significantly simplify, and remove paranoid ramblings
from the flushing code.
Change-Id: Ie7cc742caac290d77ac931c54cc4fe777a7872de
|
|
Change-Id: I3085e2d2848e2041c2faadbfce099ce75c62b712
Reviewed-on: https://gerrit.libreoffice.org/21043
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: Ie4d03a01c557e93a3ba3b5925896e38ed07f9a27
|
|
Change-Id: I097f1c1fb7fb505b6859289997bff3562fc06ba6
Reviewed-on: https://gerrit.libreoffice.org/21027
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: I8488cb8e8074831a6f81e6c8c122462c9819d25d
Reviewed-on: https://gerrit.libreoffice.org/21025
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
|