summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2020-05-08compact namespace in dbaccess..dtransNoel Grandin
Change-Id: Ie4b619dd19cc4d12d240759abea9c3ffdedd5c7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07tdf#132199: put glow before shadow, to have shadow of the glowMike Kaganski
Also take modified color into account when drawing glow. Change-Id: Iba136d2695cb783d13ff251d087066c2e8803d63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93605 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-07tdf#101181: improve glow effectMike Kaganski
The shadow of objects must not be scaled: this displaces any internal areas that need blur, e.g. holes. Instead, it needs to dilate the shadow using kernel with radius equal to blur radius: this allows the borders of dilated objects to be in the middle of the blur area. The following blur makes those new margin points to have 50% intensity, and full glow intensity at the point of old object margins. This also removed artifacts when moving objects with glow effect caused by mismatch between scaling and D2D range calculation. The D2D range therefore is not calculated by scaling, but using grow. Blur filter's "extend bitmap by blur radius" option got obsoleted and removed. There's no need to blur the glow color (24-bit RGB). Instead, glow bitmap must be filled by glow color, and have an alpha mask that is blurred accordingly. This makes the glow properly transparent, and also reduces the blur complexity which now only needs to process 8 bits of alpha channel. The object shadow is created using basegfx::BColorModifier_replace inserted into the 2d decomposition of the effect, as before. To make sure that any non-fully-transparent pixel will become black pixel in the shadow, black color is used, and the result is further processed in VclPixelProcessor2D::processGlowPrimitive2D with monochrome filter using threshold 255. Glow transparency attribute is taken into account: the initial value at the margins of the objects. Color replacement filter is used to replace the object shadow with the attribute value before blur pass. Correct blur radius is used, calculated from glow effect radius, instead of hardcoded value of 5 pixels. This makes the glow to fade gradually along the full width of the effect, instead of only fading in narrow outer border previously. Since blur filter is only implemented for radius up to 254 pixels, and since downsampling the shadow before blur increases performance without noticeable quality loss, the image is downsampled before filtering. It should be noted that the glow effect is almost identical to soft shadow effect, likely with the only difference of using dilation in the former, but not in the latter. The code might be reused later to implement soft shadow as well. Change-Id: I728c532f9df7ccf85f353c23c6c7d8352d7b2086 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93235 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-07fix memory leak of xmlDoc objectsNoel Grandin
in unit tests Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-06This comparison is redundant, radiuses are compared belowMike Kaganski
Change-Id: Idb98314877518beefdd12dd95bbbb055f3aa429d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93549 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-06Use default ctorMike Kaganski
Change-Id: I1f692f706f2e688384c01e99c14307190bf70104 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93548 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-04drawinglayer: extract constant in renderWrongSpellPrimitive2DTomaž Vajngerl
Change-Id: I131e2d5620d027f32dc2929cd12fedb168e30e9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93390 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04drawinglayer: flatten renderWrongSpellPrimitive2DTomaž Vajngerl
Change-Id: I93ff19f9f54b6f14c660af554d697b9ba525f81c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93389 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04remove helperwrongspellrenderer.{cxx,hxx} from clang-format blacklistTomaž Vajngerl
Change-Id: Ib0b1f389189012ab27dd061481737ac6a6a1a84e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93388 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04pragma once in helperwrongspellrenderer.hxxTomaž Vajngerl
Change-Id: I25aac069b9212824fee50240a1b6682bf7e6f0f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93387 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04organize includes in vclpixelprocessor2d.cxxTomaž Vajngerl
Change-Id: I1590e437946aaa4bd3a8b6a2c47d2ee17d2060a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93386 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04organize includes in vclprocessor2d.cxxTomaž Vajngerl
Change-Id: I1117eb86823762882d463c6e4d3b295efaa3151c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93365 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04dl: replace OSL_ENSURE with SAL_WARN_IF in impBufferDeviceTomaž Vajngerl
Change-Id: I457b9310109157da03b6c310783651f5232d2054 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93364 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04drawinglayer: remove aBuffer typedef in VDevBufferTomaž Vajngerl
Also use back() method on vector instead of end() - 1 Change-Id: I944691d097f82b1651cff87a7bb0d7c457ece27a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93363 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04remove vclhelperbufferdevice.{cxx,hxx} from clang-format blacklistTomaž Vajngerl
Change-Id: I0ab6572ab700756322f96b982f7faeb6d8dc9fb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93362 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-04pragma once in vclhelperbufferdevice.hxxTomaž Vajngerl
Change-Id: I12e53849fa23496799ba5e45fc0077cb9b54048c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93361 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-02remove vclpixelprocessor2d.cxx from clang-format blacklistTomaž Vajngerl
Change-Id: I03ad72d0754cb8c180f4eab0e8040c3dab533ef9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93321 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-02remove vclprocessor2d.cxx from clang-format blacklistTomaž Vajngerl
Change-Id: I359dfb0fe6fdf88e9c8141186a770c4cde777161 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93320 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-27Make upcasting css::uno::Reference ctor require complete typesStephan Bergmann
The main reason for the "home-grown" UpCast introduced with 904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for css::uno::Reference" in 2013 was probably that we could not yet rely on C++11 std::is_base_of back then. A (welcome) side effect was that the derived class could be incomplete. However, specializations of UpCast relying on whether or not T2 is incomplete are obviously an ODR violation if the type is incomplete in some TUs and complete (and derived from T1) in others. And even if UpCast had internal linkage, it would still be brittle that its behavior depends on the completeness of T2 at the point of the template's instantiation, and not necessarily at the point of use. That means we should better base that ctor on std::is_base_of (which we can do now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on Clang and GCC if the completeness requirements are not met. This change fixes all the cases where types need to be complete now, plus any resulting loplugin:referencecasting warnings ("the source reference is already a subtype of the destination reference"). Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-26update pchesCaolán McNamara
Change-Id: I83a61da7dda6c72552eecd377f1c3744c92a797e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92909 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-23tdf#130058 Import shadow size.Gülşah Köse
Change-Id: Ie1cee377a33567088fb76ea47f0e6fc51d47f0fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92188 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2020-04-22tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/Gabor Kelemen
Turns out we can save about 500Mb of preprocessor input if we use rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper rtl::math::approxEqual from rtl/math.hxx and manage the fallout accordingly. Before: bin/includebloat.awk | head sum total bytes included (excluding system headers): 19017296671 After: $ bin/includebloat.awk | head sum total bytes included (excluding system headers): 18535432672 Change-Id: I1691171f3a309405a7099882ad9989d147f59118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-22uiobject.hxx only needs forward declaresCaolán McNamara
and update pches accordingly Change-Id: I411712532fd85961bffe6678416fcdc1d9c7f53d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92617 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-19loplugin:flatten in drawinglayerNoel Grandin
Change-Id: Ieb5f682ec627c8d8ddfc286ec0e4422104b4d847 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92494 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-17Revert "[API CHANGE] remove some primitives rendering settings"Noel Grandin
This reverts commit c71656f51a09e88ecae4f3423c96fee84778647d. Reason for revert: I give up Change-Id: I2a09c36c1f0d731f4d3f7d809364de7efa8d8a58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92426 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-16[API CHANGE] remove some primitives rendering settingsNoel Grandin
Remove the following settings: QuadraticFormControlRenderLimit Quadratic3DRenderLimit RenderSimpleTextDirect RenderDecoratedTextDirect SnapHorVerLinesToDiscrete which have no way to be set from the user interface. Change-Id: Ie96531425f5ba6021ade4f247b18b99092fd7e5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-15move GlowPrimitive processing in VclPixelProcessor to own methodTomaž Vajngerl
The new method is processGlowPrimitive. Change-Id: I3e7eb9fc5ac45095dd0f6c3bff7d036e05864d89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92224 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-14fdo#43157: VclPixelProcessor2D replace OSL_ENSURE with SAL_WARN_IFTomaž Vajngerl
Change-Id: I4a6c46f9054f9a32d52f1f60f5f7547e62cf7a5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92223 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-14remove vclpixelprocessor2d.hxx from clang-format blacklistTomaž Vajngerl
Change-Id: I5fe33322ff0df5191f57f1364a2d32eefc889d68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92222 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-14remove vclprocessor2d.hxx from clang-format blacklistTomaž Vajngerl
Change-Id: I4fda4b3431c63d5870f074be15cff6064dc1ff95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92221 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-14clean-up namespaces and pragma once for VclPixelProcessor2DTomaž Vajngerl
Change-Id: I34fa0dc5cadbdfff8f70171715bc7cff462f7034 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92220 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-14clean-up namespaces and pragma once for VclProcessor2DTomaž Vajngerl
Change-Id: I9518a0bc6c30e0a544a52f1e996bfe8195e63cdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92219 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-14drawinglayer: refactor GeoTexSvxTiled::iterateTilesMark Hung
to provide a more generic callback interface and expose it as public to allow other usage. Change-Id: I6bc62a05fee750586f7281d8c24f2133884e77ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14tdf#104225: speedup hit test for FillGraphicPrimitive2D.Mark Hung
Default is to decompose and process the primitive recursively, but it is not necessary since the shape is regular. So perform the hit test using getB2DRange() like FillHatchPrimitive2D or FillGraidentPrimtive2D. Change-Id: Ie9d91943d2f3502938e41b7f6b0a364d9da15d63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-10Make BitmapPrimitive2D vcl-independentArmin Le Grand
as preparation to have drawinglayer module independent from vcl in the future Change-Id: Iaa01370f27b51cba5114a54f37d1ec73d0719918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92048 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-04-07split up polypolygonprimitive2d.cxx into separate filesTomaž Vajngerl
Change-Id: I39d1682f9d3781272590015f59ccafb33c0fd617 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91788 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-04tdf#131644 Do not depend on actual DPI during EMF+ importBartosz Kosiorek
Change-Id: If38062ddb9afc9af7a4e9cf2c701c7f801361a93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91434 Tested-by: Jenkins Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-04-04Removed duplicated includeAndrea Gelmini
Change-Id: I8c767c113ecf24077e35afb719a6544714caca0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91673 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-03split up polypolygonprimitive2d.hxx into separate filesTomaž Vajngerl
This patch splits the polypolygonprimitive2d.hxx into: - PolyPolygonColorPrimitive2D.hxx - PolyPolygonGradientPrimitive2D.hxx - PolyPolygonGraphicPrimitive2D.hxx - PolyPolygonHairlinePrimitive2D.hxx - PolyPolygonHatchPrimitive2D.hxx - PolyPolygonMarkerPrimitive2D.hxx - PolyPolygonSelectionPrimitive2D.hxx - PolyPolygonStrokePrimitive2D.hxx ... and fixes the include files and pre-compiled headers Change-Id: I23982e0c81e8992f69e14cbac8e86858266b9999 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91603 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-04-03remove polypolygonprimitive2d.{hxx,cxx} from clang-format blacklistTomaž Vajngerl
Change-Id: I3be7b8668dbf93a3a14b7b136dbe6057bfaf2f92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91495 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-25Fix typoAndrea Gelmini
Change-Id: Idd197f300e49dbce729e9399817bd36273d8de02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91069 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-03-25tdf#89901 corectly interpret COL_TRANSPARENTArmin Le Grand
in wmfemfhelper when converting Metafile to sequence of Prmitives. In the MetafileActions MetaLineColorAction and MetaFillColorAction usage of COL_TRANSPARENT must switch off line draw/resp. fill Change-Id: Id5754773c06b7f4aa8824dce9b8b9e7e526e6067 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91061 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-03-24tdf#131542 EMF+ Implement BeginContainer recordBartosz Kosiorek
Change-Id: If388ef4544001fb9064aed3ce979c2790ab0645f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90997 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-21move headers inside modulesNoel Grandin
Change-Id: Iad5c414861eb807e6246b8a988b94d66ef5f687d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90776 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-20EMF+ tdf#124424 Add support for transparency to LinearGradient and blend pointsBartosz Kosiorek
Change-Id: Ia1cabaef6aa01337581cb9359bdd1ae90a4ebd55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90767 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-16tdf#124424 EMF+ Extend test options of SvgLinearGradientPrimitive2DBartosz Kosiorek
The extended options were used in LinearGradient tests Change-Id: I44336edda2d82f936b6e931668bdac46ee7899e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90541 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-15tdf#124424 Fix WrapModeTileFlipY option for LinearGradientBartosz Kosiorek
Change-Id: I61a533d2fab085992c1507331699b78aca2c8d29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90515 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-15tdf#124424 Fix orientation of the LinearGradientBartosz Kosiorek
Change-Id: Id0547fcea95306997f8f04d400f3073abb6d6c47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90514 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-12tdf#124424 Corrections at SvgGradientHelper for EMF+Armin Le Grand
Change-Id: Ibda3568887de5df2bc45a9bc8cb424ba7658a768 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90382 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-03-11tdf#124424 Enhanced SvgGradientHelper for EMF+Armin Le Grand
Added support for repeat modes in GDI+ support and saw that the SVG primitive gradient helpers are not capable to support these completely, so had to do some quite complex adaptions which OTOH will be useful for more complex gradients anyways Change-Id: Ib9a9e4a55115834a4fb00300b05abe17ae36d105 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90329 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>