summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2020-09-09Move the validity check before color manipulationsMike Kaganski
Change-Id: Id4a7a15b7b88df888d2cd224e375c839c59b882f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102301 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-09-07Fix typoAndrea Gelmini
Change-Id: Ie584ee9bece01ea92f5cc9f21a402ae9e8319710 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102189 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-07fix warning of OutputDevice::Push calls != OutputDevice::Pop callsCaolán McNamara
Change-Id: I8f6a3756d48b1727f9ac64c2e162be148e1c61d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102183 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-04TabPage no longer needs to inherit from VclBuilderContainerCaolán McNamara
Change-Id: Iaab26ade1109daf732e58a2f3741cc43243e374c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102023 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-02move Edit into toolkit only headersCaolán McNamara
Change-Id: If51bf7143116721e8f16272cf8aff797651d5ed1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101880 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-30Fix typo in codeAndrea Gelmini
Change-Id: If6683cd134e9bd675ec9b6f9a59fa667ebb41da0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-29Fix typosAndrea Gelmini
Change-Id: I473956d570feac508e52a3e52cc26cc154f4dc56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101627 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-27remove some unused includes and update pchesCaolán McNamara
Change-Id: I786548bef39fa711aabcff32b592b3fdc4a6f9fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101486 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-25add a getCaretPositions like getTextArrayCaolán McNamara
Change-Id: I6f5ab6c659a7b6827c1c5f017a740173806504d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101291 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-21-Werror,-Wunused-variable (clang-cl)Stephan Bergmann
Change-Id: Ic783ab10a3bc2139eef65351d515814374431e59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101131 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-20Fix typo in codeAndrea Gelmini
Change-Id: I7ceb13e4dd247185c2d9b264e81fc5973a0da916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101009 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-20Deduplicate some codeMike Kaganski
Change-Id: I37c492adef30db748eaa975247d386dcd953257b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100949 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-08-19tdf#127471 Remove font width scaling hackSamuel Mehrbrodt
Which causes distorted fonts in certain cases (see bug report). Fix was suggested by Ilhan Yesil at https://bugs.documentfoundation.org/show_bug.cgi?id=127471#c6 Change-Id: Ie644f56f0835ffad9230f981d2927d6b4c17453d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100970 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-08-18Fix typosAndrea Gelmini
Change-Id: I9d55e4478d8cf3047b4ccac88e06fdc87e68e6ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100871 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-08-17tdf#134052:shadow appears solid instead of blurry in presentation modeA_GAN
Add shadow primitive id into the switch case to run ProcessPrimitive2DOnPixelProcessor function. Change-Id: I059771ba4c56eca50c74aad81c4dec193b454dca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100861 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-08-14loplugin:simplifybool moreNoel Grandin
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-08-13remove polygonprimitive2d.cxx from clang-format blacklistTomaž Vajngerl
Change-Id: I3122a4058f5447cbf0369b60b368c76e5fe40089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100647 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-08-13remove texteffectprimitive2d.{cxx,hxx} from clang-format blacklistTomaž Vajngerl
Change-Id: I57a47358d5e4f1e41fc1c89884b7603d8afdc3bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100646 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-08-13remove textprimitive2d.cxx from clang-format blacklistTomaž Vajngerl
Change-Id: I8b4e1d6654c3a75a3174d56ac01f7d0c7aea5a8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100645 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-08-12SvTreeListBox can move into toolkit headers nowCaolán McNamara
Change-Id: I6b3b6ef1530a192f4b6bf87aa9688687063683ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100591 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-03-Werror=redundant-moveStephan Bergmann
...now that GCC 11 trunk implements P1155R3 since <https://gcc.gnu.org/git/ ?p=gcc.git;a=commit;h=1722e2013f05f1f1f99379dbaa0c0df356da731f> "c++: Implement C++20 implicit move changes. [PR91427]", at least in -std=c++20 mode Change-Id: Ie3c8f391fe4a6a99144ab35b2b29214ac5413fc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99999 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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-07-16compact namespace: drawinglayerNoel Grandin
Change-Id: I32648ae81c4a06f944b70c0cca1694333ec02859 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98916 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-16hack for gradients split into adjacent polygons (tdf#133016)Luboš Luňák
Converting a gradient to a group of adjacent polygons is silly (at least according to Skia developers), because adjacent polygon edges are guaranteed to line up perfectly only if antialising is not used. Change-Id: I38696c10b14958936cf97d4001c0ea0dfcadaa58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98886 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-07-13move Primitive2dXmlDump from drawinglayer::tools to drawinglayer NSTomaž Vajngerl
drawinglayer::tools causes conflicts with ::tools namespace, so better to move Primitive2dXmlDump out from this namespace as for inspecting purposes it ccan be injected into existing code which could break make it conflict and break compilation. Change-Id: I5f9e594b2b8b1dd24067fa5f5ca3cfc4eefb85cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98627 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-07-12update pchesCaolán McNamara
Change-Id: I75602277a5a26b012a12f2c4f4b7ff5bb663b0b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-07drawinglayer: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation Change-Id: I38de5ec7b9e376ef8868bebbe7f30240de81c241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98219 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: drawinglayerStephan Bergmann
Change-Id: If00914a6eda240143fbde57215e015a36d588c9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97557 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-01avoid costly to-monochrome-bitmap conversion with Skia (tdf#134365)Luboš Luňák
The BitmapEx 1bpp monochrome bitmap mask constructor forces the mask to be 1bpp, which is done in software by BitmapMonochromeFilter. Which with Vulkan leads to fetching all the data from the GPU, usually only to be converted and then pushed back to the GPU. Similarly to MACOSX and iOS, just use AlphaMask, which is just better (8bit is easier to handle and in Skia's case it's also optimized to avoid fetching the data if possible). Change-Id: I5770c2b0c298c1534b7ff56cc905d2d668d3a8df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97525 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-06-29loplugin:constantparamNoel Grandin
Change-Id: I54f0e2864cb4ef00fea8f9e4369a1f76721e7503 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97369 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-24use more std::container::insert instead of std::copyNoel Grandin
which is both more compact code, and more efficient, since the insert method can do smarter resizing Change-Id: I17f226660f87cdf002edccc29b4af8fd59a25f91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-06-04Update ShadowPrimitive2D to support shadow blurA_GAN
Add attribute for the blur radius and get function. give more range for the shadow depends on the size of the blur radius. update the blur radius to be imported in Hmm and the test function. Change-Id: I32faaf02884d9a6b2f11a9033178b3b6bb419580 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95388 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-03Upcoming loplugin:elidestringvar: drawinglayerStephan Bergmann
Change-Id: Ic4f4a2d2d6d04b317a00c3c1b7eb005229c81bd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95398 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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-29loplugin:simplifybool in dbaccess..frameworkNoel Grandin
Change-Id: I0d73bb7d8d3fde426edc0a10c0750758b68aceb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95099 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-29Add blur attributies and definitons into shadow classes and properitiesA_GAN
Change-Id: I365f4bcfc8d772ea77cec1e4ce139b9fc16d9d7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95000 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-29Use buffer with alpha in VclProcessor2D::RenderUnifiedTransparencePrimitive2DMike Kaganski
This allows UnifiedTransparencePrimitive2D to produce truly transparent image, usable later in the stack - specifically by glow and soft edge effect. Change-Id: I27e9bfbfb9c60856bc3fad1a483623c90d5cabff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94969 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, tdf#101181: output glow and soft edge effects to metafileMike Kaganski
Change-Id: Ie660ae372fc0b5f97f685b6d1e82b9e8a12e7e30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94192 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-29Use buffer with alpha in VclProcessor2D::RenderTransparencePrimitive2DMike Kaganski
This allows TransparencePrimitive2D to produce truly transparent image, usable later in the stack - specifically by soft edge effect. Change-Id: I54e6f9a8fd196247b1130446af3d21b082820f01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95038 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-29Allow creation of virtual device with alpha as content of impBufferDeviceMike Kaganski
impBufferDevice now can create its mpContent with alpha; that is used when painting, blending mpContent's alpha with mpMask/mpAlpha/fTrans. That allows to paint to the buffer device and get actual transparency of the painted objects in one pass, to process further (e.g., modify transparency separately, or use it to get mask). Required for subsequent soft edge effect improvement Change-Id: If19c160581ce9a515d86222dd2fab06f746df2da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95030 Tested-by: Jenkins 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>