summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
AgeCommit message (Collapse)Author
2020-12-18tdf#131281 Always draw FormControls when TiledRenderingArmin Le Grand (allotropia)
When FormControls are not in layout mode it would be necessary to have real VCL ChildWindows in the client (usually the office). While this is done in the office itself and thus the visualization of FormControls (and their usage) is guaranteed, this is currently not the case for existing clients of TiledRendering. The big solution would be an API for the TiledRendering client to get infos for FormControls and create these locally (what would allow to have these editable/interactive and in the style of the client system). As long as this is not the case, I add this fallback to render the FormControls as content to the tiles to get them visualized at all. Change-Id: I0f7a5e7dc028373145a6a19b639ce82bdafc149d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107735 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> (cherry picked from commit bcb8d2d3a08991b4e57189b81f8702aaa8af8a89) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107804 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-11-09tdf#42949 Fix new IWYU warnings in directories d*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8f3cd05dbd86bd22fd84d767adc44fc2b0c89404 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105468 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-26switching long to a 64-bit type on 64-bit windowsNoel
(*) create a rewriting plugin to do most of the work, heavily based on the fakebool plugin (*) but there are still a number of "long"s in the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21new tools::Degree10 strong typedefNoel Grandin
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-29disentangle AA and B2D use in VCL drawingLuboš Luňák
A number of powerful functions using B2D polygons such as OutputDevice::DrawPolyLineDirect() were used only if AA was enabled. So e.g. dashing for an AA-ed polyline could be drawn directly using the function, but with AA disabled had to be done manually by a number of polygon operations. Which doesn't make much sense, surely these powerful functions can also draw without AA if set so (and indeed that's mostly the case). And DrawPolyLineDirect() even had a flag to bypass the check. So simply try to use B2D-based drawing whenever possible, AA or not. The previous commit had already changed the naming of the AA option to not include B2D in the name. This seems to come from https://bz.apache.org/ooo/show_bug.cgi?id=88795, which doesn't explain why AA only. There are other bugreports such as https://bz.apache.org/ooo/show_bug.cgi?id=101491 and https://bz.apache.org/ooo/show_bug.cgi?id=98289 that are related, but there I cannot see any difference with this patch. And all unit tests pass. Change-Id: Ibb5938e8fff9b7452bac4bf12ed3e42fd3e5d645 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103354 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-09-28rename for disentangling AA and B2D use in VCL drawingLuboš Luňák
This renames AntialiasingFlags::EnableB2dDraw to just Enable, and the AntiAliasB2DDraw names to just AntiAlias. This is in preparation for a second commit that will actually separate the AA and B2D functionality of these flags. Change-Id: I9cc215c5752dfabce41e00e19d9074fc8dc3d4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103416 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-09-25forward axial and radial gradient types to VCL tooLuboš Luňák
VCL's drawGradient() can handle them all, at least using a fallback algorithm. And drawinglayer doesn't know which of them are handled directly by the VCL backend used. A catch is that the rendering of tdf#133477 is different, so keep using drawinglayer for the affected gradient types until somebody fixes that. Change-Id: I1719c67c15752c6d1c3431ddfa797ac94d039555 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103376 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-09-25use vcl lin. gradient drawing in drawinglayer + cairo impl.Tomaž Vajngerl
This adds a divert for drawing of linear gradients drawing, which can be implemented natively with a much higher quality and speed. This also adds a implementation of drawing linear gradients with cairo. Change-Id: I8c39915c3579e6eb88cdce8ae4ac9694ffdb4957 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103374 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-08-14tdf#135500: always use transparent and clear content vdev in impBufferDeviceMike Kaganski
This removes the only place that hadn't used transparent impBufferDevice yet - in VclProcessor2D::RenderMaskPrimitive2DPixel. Not clearing the vdev made it draw on whatever garbage was left there from previous paints when the buffer was taken from maFreeBuffers in VDevBuffer::alloc, so since this was also the only place left that didn't clear the buffer explicitly, this makes the clear unconditional in impBufferDevice ctor. Also this makes sure to clear proper rectangle in VDevBuffer::alloc, and to clear mpAlphaVDev in OutputDevice::Erase. Change-Id: I7c1c0cc510a92628f19020b3faf0c0cd81f5a599 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100674 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-07-20limit bitmap size for glow/softedge effects to visible area (tdf#134237)Luboš Luňák
When zooming in the bitmap can become huge, requiring a lot of processing, most of it not being used. Change-Id: I0a4907f5cf23ab7316fed8568924fe76c744b81a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97872 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-06-19tdf#134134: consider color modifier stack when pixel-processingMike Kaganski
Add initial color stack as an optional processor ctor argument, so that it wouldn't be possibe to modify it after construction from outside randomly (which could break the stack state). Change-Id: I8aae4b806531fa61cc67def865297f5de1cf0755 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96684 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-06-15Add process function to create the blur shadowA_GAN
Create processShadowPrimitive2D function which uses the blur radius from the shadow primitive to generate mask for the shadow bitmap. Change-Id: Iba86bdbe1728153d866dd559a1b12eb5570ced51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95859 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-30Add TODOsMike Kaganski
Change-Id: I6ab5840487f7676d5070ea4be00272f13dd47f96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95162 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-29tdf#101181: disable antialiasing for maskMike Kaganski
Since we need objects' bounds here, antialiasing them would make the resulting non-fully-transparent areas thicker, thus making the effect also thicker. Disable it here; also slightly increases performance. We can't do that for soft edge: the effect draws all its children as bitmap, so disabling AA would make all children areas unaffected by soft edge to have worse image quality. Change-Id: Ifc9a60ec7894bfe9d0209e04532c9ca0a1eb3867 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95096 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-29tdf#101181: use buffer device with alpha in glow effectMike Kaganski
Change-Id: Iddc94a5cfdee03befdf245ee086a872f0bfaf7a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95051 Tested-by: Jenkins Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-29tdf#49247: Reimplement soft edges to keep object transparencyMike Kaganski
So the objects that were semi-transparent don't become opaque upon applying soft edge effect. This requires that the objects are actually semi-transparent, so that we can get alpha mask from bitmap Change-Id: Ic4af9bea19e5e71139d3f065797583f7c7c78815 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95034 Tested-by: Jenkins Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-29tdf#49247, tdf#101181: don't rely on automatic scaling of alpha maskMike Kaganski
Scale it back explicitly in ProcessAndBlurAlphaMask Change-Id: I8e8a58c117d8b59db40b416edadc559b47dc300a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95021 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-29tdf#49247, tdf#101181: Fix effect boundsMike Kaganski
This will avoid cutting rightmost and bottommost pixels from the effects, caused by casting of range dimensions to integers. Change-Id: Icad9c06c33bafae9531bc45559acecd3581fad89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95020 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-18Only transform polypolygon when neededMike Kaganski
Change-Id: I907c4bddb1ec05a9d68af8939e58d576714a3d0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94283 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-13tdf#49247: draw soft edgesMike Kaganski
This factors out the common code for blurring used both in glow and soft edges into ProcessAndBlurAlphaMask. Also this reverts commit a98bdbae459ad7341bf7f484c402e77e4062cd16, since its use was removed from VclPixelProcessor2D. Change-Id: Icd7fdb06bef3932ff3b9ce7e283b515b15d246a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94087 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-09dl: move {Eps,FillHatch,PointArray}Primitive2D to global includeTomaž Vajngerl
Change-Id: I85c10cb957f5065d964863360ca03355c87b7980 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93821 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
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-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-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-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-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-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-06cid#1460477 Result is not floating-pointCaolán McNamara
warnings is about aRange.getMinX()-nRadius/2 " CID 1460477 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions 5 and 2, and then converting the integer quotient to type double. Any remainder, or fractional part of the quotient, is ignored. To compute and use a non-integer quotient, change or cast either operand to type double. If integer division is intended, consider indicating that by casting the result to type int " Change-Id: I600d909c52b9e86f5193806d42cfd0421d8fc2cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90132 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-03-06tdf#124848 partial refactor hairline logicArmin Le Grand
With the handover of transformations to line draw calls it is no longer feasible to detect and prepare LineWidth stuff when the old office definition for hairlnes is used, a line width of zero. It was managed in the system-independent part, but now may have to be prepared in logic and not discrete (pixel) coordinates. To do so, find and cleanup all places where 1/1.0 was used as hairline line width. Adapt all seven graphic subsystems to handle the line width == 0/0.0 cases accordingly. Test as good as possible. Change-Id: I2badc045474dcd51612e50597b8406a55d9dc863 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90057 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-03-03tdf#101181 Implement glow effect on shapesTamas Bunth
Glow effect is a color-blurred outline outside of the shape. In ooxml document it is specified with the <a:glow> element. The commit contains the following: - Add support for importing and exporting <a:glow> from ooxml documents. - Assign new properties to XShape which stores glow-related attributes. - A new 2D primitive is introduced in module 'drawinglayer' which is responsible for representing the glow primitive which is to be rendered. + A glow primitive is a clone of the original shape which has been scaled up slightly and a new color has been assigned to it. The radius of the glow effect and the color is defined in the <a:glow> element being imported. - A blur algorithm is introduced in module 'vcl', which is called during rendering the primitive. + The blur algorithm works on a bitmap. + Since the algorithm is CPU-intensive, the result is cached in the processor and it is recalculated only if needed. - Add support for importing and exporting glow effect to ODF format. For that, new attributes of element <style:graphic-properties> has been added: + loext:glow, which can have the values "visible" or "hidden" + loext:glow-radius: which holds the radius of the glow effect in cm. + loext:glow-color: holds the color of the glow effect - Tests have been added to assert properties after pptx import and export. Change-Id: I836aeb5e0f24e2c8d5725834c8c0f98083bc82e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89125 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-02-07tdf#130478 Enhance Dashed line drawing on all systemsArmin Le Grand (Collabora)
For more info and explanation including state of process information and discussion(s) see task please. Adding corrections for gerrit build Change-Id: Ie10fb8093a86459dee80db5ab4355b47e46c1f8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88130 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-01-20clang-tidy modernize-concat-nested-namespace in drawinglayerNoel Grandin
Change-Id: If2644743ab0d9b78d42d1d2fe6fa22c83472d2c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87065 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-04drawinglayer: extract classes from baseprimitive2d.hxx to own filesTomaž Vajngerl
This extracts Primitive2DContainer class to its own file, common typedefs for PrimitiveReference, Primitive2DSequence to own file CommonTypes.hxx, some commonly used and independent functions to Tools.hxx. But for not BufferedDecompositionPrimitive2D class is left as it is. Change-Id: Ia55bafd32fb95eba945d091e2c2ae89b160140d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86086 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-11-22tdf#42949 Fix IWYU warnings in drawinglayer/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I0968cfd6a94c20e6b0d324f068ca658d7d5c0296 Reviewed-on: https://gerrit.libreoffice.org/83294 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-10tdf#125730: Shadow has the same color as the hatching fillXisco Fauli
Regression from 5c23459245f566831383934dd64d19e002bfcfcb If statement was removed while getOptionsDrawinglayer().IsAntiAliasing() condition still stands Change-Id: I33baf1975436d0f917d14bf5df8232dafba92793 Reviewed-on: https://gerrit.libreoffice.org/73762 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-18Fix typoAndrea Gelmini
Change-Id: If570c55ac75c209d0b0b7331a0775ee38fa37c85 Reviewed-on: https://gerrit.libreoffice.org/72511 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-14Revert "drawinglayer: avoid AA for hairline polygons built from ...Miklos Vajna
.. hori/vert lines only" This reverts commit f8b4d371eddd27594d549fb00294c01229a9bd24. Tomaz considers this ugly and it's no longer needed since commit 93abdf39b01bb7b404dc09ef37369a4350fb0d10 (sw lok: assume no windows in SwLayoutFrame::PaintSwFrame(), 2019-05-14). Conflicts: basegfx/test/B2DPolygonTest.cxx Change-Id: Ia9b29921ff3e5d82085e1abf9f39c172357a5e13 Reviewed-on: https://gerrit.libreoffice.org/72297 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-05-09drawinglayer: avoid AA for hairline polygons built from hori/vert lines onlyMiklos Vajna
For one, it seems this was the intention already since commit 85c70f37b56299f6fa02312c0fb73cc55af084ef (CWS-TOOLING: integrate CWS aw063, 2009-03-04): "suppress AntiAliasing for pure horizontal or vertical lines". For another, this fixes the TileCacheTests::testTileWireIDHandling() testcase in online.git, which assumes that the indicators at the corners of the Writer body frame (paragraph marks hidden / default case) can be painted multiple times, producing pixel-by-pixel matching results. But in reality AA breaks that assumption, and we know these indicators are never diagonal lines. Change-Id: Ib74f823165799991296b64cee58ec106dbdcedcf Reviewed-on: https://gerrit.libreoffice.org/72000 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-03-20tdf#42949 Fix IWYU warnings in include/drawinglayer/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8daf57df5b8f9c609d4f3ca44bae7366addceb6c Reviewed-on: https://gerrit.libreoffice.org/69151 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-08new loplugin constvarsNoel Grandin
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08loplugin:indentation in dbaccess..drawinglayerNoel Grandin
Change-Id: I05de6c01e827e596c9802c04964f43508dfd4d64 Reviewed-on: https://gerrit.libreoffice.org/67537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-25Fix typosAndrea Gelmini
Change-Id: I4eda42a11239567c557431017a1fa99cb37298c5 Reviewed-on: https://gerrit.libreoffice.org/62357 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-25Reorganize FrameBorderPrimitive creation (II)Armin Le Grand
Step5: Move the view-dependent decomposition from BorderLinePrimitive2D to SdrFrameBorderPrimitive2D. It is now possible to use discrete sizes before the line and edge matching is done what will look much better. When it was done at BorderLinePrimitive2D and the matching was already done, that match was 'displaced' with the adapted forced scale to discrete units. The space and size used when zooming out for a single discrete unit (pixel) can heavily vary - it just covers a much larger logical area than the 'real' line/poly would do. All this needs to be handled (also for bound ranges) and can only be in a good way using primitives. Adapted to no longer do view-dependent changes in BorderLinePrimitive2D. Adapted to do these now at SdrFrameBorderPrimitive2D. Currently used to force the existing border partial lines (up to three) to not get taller than one logical unit. Adapted to no longer switch off AntiAliased rendering in VclPixelProcessor2D for processBorderLinePrimitive2D, this is problematic with various renderers on various systems (e.g. vcl still falls back to render multiple one-pixel-lines when taller than 3.5 pixels which looks horrible combined with other parts like filled polygons) All this needs fine balancing on - all systems - all renderers - all apps (which all have their own table implementation) - all render targets (pixel/PDF/print/slideshow/...) Done as thorough as possible, but may need additional finetuning. May also be a motivation to move away from vcl and implement these urgetly needed system-dependent primitive renderers... Adapted UnitTest testDoublePixelProcessing with the needed comments. Change-Id: Ie88bb76c2474b6ab3764d45a9cd1669264492acd Reviewed-on: https://gerrit.libreoffice.org/62344 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-10-23clang-tidy performance-unnecessary-copy-init in dbaccess..drawinglayerNoel Grandin
Change-Id: I49a152b2aea93d30b16192260f4f659c7e5fcaee Reviewed-on: https://gerrit.libreoffice.org/62215 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13Support buffering SystemDependent GraphicData (II)Armin Le Grand
In this step I have changed all calls that use a B2DPolyPolygon and do filled graphics, added support for providing needed transformation which will -if supported- be used. Added buffering of SystemDependentData at B2DPolyPolygon for that purpose, see comments describing the current possibilities in the Gdiplus implementation. Moved lifetime creation/cleanup of SystemDependentDataManager to ImplSVData due to cleanup problems in the clang build Tried to use a std::unique_ptr to hold the instance of a SystemDependentDataBuffer at ImplSVData and cleanup inside DeInitVCL() right before ::ImplDeInitScheduler. This works in principle, but scheduler shutdown triggers ProcessEventsToIdle which leads to repaints and re-creates the buffer. Will now do exactly as was done with GdiPlusBuffer before, a simple local static incarnation and a call to SetStatic() in constructor Splitted SystemDependentDataBuffer and Timer due to different LifeTimes. Timer needs to be destructed earlier than SystemDependentDataBuffer, before Scheduler::ImplDeInitScheduler() is called from DeInitVCL() Change-Id: I2134e4346a183a4cee1be3428c51541cc8867c11 Reviewed-on: https://gerrit.libreoffice.org/60102 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>