Commit Graph

1822 Commits

Author SHA1 Message Date
Luboš Luňák
b5e701d36e add o3tl::span ctor from std::vector
Makes code simpler, and std::span can be constructed from std::vector
too.

Change-Id: Iae26b53c52148c19d9068a63126a7393d098d654
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124507
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
2021-10-31 15:52:02 +01:00
Mike Kaganski
b9f098c5a2 Another tools::Long->sal_Int32 in the DX array
A leftover from commit bc413e15fa

Change-Id: Ibacdf71f608657a4488c84b88ef54fb52d3e8439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124496
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30 22:26:06 +02:00
Noel Grandin
bc413e15fa tools::Long->sal_Int32 in the DX arrays
Change-Id: I36ddc11b39763dc77086591fe9bb756195b4294f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124459
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30 15:43:23 +02:00
Noel Grandin
894b4911ff pass DX array around using o3tl::span instead of pointer
so we get bounds checking in debug mode

Note that I cannot just pass around the std::vectors
involved because there is a place in editeng which
calls with a subset of a vector.

Change-Id: I5088a139593c27bf9cbe5d843ab4b0048ac6d508
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124330
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-29 12:38:51 +02:00
Mike Kaganski
1a58461bfa Prepare for removal of non-const operator[] from Sequence in canvas
Change-Id: Ifb96e496b0994b5fc66975b7aea0a60bcb4a3a03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124345
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-29 06:50:51 +02:00
Julien Nabet
094babdf63 Simplify vector initialization in canvas
Change-Id: Id359ec7fa58350f578f9da430c3b0536c6ff8a35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123659
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15 18:39:21 +02:00
Noel Grandin
e7c22593d1 loplugin:moveparam in canvas
Change-Id: I12538ca8c3578f37a4ef1e40640f5324bbdbb1d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123371
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11 13:32:44 +02:00
Noel Grandin
e512b53ef8 loplugin:constparams
Change-Id: I0d1ad95a9944c9077a1b9db11f2ae05f993c2b36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122900
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-01 20:57:56 +02:00
Chris Sherlock
4dd6af856d vcl: rename OutDevState to Stack
I have moved the header file to include/vcl/rendercontext as this will
eventually be part of the RenderContext split from OutputDevice.

State and associated enums have also been moved to the vcl namespace. I
have also moved ComplexTextLayoutFlags into the vcl::text namespace.

Change-Id: I0abbf560e75b45a272854b267e948c240cd69091
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-28 08:20:32 +02:00
Noel Grandin
a125236448 clang-tidy:readability-redundant-member-init
Change-Id: I48e6fb31df732805423b89ed91b6e4363a69b668
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121150
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-28 07:43:56 +02:00
Caolán McNamara
88bf1749f1 undo changes to TextAlign
revert commit 8689bd5490
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Thu Jul 29 20:49:29 2021 +0100

    convert TextAlign to scoped enum

lets leave this as it always was

Change-Id: Id4d2a5644974cdd2b0ed6d361d5c52629674d057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120626
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-18 12:53:31 +02:00
Noel Grandin
4dc4065904 rtl::Static -> thread-safe static local
Change-Id: I9f8fe250813f4f376dc46c6f3d7e25e90fdbb50e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120566
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-17 22:40:40 +02:00
Mike Kaganski
581b2cf796 Drop tools::Rectangle::getX/getY, which are just duplicates of Left/Top
The change allowed to simplify many places where previously this API was
used, to avoid inefficient calculations (e.g., moving rectangle keeping
its size, and then immediately changing the size).

Change-Id: Ica2dc594d91cae83e2c2740c1f4fb23f44998916
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120461
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-16 15:53:02 +02:00
Caolán McNamara
98f125ecbb use some forward declares
Change-Id: If7f726e8dddb63c8a566f9aa208cd317213d5eba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120166
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-08 17:12:12 +02:00
Noel Grandin
05ab38359a Consolidate on C++17 std::scoped_lock instead of std::lock_guard
as in commit 9376f65a26

Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-03 12:20:53 +02:00
Noel Grandin
1597cc5b3e convert #defines to OUStringLiteral
mostly by doing

$ git grep -l '#define.*\"' -- *.cxx
    | xargs perl -pi -e
's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 =
u\2;/g'

Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02 14:43:58 +02:00
Caolán McNamara
8689bd5490 convert TextAlign to scoped enum
Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-30 16:40:56 +02:00
Noel Grandin
bfc1600c6a loplugin:indentation improve checks for brace alignment
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-28 10:47:34 +02:00
Noel Grandin
86dc8e1f62 fix big-endian code
after the transparency->alpha changes in ::Color

Change-Id: Ifbac6c8f37f18e8acaef0602ef414ae39449ad3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117209
Tested-by: René Engelhard <rene@debian.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-15 10:21:30 +02:00
Julien Nabet
87e8d5ec6b Simplify Sequences initializations (canvas)
Change-Id: I651858d71e378341205d6a785bd97f294664a439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116737
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-07 12:58:48 +02:00
Arnaud Versini
39aa29712f canvas : use std::mutex in CanvasFactory
Change-Id: Ic492f6b398ace3796d4b2cd45455d9ddec6cd728
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116416
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31 15:20:25 +02:00
Caolán McNamara
ed52d1eb0a adapt oglcanvas::SpriteDeviceHelper::getDeviceHandle
to match the other implementations that return the OutputDevice*

I tried enabling SpriteCanvas.OGL in

 officecfg/registry/data/org/openoffice/Office/Canvas.xcu

with

     <node oor:name="com.sun.star.rendering.SpriteCanvas" oor:op="replace">
       <prop oor:name="PreferredImplementations" oor:type="oor:string-list">
         <value oor:separator=",">com.sun.star.comp.rendering.SpriteCanvas.DX9,
-                                 com.sun.star.comp.rendering.SpriteCanvas.Cairo,
+                                 com.sun.star.comp.rendering.SpriteCanvas.OGL,
                                  com.sun.star.comp.rendering.SpriteCanvas.VCL

but it crashes before it gets very far and before it gets to this
method. I tried in 7.1 and 7.0 but the same result so I can't tell if
this fix is needed, but they surely should be the same as the others.

Change-Id: I4f3715568eb0ec3a3bc57f6e6bdf158ff530ca5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116061
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-24 17:19:14 +02:00
Caolán McNamara
692c5df18e ImplPlayWithRenderer never checks its OutputDevice against nullptr
just pass a reference instead and spread that around to some similar
cases

Change-Id: Ifb2dee8c7bf02a9f01982b928c90666cbbdd84fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115759
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-19 09:45:46 +02:00
Michael Weghorn
46c71f04c9 Drop assert checking address of reference is not nullptr
It was introduced in

    commit 9090dc1f3b
    Date:   Mon Jan 18 18:27:19 2021 +0200

        split OutputDevice from Window

and caused my GCC 10 '--enable-werror' build to fail with

    In file included from /usr/include/c++/10/cassert:44,
                     from .../include/tools/ref.hxx:23,
                     from .../include/vcl/outdev.hxx:24,
                     from .../canvas/source/vcl/impltools.hxx:25,
                     from .../canvas/source/vcl/canvas.hxx:39,
                     from .../canvas/source/vcl/canvas.cxx:22:
    .../canvas/source/vcl/outdevholder.hxx: In constructor ‘vclcanvas::OutDevHolder::OutDevHolder(OutputDevice&)’:
    .../canvas/source/vcl/outdevholder.hxx:38:16: error: the compiler can assume that the address of ‘rOutDev’ will never be NULL [-Werror=address]
       38 |         assert(&rOutDev);
          |                ^~~~~~~~
    cc1plus: all warnings being treated as errors
    make[1]: *** [.../solenv/gbuild/LinkTarget.mk:301: /home/michi/development/git/libreoffice/workdir/CxxObject/canvas/source/vcl/canvas.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    In file included from .../include/comphelper/solarmutex.hxx:25,
                     from .../include/vcl/svapp.hxx:29,
                     from .../canvas/source/vcl/impltools.hxx:24,
                     from .../canvas/source/vcl/spritecanvas.hxx:44,
                     from .../canvas/source/vcl/spritecanvas.cxx:28:
    .../canvas/source/vcl/outdevholder.hxx: In constructor ‘vclcanvas::OutDevHolder::OutDevHolder(OutputDevice&)’:
    .../canvas/source/vcl/outdevholder.hxx:38:16: error: the compiler can assume that the address of ‘rOutDev’ will never be NULL [-Werror=address]
       38 |         assert(&rOutDev);

Change-Id: I9e8ef7e91dba847f4894124348f13755fc620fac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115737
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-05-18 14:39:18 +02:00
Noel Grandin
9090dc1f3b split OutputDevice from Window
as part of a longer-term goal of doing our
widget rendering only inside a top-level render-
context.

I moved all of the OutputDevice-related code that existed in vcl::Window
into a new subclass of OutputDevice called WindowOutputDevice.

Notes for further work

(*) not sure why we are getting an 1x1 surface in
    SvpSalGraphics::releaseCairoContext, but to fix it I clamp
    the size there

(*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice

(*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code?

Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-17 12:56:51 +02:00
Julien Nabet
ee2199a435 Directly initialize vectors in ogl_spritedevicehelper.cxx
since we've got all the information from the beginning.

static_cast were needed to avoid this kind of error:
/home/julien/lo/libreoffice/canvas/source/opengl/ogl_spritedevicehelper.cxx:305:36: error: non-constant-expression cannot be narrowed from type 'sal_uInt32' (aka 'unsigned int') to 'double' in initializer list [-Wc++11-narrowing]
                                   mpTextureCache->getCacheMissCount(), mpTextureCache->getCacheHitCount() }
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/julien/lo/libreoffice/canvas/source/opengl/ogl_spritedevicehelper.cxx:305:36: note: insert an explicit cast to silence this issue
                                   mpTextureCache->getCacheMissCount(), mpTextureCache->getCacheHitCount() }
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                   static_cast<double>(               )
Change-Id: If2705251cc4a246c2b8cb0bf873d413b3c572880

Change-Id: Ie1ce45cb6518fe97442ec5f3f05d34bae586b417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115585
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-14 15:56:58 +02:00
Luboš Luňák
ec73a21bcc set also dashing cap style for directx canvas (tdf#136957)
Change-Id: I7022ffba519faad5a333d7ef6eabf1ba5f0ae3bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115232
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-05-07 14:30:25 +02:00
Luboš Luňák
402acbcfad make it possible to write canvas unittests
One of the problems is that canvas apparently works only with windows,
but tests obviously need an offscreen surface. This patch moves
Window::GetCanvas() to OutputDevice, and makes vclcanvas capable
of working with OutputDevice classes that are not windows. Other
canvas implementations still don't work, but presumably at least
cairocanvas could be fixed too.

This commit adds a "simple" test that just draws a line and tries
to verify it's been drawn properly. Adding another test should
be a matter of basing it on this existing one, and then copy&pasting
the complicated UNO way of drawing using canvas from somewhere,
such as canvas/workben/canvasdemo.cxx.

Change-Id: I42db12b09433763cd31c3dd497c10157424b8598
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115117
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-05-06 11:22:47 +02:00
Luboš Luňák
3a1d150eb9 scale stroked line properly in cairocanvas
- Line width should be scaled by the scaled vector, not just its X
component (see VclMetafileProcessor2D::getTransformedLineWidth()).
- Lenths of dashes should not be scaled by the scaled line width,
but by the scaling.
Testcase document sd/qa/unit/data/pptx/tdf134053_dashdot.pptx .

Change-Id: I4116f82e91620f5612f5e4e187468508f683b93e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115147
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-05-05 19:56:24 +02:00
Mike Kaganski
7f0b5f8eb2 Use sal::systools::COMReference and drop dxcanvas::COMReference
Change-Id: I352147dd86d8ba73da1706c42c885bef0f11b2cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115071
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-05-04 15:29:53 +02:00
Chris Sherlock
d19dbcc139 vcl: remove MetricVector
Change-Id: Ib700887ca79f423c65dfb75eea36bbfd808fa172
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114976
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-03 15:13:58 +02:00
Noel Grandin
b153d147c9 remove support for BITMASK in vcl backends
Rather use a proper alpha channel if we need transparency.

This is another small step towards merged alpha in our vcl
layer.

I suspect the intent in a lot of this code was to save memory.
Which have been a thing way back then, but these days our
backends mostly end up doing a copy-and-convert to a real
alpha channel anyway, so the existing code is actually
now a pessimisation.

Change-Id: I4a2bcbb2f76b841f05bc00580f364492829c69de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114808
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-29 08:40:56 +02:00
Noel Grandin
1325d8161a loplugin:moveopt
An attempt that did not find anything convincing enough to finish it up
and make it permanently active.
So just leave it in /store for now.

Change-Id: I1750e177655a4a510da100f880ba81bf762be277
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114742
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27 22:11:58 +02:00
Noel Grandin
ddd2639a48 drop mask from BitmapEx
So that we have fewer cases to deal with when we transition to
32-bit bitmaps.

(*) rename maMask to maAlphaMask, since now it is only being used
for alpha duties.
(*) drop mbAlpha and mbTransparent to simplify state management,
the only thing we need to check for alpha is if maAlphaMask is
non-empty.

Change-Id: I06252e38e950e846a94b4c2ba8ea763be17801fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111679
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-26 12:51:58 +02:00
Luboš Luňák
3a4bfe3e45 prevent cairo from breaking because of a large matrix (tdf#125949)
Some presentation animations temporarily cause extensive zoom matrix
and Cairo doesn't take that well.

Change-Id: I1eb6d63fc2dcde6553bc8cc7ab967532d085a579
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114344
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-21 18:29:49 +02:00
Caolán McNamara
cb09533c4a tdf#141269 Incorrect transparency after roundtrip
Revert "convert internal bitmap formats transparency->alpha"

This reverts commit c181e510c5.

and later fix up of

Revert "tdf#141504 qt5: ugly images"

This reverts commit e7424ff25a.

a lot of places are still working int transparency values
and not opacity

Change-Id: I31342cdb76629acbaebfcdfa385407d3291fe06f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114150
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-15 21:05:34 +02:00
Tomaž Vajngerl
88a177f827 vcl: remove GetBitCount and GetColorCount from Bitmap{Ex}
We can cast the PixelFormat enum to int for the same information
and we can use the enum to reduce ambiguity when possible.

Change-Id: I6ea648139465568cdeb12e5f5f75c7b609365bf4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113188
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-02 06:28:39 +02:00
Noel
740757d174 remove internal 4bit scanline formats
since we have already removed the 4-bit internal bitmap formats.

Change-Id: Ie481aaa8e25642a47e30beb6f37e2d3beda304e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113412
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-31 17:38:04 +02:00
Noel
c7483d48df drop operator bool and operator! from Bitmap and BitmapEx
IRC chat:
<quikee[m]> noelgrandin: doesn't adding operator bool to Bitmap
  has the same problem as Graphic and the reason why you dropped that
  commit 7334034ae9
  "drop Graphic::operator bool"
<noelgrandin> quikee[m], hmmm, good point
<noelgrandin> maybe I should just drop both operator bool and
  operator! in favor of IsEmpty
<quikee[m]> noelgrandin: I don't remember what the problem is I just
  remembered we dropped it Graphic :) sure, dropping everything for
  IsEmpty is probably the best

Change-Id: Ieae289cda64f0b8d8fdecd5ea9e6f2bb874ff4cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113163
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-28 10:26:06 +02:00
Tomaž Vajngerl
68bc6a5dd6 add PixelFormat enum that replaces bit count in Bitmap/BitmapEx
Bit count for the image is a numeric value (sal_uInt16) but only
a handful of values make sense - namely 1,4,8,24 and 32. This
replaces the numeric value with an enum, which only accepts those
values and checks the correct values are used at compile time.

Change-Id: I0fc137c62bce3b0d021f05019a1648da628521bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112408
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-13 12:17:49 +01:00
Caolán McNamara
1aa2b3241c drop unneeded include
Change-Id: Idcae44440a197f6b3b824cbbac430e370964ac25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112368
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-12 10:08:20 +01:00
Noel
04e7a34a19 loplugin:refcounting check for one more case
where we might be holding something newly created by pointer
instead of by *::Reference

Change-Id: Ife6f7acae4252bf56dcdeb95d72e43c523444f97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112138
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-08 07:37:26 +01:00
Stephan Bergmann
31693833dc loplugin:referencecasting (clang-cl)
Change-Id: If32c6f6d3618c134cfb2ac89e827491525c34687
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111811
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-03-03 08:48:55 +01:00
Noel
ee7368f628 loplugin:refcounting in canvas
Change-Id: I7807e2e7fa7f9a68d36c103d8b1dba708350f8aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111745
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-01 19:33:47 +01:00
Luboš Luňák
5ba5ac948d add additional 0-1 alpha argument to DrawTransformedBitmap()
This allows the VCL backends the apply the extra alpha transformation
as it sees fit, rather than it being done manually elsewhere (and
even if the backend doesn't implement it, at least do it in one
place in the function).
With the document from tdf#136223, going from slide 2 to slide 3,
this easily saves 10-30% of CPU cycles. As an additional bonus,
using AlphaMask::BlendWith() rather than AlphaMask::Replace()
makes edges of shapes noticeably more smooth.

Change-Id: I036dc9b887d6def0c7cdad3982becabdc7cd5206
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111247
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-02-24 12:40:13 +01:00
Luboš Luňák
f57872d2da simply use drawTransformedBitmap()
At least with Skia this is faster than GraphicObject trying
to handle it manually, even in raster mode.

Change-Id: If77d108751f5621878d4ea87a996c2ea0253d111
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111246
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-02-24 12:39:45 +01:00
Noel Grandin
c181e510c5 convert internal bitmap formats transparency->alpha
Image formats and graphics APIs use alpha, not transparency,
so change our internal formats and data structures to work directly
with alpha, so we don't need to modify data before we push it to
graphics APIs.

Change-Id: I537f77f79e83876be11d787901df42710d190842
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108919
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-23 11:20:35 +01:00
Noel
919e47ee21 loplugin:refcounting in canvas
Change-Id: I77e4d29b2911bb86c383afbf977d241eaa8cd341
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111307
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-22 13:40:12 +01:00
Noel
f573d410e8 loplugin:referencecasting in canvas
Change-Id: Ic802d6593db053bb31c3463e67b63399b5f26d67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111001
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-17 07:45:37 +01:00
Caolán McNamara
c4957b237e ofz#1473106 Uninitialized scalar field
Change-Id: If38a5ad4e5db287a3105bb0faca031bc98c47fd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110979
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-16 16:08:19 +01:00