LCOV - code coverage report
Current view: top level - basebmp/source - bitmapdevice.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 476 552 86.2 %
Date: 2012-08-25 Functions: 250 1068 23.4 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 922 14870 6.2 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*
       3                 :            :  * This file is part of the LibreOffice project.
       4                 :            :  *
       5                 :            :  * This Source Code Form is subject to the terms of the Mozilla Public
       6                 :            :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7                 :            :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8                 :            :  *
       9                 :            :  * This file incorporates work covered by the following license notice:
      10                 :            :  *
      11                 :            :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12                 :            :  *   contributor license agreements. See the NOTICE file distributed
      13                 :            :  *   with this work for additional information regarding copyright
      14                 :            :  *   ownership. The ASF licenses this file to you under the Apache
      15                 :            :  *   License, Version 2.0 (the "License"); you may not use this file
      16                 :            :  *   except in compliance with the License. You may obtain a copy of
      17                 :            :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18                 :            :  */
      19                 :            : 
      20                 :            : #include "basebmp/bitmapdevice.hxx"
      21                 :            : 
      22                 :            : #include "basebmp/compositeiterator.hxx"
      23                 :            : #include "basebmp/iteratortraits.hxx"
      24                 :            : 
      25                 :            : #include "basebmp/accessor.hxx"
      26                 :            : #include "basebmp/accessortraits.hxx"
      27                 :            : #include "basebmp/accessoradapters.hxx"
      28                 :            : #include "basebmp/colorblendaccessoradapter.hxx"
      29                 :            : 
      30                 :            : #include "basebmp/color.hxx"
      31                 :            : #include "basebmp/colormisc.hxx"
      32                 :            : #include "basebmp/colortraits.hxx"
      33                 :            : 
      34                 :            : #include "basebmp/greylevelformats.hxx"
      35                 :            : #include "basebmp/paletteformats.hxx"
      36                 :            : #include "basebmp/rgbmaskpixelformats.hxx"
      37                 :            : #include "basebmp/rgb24pixelformats.hxx"
      38                 :            : 
      39                 :            : #include "basebmp/scanlineformats.hxx"
      40                 :            : #include "basebmp/fillimage.hxx"
      41                 :            : #include "basebmp/scaleimage.hxx"
      42                 :            : #include "basebmp/clippedlinerenderer.hxx"
      43                 :            : #include "basebmp/polypolygonrenderer.hxx"
      44                 :            : #include "basebmp/genericcolorimageaccessor.hxx"
      45                 :            : 
      46                 :            : #include "basebmp/tools.hxx"
      47                 :            : #include "intconversion.hxx"
      48                 :            : 
      49                 :            : #include <rtl/alloc.h>
      50                 :            : #include <rtl/memory.h>
      51                 :            : #include <osl/diagnose.h>
      52                 :            : 
      53                 :            : #include <basegfx/tools/tools.hxx>
      54                 :            : #include <basegfx/tools/canvastools.hxx>
      55                 :            : #include <basegfx/range/b2ibox.hxx>
      56                 :            : #include <basegfx/range/b2irange.hxx>
      57                 :            : #include <basegfx/range/b2drange.hxx>
      58                 :            : #include <basegfx/polygon/b2dpolygon.hxx>
      59                 :            : #include <basegfx/polygon/b2dpolygontools.hxx>
      60                 :            : #include <basegfx/polygon/b2dpolypolygontools.hxx>
      61                 :            : #include <basegfx/point/b2ipoint.hxx>
      62                 :            : #include <basegfx/vector/b2ivector.hxx>
      63                 :            : 
      64                 :            : #include <vigra/iteratortraits.hxx>
      65                 :            : #include <vigra/rgbvalue.hxx>
      66                 :            : #include <vigra/copyimage.hxx>
      67                 :            : #include <vigra/tuple.hxx>
      68                 :            : 
      69                 :            : 
      70                 :            : namespace vigra
      71                 :            : {
      72                 :            : 
      73                 :            : /// componentwise xor of an RGBValue (missing from rgbvalue.hxx)
      74                 :            : template< class Value, unsigned int RedIndex, unsigned int BlueIndex, unsigned int GreenIndex >
      75                 :            : inline RGBValue<Value, RedIndex, GreenIndex, BlueIndex>
      76                 :   31951668 : operator^( RGBValue<Value, RedIndex, GreenIndex, BlueIndex> const& lhs,
      77                 :            :            RGBValue<Value, RedIndex, GreenIndex, BlueIndex> const& rhs )
      78                 :            : {
      79                 :            :     RGBValue<Value, RedIndex, GreenIndex, BlueIndex> res(
      80                 :            :         lhs[0] ^ rhs[0],
      81                 :            :         lhs[1] ^ rhs[1],
      82                 :   31951668 :         lhs[2] ^ rhs[2]);
      83                 :   31951668 :     return res;
      84                 :            : }
      85                 :            : }
      86                 :            : 
      87                 :            : namespace basebmp
      88                 :            : {
      89                 :            : 
      90                 :            : namespace
      91                 :            : {
      92                 :            :     /** Create the type for an accessor that takes the (mask,bitmap)
      93                 :            :         input value generated from a JoinImageAccessorAdapter, and
      94                 :            :         pipe that through a mask functor.
      95                 :            : 
      96                 :            :         @tpl DestAccessor
      97                 :            :         Destination bitmap accessor
      98                 :            : 
      99                 :            :         @tpl JoinedAccessor
     100                 :            :         Input accessor, is expected to generate a std::pair as the
     101                 :            :         value type
     102                 :            : 
     103                 :            :         @tpl MaskFunctorMode
     104                 :            :         Either FastMask or NoFastMask, depending on whether the mask
     105                 :            :         is guaranteed to contain only 0s and 1s.
     106                 :            :      */
     107                 :            :     template< class    DestAccessor,
     108                 :            :               class    JoinedAccessor,
     109                 :            :               bool     polarity,
     110                 :            :               typename MaskFunctorMode > struct masked_input_splitting_accessor
     111                 :            :     {
     112                 :            :         typedef BinarySetterFunctionAccessorAdapter<
     113                 :            :             DestAccessor,
     114                 :            :             BinaryFunctorSplittingWrapper<
     115                 :            :                 typename outputMaskFunctorSelector<
     116                 :            :                          typename JoinedAccessor::value_type::first_type,
     117                 :            :                          typename JoinedAccessor::value_type::second_type,
     118                 :            :                          polarity,
     119                 :            :                          MaskFunctorMode >::type > > type;
     120                 :            :     };
     121                 :            : 
     122                 :            : 
     123                 :            : 
     124                 :            :     // Actual BitmapDevice implementation (templatized by accessor and iterator)
     125                 :            :     //--------------------------------------------------------------------------
     126                 :            : 
     127                 :            :     /** Implementation of the BitmapDevice interface
     128                 :            : 
     129                 :            :         @tpl DestIterator
     130                 :            :         Iterator to access bitmap memory
     131                 :            : 
     132                 :            :         @tpl RawAccessor
     133                 :            :         Raw accessor, to access pixel values directly
     134                 :            : 
     135                 :            :         @tpl AccessorSelector
     136                 :            :         Accessor adapter selector, which, when applying the nested
     137                 :            :         template metafunction wrap_accessor to one of the raw bitmap
     138                 :            :         accessors, yields a member type named 'type', which is a
     139                 :            :         wrapped accessor that map color values.
     140                 :            : 
     141                 :            :         @tpl Masks
     142                 :            :         Traits template, containing nested traits
     143                 :            :         clipmask_format_traits and alphamask_format_traits, which
     144                 :            :         determine what specialized formats are to be used for clip and
     145                 :            :         alpha masks. With those mask formats, clipping and alpha
     146                 :            :         blending is handled natively.
     147                 :            :      */
     148                 :            :     template< class DestIterator,
     149                 :            :               class RawAccessor,
     150                 :            :               class AccessorSelector,
     151 [ #  # ][ #  # ]:    2739246 :               class Masks > class BitmapRenderer :
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
     152                 :            :                   public BitmapDevice
     153                 :            :     {
     154                 :            :     public:
     155                 :            :         typedef DestIterator                                               dest_iterator_type;
     156                 :            :         typedef RawAccessor                                                raw_accessor_type;
     157                 :            :         typedef AccessorSelector                                           accessor_selector;
     158                 :            : 
     159                 :            :         typedef typename Masks::clipmask_format_traits::iterator_type      mask_iterator_type;
     160                 :            :         typedef typename Masks::clipmask_format_traits::raw_accessor_type  mask_rawaccessor_type;
     161                 :            :         typedef typename Masks::clipmask_format_traits::accessor_selector  mask_accessorselector_type;
     162                 :            : 
     163                 :            :         typedef typename Masks::alphamask_format_traits::iterator_type     alphamask_iterator_type;
     164                 :            :         typedef typename Masks::alphamask_format_traits::raw_accessor_type alphamask_rawaccessor_type;
     165                 :            :         typedef typename Masks::alphamask_format_traits::accessor_selector alphamask_accessorselector_type;
     166                 :            : 
     167                 :            :         typedef typename AccessorSelector::template wrap_accessor<
     168                 :            :             raw_accessor_type >::type                                      dest_accessor_type;
     169                 :            : 
     170                 :            :         typedef AccessorTraits< dest_accessor_type >                       accessor_traits;
     171                 :            :         typedef CompositeIterator2D< dest_iterator_type,
     172                 :            :                                      mask_iterator_type >                  composite_iterator_type;
     173                 :            :         typedef CompositeIterator2D< vigra::Diff2D,
     174                 :            :                                      vigra::Diff2D >                       generic_composite_iterator_type;
     175                 :            : 
     176                 :            :         typedef BitmapRenderer<mask_iterator_type,
     177                 :            :                                mask_rawaccessor_type,
     178                 :            :                                mask_accessorselector_type,
     179                 :            :                                Masks>                                      mask_bitmap_type;
     180                 :            :         typedef BitmapRenderer<alphamask_iterator_type,
     181                 :            :                                alphamask_rawaccessor_type,
     182                 :            :                                alphamask_accessorselector_type,
     183                 :            :                                Masks>                                      alphamask_bitmap_type;
     184                 :            : 
     185                 :            :         // -------------------------------------------------------
     186                 :            : 
     187                 :            :         typedef AccessorTraits< raw_accessor_type >                        raw_accessor_traits;
     188                 :            :         typedef typename uInt32Converter<
     189                 :            :             typename raw_accessor_type::value_type>::to                    to_uint32_functor;
     190                 :            : 
     191                 :            :         // -------------------------------------------------------
     192                 :            : 
     193                 :            :         typedef typename raw_accessor_traits::xor_accessor                 raw_xor_accessor_type;
     194                 :            :         typedef AccessorTraits<raw_xor_accessor_type>                      raw_xor_accessor_traits;
     195                 :            :         typedef typename accessor_selector::template wrap_accessor<
     196                 :            :             raw_xor_accessor_type >::type                                  xor_accessor_type;
     197                 :            :         typedef AccessorTraits<xor_accessor_type>                          xor_accessor_traits;
     198                 :            : 
     199                 :            :         // -------------------------------------------------------
     200                 :            : 
     201                 :            :         typedef typename raw_accessor_traits::template masked_accessor<
     202                 :            :             mask_rawaccessor_type,
     203                 :            :             dest_iterator_type,
     204                 :            :             mask_iterator_type,
     205                 :            :             Masks::clipmask_polarity>::type                                raw_maskedaccessor_type;
     206                 :            :         typedef typename accessor_selector::template wrap_accessor<
     207                 :            :             raw_maskedaccessor_type >::type                                masked_accessor_type;
     208                 :            :         typedef typename AccessorTraits<
     209                 :            :             raw_maskedaccessor_type>::xor_accessor                         raw_maskedxor_accessor_type;
     210                 :            :         typedef typename accessor_selector::template wrap_accessor<
     211                 :            :             raw_maskedxor_accessor_type >::type                            masked_xoraccessor_type;
     212                 :            : 
     213                 :            :         // -------------------------------------------------------
     214                 :            : 
     215                 :            :         // ((iter,mask),mask) special case (e.g. for clipped
     216                 :            :         // drawMaskedColor())
     217                 :            :         typedef AccessorTraits< raw_maskedaccessor_type >                  raw_maskedaccessor_traits;
     218                 :            :         typedef typename raw_maskedaccessor_traits::template masked_accessor<
     219                 :            :             mask_rawaccessor_type,
     220                 :            :             composite_iterator_type,
     221                 :            :             mask_iterator_type,
     222                 :            :             Masks::clipmask_polarity>::type                                raw_maskedmask_accessor_type;
     223                 :            : 
     224                 :            :         typedef CompositeIterator2D<
     225                 :            :             composite_iterator_type,
     226                 :            :             mask_iterator_type>                                            composite_composite_mask_iterator_type;
     227                 :            : 
     228                 :            :         // -------------------------------------------------------
     229                 :            : 
     230                 :            :         typedef ConstantColorBlendSetterAccessorAdapter<
     231                 :            :             dest_accessor_type,
     232                 :            :             typename alphamask_rawaccessor_type::value_type,
     233                 :            :             Masks::alphamask_polarity>                                     colorblend_accessor_type;
     234                 :            :         typedef AccessorTraits<colorblend_accessor_type>                   colorblend_accessor_traits;
     235                 :            :         typedef typename colorblend_accessor_traits::template masked_accessor<
     236                 :            :             mask_rawaccessor_type,
     237                 :            :             dest_iterator_type,
     238                 :            :             mask_iterator_type,
     239                 :            :             Masks::clipmask_polarity>::type                                masked_colorblend_accessor_type;
     240                 :            : 
     241                 :            :         // -------------------------------------------------------
     242                 :            : 
     243                 :            :         typedef ConstantColorBlendSetterAccessorAdapter<
     244                 :            :             dest_accessor_type,
     245                 :            :             Color,
     246                 :            :             Masks::alphamask_polarity>                                     colorblend_generic_accessor_type;
     247                 :            :         typedef AccessorTraits<colorblend_generic_accessor_type>           colorblend_generic_accessor_traits;
     248                 :            :         typedef typename colorblend_generic_accessor_traits::template masked_accessor<
     249                 :            :             mask_rawaccessor_type,
     250                 :            :             dest_iterator_type,
     251                 :            :             mask_iterator_type,
     252                 :            :             Masks::clipmask_polarity>::type                                masked_colorblend_generic_accessor_type;
     253                 :            : 
     254                 :            :         // -------------------------------------------------------
     255                 :            : 
     256                 :            :         typedef JoinImageAccessorAdapter< dest_accessor_type,
     257                 :            :                                           mask_rawaccessor_type >          joined_image_accessor_type;
     258                 :            :         typedef JoinImageAccessorAdapter< GenericColorImageAccessor,
     259                 :            :                                           GenericColorImageAccessor >      joined_generic_image_accessor_type;
     260                 :            : 
     261                 :            :         // -------------------------------------------------------
     262                 :            : 
     263                 :            :         dest_iterator_type                      maBegin;
     264                 :            :         typename accessor_traits::color_lookup  maColorLookup;
     265                 :            :         IBitmapDeviceDamageTrackerSharedPtr     mpDamage;
     266                 :            :         to_uint32_functor                       maToUInt32Converter;
     267                 :            :         dest_accessor_type                      maAccessor;
     268                 :            :         colorblend_accessor_type                maColorBlendAccessor;
     269                 :            :         colorblend_generic_accessor_type        maGenericColorBlendAccessor;
     270                 :            :         raw_accessor_type                       maRawAccessor;
     271                 :            :         xor_accessor_type                       maXorAccessor;
     272                 :            :         raw_xor_accessor_type                   maRawXorAccessor;
     273                 :            :         masked_accessor_type                    maMaskedAccessor;
     274                 :            :         masked_colorblend_accessor_type         maMaskedColorBlendAccessor;
     275                 :            :         masked_colorblend_generic_accessor_type maGenericMaskedColorBlendAccessor;
     276                 :            :         masked_xoraccessor_type                 maMaskedXorAccessor;
     277                 :            :         raw_maskedaccessor_type                 maRawMaskedAccessor;
     278                 :            :         raw_maskedxor_accessor_type             maRawMaskedXorAccessor;
     279                 :            :         raw_maskedmask_accessor_type            maRawMaskedMaskAccessor;
     280                 :            : 
     281                 :            : 
     282                 :            :         // -------------------------------------------------------
     283                 :            : 
     284                 :    3162490 :         BitmapRenderer( const basegfx::B2IBox&                     rBounds,
     285                 :            :                         sal_Int32                                  nScanlineFormat,
     286                 :            :                         sal_Int32                                  nScanlineStride,
     287                 :            :                         sal_uInt8*                                 pFirstScanline,
     288                 :            :                         dest_iterator_type                         begin,
     289                 :            :                         raw_accessor_type                          rawAccessor,
     290                 :            :                         dest_accessor_type                         accessor,
     291                 :            :                         const RawMemorySharedArray&                rMem,
     292                 :            :                         const PaletteMemorySharedVector&           rPalette,
     293                 :            :                         const IBitmapDeviceDamageTrackerSharedPtr& rDamage ) :
     294                 :            :             BitmapDevice( rBounds, nScanlineFormat,
     295                 :            :                           nScanlineStride, pFirstScanline, rMem, rPalette ),
     296                 :            :             maBegin( begin ),
     297                 :            :             maColorLookup(),
     298                 :            :             mpDamage(rDamage),
     299                 :            :             maToUInt32Converter(),
     300                 :            :             maAccessor( accessor ),
     301                 :            :             maColorBlendAccessor( accessor ),
     302                 :            :             maGenericColorBlendAccessor( accessor ),
     303                 :            :             maRawAccessor( rawAccessor ),
     304                 :            :             maXorAccessor( accessor ),
     305                 :            :             maRawXorAccessor( rawAccessor ),
     306                 :            :             maMaskedAccessor( accessor ),
     307                 :            :             maMaskedColorBlendAccessor( maColorBlendAccessor ),
     308                 :            :             maGenericMaskedColorBlendAccessor( maGenericColorBlendAccessor ),
     309                 :            :             maMaskedXorAccessor( accessor ),
     310                 :            :             maRawMaskedAccessor( rawAccessor ),
     311                 :            :             maRawMaskedXorAccessor( rawAccessor ),
     312 [ #  # ][ #  # ]:    3162490 :             maRawMaskedMaskAccessor( rawAccessor )
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     313                 :    3162490 :         {}
     314                 :            : 
     315                 :            :     private:
     316                 :            : 
     317                 :    3875603 :         void damaged( const basegfx::B2IBox& rDamageRect ) const
     318                 :            :         {
     319 [ -  + ][ -  + ]:    3875603 :             if( mpDamage )
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ -  + ]
         [ -  + ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     320                 :          0 :                 mpDamage->damaged( rDamageRect );
     321                 :    3875603 :         }
     322                 :            : 
     323                 :    1585094 :         void damagedPointSize( const basegfx::B2IPoint& rPoint,
     324                 :            :                                const basegfx::B2IBox&   rSize ) const
     325                 :            :         {
     326 [ #  # ][ -  + ]:    1585094 :             if( mpDamage ) {
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     327                 :            :                 basegfx::B2IPoint aLower( rPoint.getX() + rSize.getWidth(),
     328 [ #  # ][ #  # ]:          0 :                                           rPoint.getY() + rSize.getHeight() );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     329 [ #  # ][ #  # ]:          0 :                 damaged( basegfx::B2IBox( rPoint, aLower ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     330                 :            :             }
     331                 :    1585094 :         }
     332                 :            : 
     333                 :     650842 :         void damagedPixel( const basegfx::B2IPoint& rDamagePoint ) const
     334                 :            :         {
     335 [ #  # ][ -  + ]:     650842 :             if( !mpDamage )
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     336                 :     650842 :                 return;
     337                 :            :             basegfx::B2IPoint aEnd( rDamagePoint.getX() + 1,
     338                 :          0 :                                     rDamagePoint.getY() + 1 );
     339 [ #  # ][ #  # ]:     650842 :             damaged( basegfx::B2IBox( rDamagePoint, aEnd ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     340                 :            :         }
     341                 :            : 
     342                 :    1293706 :         boost::shared_ptr<BitmapRenderer> getCompatibleBitmap( const BitmapDeviceSharedPtr& bmp ) const
     343                 :            :         {
     344                 :    1293706 :             return boost::dynamic_pointer_cast< BitmapRenderer >( bmp );
     345                 :            :         }
     346                 :            : 
     347                 :     646943 :         virtual bool isCompatibleBitmap( const BitmapDeviceSharedPtr& bmp ) const
     348                 :            :         {
     349                 :            :             // TODO(P1): dynamic_cast usually called twice for
     350                 :            :             // compatible formats
     351                 :     646943 :             return getCompatibleBitmap(bmp).get() != NULL;
     352                 :            :         }
     353                 :            : 
     354                 :    1798150 :         boost::shared_ptr<mask_bitmap_type> getCompatibleClipMask( const BitmapDeviceSharedPtr& bmp ) const
     355                 :            :         {
     356                 :    1798150 :             boost::shared_ptr<mask_bitmap_type> pMask( boost::dynamic_pointer_cast<mask_bitmap_type>( bmp ));
     357                 :            : 
     358   [ #  #  +  +  :    1798150 :             if( !pMask )
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  +  +  +  +  
          #  #  #  #  #  
                      # ]
     359                 :    1585089 :                 return pMask;
     360                 :            : 
     361 [ #  # ][ #  # ]:     213061 :             if( pMask->getSize() != getSize() )
         [ #  # ][ +  - ]
         [ +  - ][ +  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ -  + ][ +  - ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     362 [ #  # ][ +  - ]:          5 :                 pMask.reset();
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     363                 :            : 
     364                 :    1798150 :             return pMask;
     365                 :            :         }
     366                 :            : 
     367                 :     216143 :         virtual bool isCompatibleClipMask( const BitmapDeviceSharedPtr& bmp ) const
     368                 :            :         {
     369                 :            :             // TODO(P1): dynamic_cast usually called twice for
     370                 :            :             // compatible formats
     371                 :     216143 :             return boost::dynamic_pointer_cast<mask_bitmap_type>( bmp ).get() != NULL;
     372                 :            :         }
     373                 :            : 
     374                 :    1585094 :         boost::shared_ptr<alphamask_bitmap_type> getCompatibleAlphaMask( const BitmapDeviceSharedPtr& bmp ) const
     375                 :            :         {
     376                 :    1585094 :             return boost::dynamic_pointer_cast<alphamask_bitmap_type>( bmp );
     377                 :            :         }
     378                 :            : 
     379                 :          0 :         virtual bool isCompatibleAlphaMask( const BitmapDeviceSharedPtr& bmp ) const
     380                 :            :         {
     381                 :            :             // TODO(P1): dynamic_cast usually called twice for
     382                 :            :             // compatible formats
     383                 :          0 :             return getCompatibleAlphaMask( bmp ).get() != NULL;
     384                 :            :         }
     385                 :            : 
     386                 :      25173 :         virtual void clear_i( Color                   fillColor,
     387                 :            :                               const basegfx::B2IBox&  rBounds )
     388                 :            :         {
     389 [ +  - ][ +  - ]:      25173 :             fillImage(destIterRange(maBegin,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
     390                 :            :                                     maRawAccessor,
     391                 :            :                                     rBounds),
     392                 :            :                       maColorLookup(
     393                 :            :                           maAccessor,
     394                 :            :                           fillColor) );
     395                 :      25173 :             damaged( rBounds );
     396                 :      25173 :         }
     397                 :            : 
     398                 :     543959 :         virtual void setPixel_i( const basegfx::B2IPoint& rPt,
     399                 :            :                                  Color                    pixelColor,
     400                 :            :                                  DrawMode                 drawMode )
     401                 :            :         {
     402                 :            :             const DestIterator pixel( maBegin +
     403                 :            :                                       vigra::Diff2D(rPt.getX(),
     404 [ #  # ][ +  - ]:     543959 :                                                     rPt.getY()) );
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     405 [ #  # ][ -  + ]:     543959 :             if( drawMode == DrawMode_XOR )
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     406 [ #  # ][ #  # ]:          0 :                 maXorAccessor.set( pixelColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     407                 :            :                                    pixel );
     408                 :            :             else
     409 [ #  # ][ +  - ]:     543959 :                 maAccessor.set( pixelColor,
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     410                 :            :                                 pixel );
     411 [ #  # ][ +  - ]:     543959 :             damagedPixel(rPt);
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     412                 :     543959 :         }
     413                 :            : 
     414                 :     106883 :         virtual void setPixel_i( const basegfx::B2IPoint&     rPt,
     415                 :            :                                  Color                        pixelColor,
     416                 :            :                                  DrawMode                     drawMode,
     417                 :            :                                  const BitmapDeviceSharedPtr& rClip )
     418                 :            :         {
     419 [ #  # ][ +  - ]:     106883 :             boost::shared_ptr<mask_bitmap_type> pMask( getCompatibleClipMask(rClip) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     420                 :            :             OSL_ASSERT( pMask );
     421                 :            : 
     422                 :            :             const vigra::Diff2D offset(rPt.getX(),
     423                 :     106883 :                                        rPt.getY());
     424                 :            : 
     425                 :            :             const composite_iterator_type aIter(
     426                 :            :                 maBegin + offset,
     427         [ #  # ]:     106883 :                 pMask->maBegin + offset );
           [ #  #  +  - ]
                 [ +  - ]
           [ +  -  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  +  - ]
                 [ +  - ]
           [ +  -  +  - ]
                 [ +  - ]
           [ +  -  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     428                 :            : 
     429 [ #  # ][ -  + ]:     106883 :             if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     430 [ #  # ][ #  # ]:          0 :                 maMaskedXorAccessor.set( pixelColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     431                 :            :                                          aIter );
     432                 :            :             else
     433 [ #  # ][ +  - ]:     106883 :                 maMaskedAccessor.set( pixelColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     434                 :            :                                       aIter );
     435 [ #  # ][ #  # ]:     106883 :             damagedPixel(rPt);
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     436                 :     106883 :         }
     437                 :            : 
     438                 :   50917427 :         virtual Color getPixel_i(const basegfx::B2IPoint& rPt )
     439                 :            :         {
     440                 :            :             const DestIterator pixel( maBegin +
     441                 :            :                                       vigra::Diff2D(rPt.getX(),
     442 [ +  - ][ +  - ]:   50917427 :                                                     rPt.getY()) );
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     443 [ +  - ][ +  - ]:   50917427 :             return maAccessor(pixel);
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     444                 :            :         }
     445                 :            : 
     446                 :         20 :         virtual sal_uInt32 getPixelData_i( const basegfx::B2IPoint& rPt )
     447                 :            :         {
     448                 :            :             const DestIterator pixel( maBegin +
     449                 :            :                                       vigra::Diff2D(rPt.getX(),
     450 [ #  # ][ +  - ]:         20 :                                                     rPt.getY()) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     451 [ #  # ][ +  - ]:         20 :             return maToUInt32Converter(maRawAccessor(pixel));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     452                 :            :         }
     453                 :            : 
     454                 :            :         template< typename Iterator, typename Col, typename RawAcc >
     455                 :    2550370 :         void implRenderLine2( const basegfx::B2IPoint& rPt1,
     456                 :            :                               const basegfx::B2IPoint& rPt2,
     457                 :            :                               const basegfx::B2IBox&   rBounds,
     458                 :            :                               Col                      col,
     459                 :            :                               const Iterator&          begin,
     460                 :            :                               const RawAcc&            rawAcc )
     461                 :            :         {
     462 [ #  # ][ #  # ]:    2550370 :             renderClippedLine( rPt1,
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     463                 :            :                                rPt2,
     464                 :            :                                rBounds,
     465                 :            :                                col,
     466                 :            :                                begin,
     467                 :            :                                rawAcc );
     468                 :            :             // TODO(P2): perhaps this needs pushing up the stack a bit
     469                 :            :             // to make more complex polygons more efficient ...
     470   [ #  #  #  #  :    2550370 :             damaged( basegfx::B2IBox( rPt1, rPt2 ) );
          +  -  #  #  +  
          -  +  -  +  -  
          +  -  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  +  -  #  #  
          +  -  #  #  +  
          -  +  -  +  -  
          +  -  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                      # ]
     471                 :    2550370 :         }
     472                 :            : 
     473                 :            :         template< typename Iterator, typename Accessor, typename RawAcc >
     474                 :    1078969 :         void implRenderLine( const basegfx::B2IPoint& rPt1,
     475                 :            :                              const basegfx::B2IPoint& rPt2,
     476                 :            :                              const basegfx::B2IBox&   rBounds,
     477                 :            :                              Color                    col,
     478                 :            :                              const Iterator&          begin,
     479                 :            :                              const Accessor&          acc,
     480                 :            :                              const RawAcc&            rawAcc )
     481                 :            :         {
     482 [ +  - ][ #  # ]:    1078969 :             implRenderLine2( rPt1,rPt2,rBounds,
         [ +  - ][ #  # ]
     483                 :            :                              maColorLookup( acc,
     484                 :            :                                             col ),
     485                 :            :                              begin,
     486                 :            :                              rawAcc );
     487                 :    1078969 :         }
     488                 :            : 
     489                 :            :         template< typename Iterator, typename RawAcc, typename XorAcc >
     490                 :    1078969 :         void implDrawLine( const basegfx::B2IPoint& rPt1,
     491                 :            :                            const basegfx::B2IPoint& rPt2,
     492                 :            :                            const basegfx::B2IBox&   rBounds,
     493                 :            :                            Color                    col,
     494                 :            :                            const Iterator&          begin,
     495                 :            :                            const RawAcc&            rawAcc,
     496                 :            :                            const XorAcc&            xorAcc,
     497                 :            :                            DrawMode                 drawMode )
     498                 :            :         {
     499 [ #  # ][ #  # ]:    1078969 :             if( drawMode == DrawMode_XOR )
         [ +  + ][ +  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ -  + ]
         [ +  + ][ +  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     500                 :         40 :                 implRenderLine( rPt1, rPt2, rBounds, col,
     501                 :            :                                 begin, maAccessor, xorAcc );
     502                 :            :             else
     503                 :    1078929 :                 implRenderLine( rPt1, rPt2, rBounds, col,
     504                 :            :                                 begin, maAccessor, rawAcc );
     505                 :    1078969 :         }
     506                 :            : 
     507                 :    1065819 :         virtual void drawLine_i(const basegfx::B2IPoint& rPt1,
     508                 :            :                                 const basegfx::B2IPoint& rPt2,
     509                 :            :                                 const basegfx::B2IBox&   rBounds,
     510                 :            :                                 Color                    lineColor,
     511                 :            :                                 DrawMode                 drawMode )
     512                 :            :         {
     513                 :    1065819 :             implDrawLine(rPt1,rPt2,rBounds,lineColor,
     514                 :            :                          maBegin,
     515                 :            :                          maRawAccessor,maRawXorAccessor,drawMode);
     516                 :    1065819 :         }
     517                 :            : 
     518                 :     106153 :         composite_iterator_type getMaskedIter( const BitmapDeviceSharedPtr& rClip ) const
     519                 :            :         {
     520 [ #  # ][ +  - ]:     106153 :             boost::shared_ptr<mask_bitmap_type> pMask( getCompatibleClipMask(rClip) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     521                 :            :             OSL_ASSERT( pMask );
     522                 :            : 
     523                 :            :             return composite_iterator_type( maBegin,
     524 [ #  # ][ #  # ]:     106153 :                                             pMask->maBegin );
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     525                 :            :         }
     526                 :            : 
     527                 :      13150 :         virtual void drawLine_i(const basegfx::B2IPoint&     rPt1,
     528                 :            :                                 const basegfx::B2IPoint&     rPt2,
     529                 :            :                                 const basegfx::B2IBox&       rBounds,
     530                 :            :                                 Color                        lineColor,
     531                 :            :                                 DrawMode                     drawMode,
     532                 :            :                                 const BitmapDeviceSharedPtr& rClip )
     533                 :            :         {
     534 [ #  # ][ +  - ]:      13150 :             implDrawLine(rPt1,rPt2,rBounds,lineColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     535                 :            :                          getMaskedIter(rClip),
     536                 :            :                          maRawMaskedAccessor,
     537                 :            :                          maRawMaskedXorAccessor,drawMode);
     538                 :      13150 :         }
     539                 :            : 
     540                 :            :         template< typename Iterator, typename RawAcc >
     541                 :     240733 :         void implDrawPolygon( const basegfx::B2DPolygon& rPoly,
     542                 :            :                               const basegfx::B2IBox&     rBounds,
     543                 :            :                               Color                      col,
     544                 :            :                               const Iterator&            begin,
     545                 :            :                               const RawAcc&              acc )
     546                 :            :         {
     547 [ #  # ][ #  # ]:     240733 :             basegfx::B2DPolygon aPoly( rPoly );
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     548 [ #  # ][ #  # ]:     240733 :             if( rPoly.areControlPointsUsed() )
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     549 [ #  # ][ #  # ]:          0 :                 aPoly = basegfx::tools::adaptiveSubdivideByCount( rPoly );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     550                 :            : 
     551                 :            :             const typename dest_iterator_type::value_type colorIndex( maColorLookup(
     552                 :            :                                                                           maAccessor,
     553 [ #  # ][ #  # ]:     240733 :                                                                           col));
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     554 [ #  # ][ #  # ]:     240733 :             const sal_uInt32                              nVertices( aPoly.count() );
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     555 [ #  # ][ #  # ]:    1700588 :             for( sal_uInt32 i=1; i<nVertices; ++i )
         [ +  + ][ #  # ]
         [ #  # ][ #  # ]
         [ +  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  + ][ #  # ]
         [ +  + ][ #  # ]
         [ #  # ][ #  # ]
         [ +  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     556 [ #  # ][ #  # ]:    1459855 :                 implRenderLine2( basegfx::fround(aPoly.getB2DPoint(i-1)),
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     557                 :            :                                  basegfx::fround(aPoly.getB2DPoint(i)),
     558                 :            :                                  rBounds,
     559                 :            :                                  colorIndex,
     560                 :            :                                  begin,
     561                 :            :                                  acc );
     562                 :            : 
     563 [ #  # ][ #  # ]:     240733 :             if( nVertices > 1 && aPoly.isClosed() )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  + ][ +  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     564 [ #  # ][ #  # ]:     240733 :                 implRenderLine2( basegfx::fround(aPoly.getB2DPoint(nVertices-1)),
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     565                 :            :                                  basegfx::fround(aPoly.getB2DPoint(0)),
     566                 :            :                                  rBounds,
     567                 :            :                                  colorIndex,
     568                 :            :                                  begin,
     569                 :            :                                  acc );
     570                 :     240733 :         }
     571                 :            : 
     572                 :     238232 :         virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly,
     573                 :            :                                    const basegfx::B2IBox&     rBounds,
     574                 :            :                                    Color                      lineColor,
     575                 :            :                                    DrawMode                   drawMode )
     576                 :            :         {
     577 [ -  + ][ -  + ]:     238232 :             if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     578                 :          0 :                 implDrawPolygon( rPoly, rBounds, lineColor,
     579                 :            :                                  maBegin,
     580                 :            :                                  maRawXorAccessor );
     581                 :            :             else
     582                 :     238232 :                 implDrawPolygon( rPoly, rBounds, lineColor,
     583                 :            :                                  maBegin,
     584                 :            :                                  maRawAccessor );
     585                 :     238232 :         }
     586                 :            : 
     587                 :       2501 :         virtual void drawPolygon_i(const basegfx::B2DPolygon&   rPoly,
     588                 :            :                                    const basegfx::B2IBox&       rBounds,
     589                 :            :                                    Color                        lineColor,
     590                 :            :                                    DrawMode                     drawMode,
     591                 :            :                                    const BitmapDeviceSharedPtr& rClip )
     592                 :            :         {
     593 [ #  # ][ #  # ]:       2501 :             if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     594 [ #  # ][ #  # ]:          0 :                 implDrawPolygon( rPoly, rBounds, lineColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     595                 :            :                                  getMaskedIter(rClip),
     596                 :            :                                  maRawMaskedXorAccessor );
     597                 :            :             else
     598 [ #  # ][ #  # ]:       2501 :                 implDrawPolygon( rPoly, rBounds, lineColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     599                 :            :                                  getMaskedIter(rClip),
     600                 :            :                                  maRawMaskedAccessor );
     601                 :       2501 :         }
     602                 :            : 
     603                 :            :         template< typename Iterator, typename RawAcc >
     604                 :    3706181 :         void implFillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
     605                 :            :                                   Color                          col,
     606                 :            :                                   const Iterator&                begin,
     607                 :            :                                   const RawAcc&                  acc,
     608                 :            :                                   const basegfx::B2IBox&         rBounds )
     609                 :            :         {
     610 [ #  # ][ #  # ]:    3706181 :             basegfx::B2DPolyPolygon aPoly( rPoly );
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     611 [ #  # ][ #  # ]:    3706181 :             if( rPoly.areControlPointsUsed() )
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ +  - ][ -  + ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     612 [ #  # ][ #  # ]:          0 :                 aPoly = basegfx::tools::adaptiveSubdivideByCount( rPoly );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     613                 :            : 
     614 [ #  # ][ #  # ]:    3706181 :             renderClippedPolyPolygon( begin,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     615                 :            :                                       acc,
     616                 :            :                                       maColorLookup( maAccessor,
     617                 :            :                                                      col),
     618                 :            :                                       rBounds,
     619                 :            :                                       aPoly,
     620                 :            :                                       basegfx::FillRule_EVEN_ODD );
     621                 :            : 
     622 [ #  # ][ #  # ]:    3706181 :             if( mpDamage )
         [ -  + ][ #  # ]
         [ -  + ][ -  + ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ -  + ]
         [ -  + ][ -  + ]
         [ -  + ][ -  + ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     623                 :            :             {
     624 [ #  # ][ #  # ]:          0 :                 basegfx::B2DRange const aPolyBounds( basegfx::tools::getRange(aPoly) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     625 [ #  # ][ #  # ]:    3706181 :                 damaged( basegfx::unotools::b2ISurroundingBoxFromB2DRange( aPolyBounds ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     626                 :            :             }
     627                 :    3706181 :         }
     628                 :            : 
     629                 :    3618568 :         virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
     630                 :            :                                        Color                          fillColor,
     631                 :            :                                        DrawMode                       drawMode,
     632                 :            :                                        const basegfx::B2IBox&         rBounds )
     633                 :            :         {
     634 [ -  + ][ -  + ]:    3618568 :             if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ +  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     635                 :     103228 :                 implFillPolyPolygon( rPoly, fillColor,
     636                 :            :                                      maBegin,
     637                 :            :                                      maRawXorAccessor,
     638                 :            :                                      rBounds );
     639                 :            :             else
     640                 :    3515340 :                 implFillPolyPolygon( rPoly, fillColor,
     641                 :            :                                      maBegin,
     642                 :            :                                      maRawAccessor,
     643                 :            :                                      rBounds );
     644                 :    3618568 :         }
     645                 :            : 
     646                 :      87613 :         virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
     647                 :            :                                        Color                          fillColor,
     648                 :            :                                        DrawMode                       drawMode,
     649                 :            :                                        const basegfx::B2IBox&         rBounds,
     650                 :            :                                        const BitmapDeviceSharedPtr&   rClip )
     651                 :            :         {
     652 [ #  # ][ +  + ]:      87613 :             if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  + ][ +  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     653 [ #  # ][ +  - ]:        240 :                 implFillPolyPolygon( rPoly, fillColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     654                 :            :                                      getMaskedIter(rClip),
     655                 :            :                                      maRawMaskedXorAccessor,
     656                 :            :                                      rBounds );
     657                 :            :             else
     658 [ #  # ][ +  - ]:      87373 :                 implFillPolyPolygon( rPoly, fillColor,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     659                 :            :                                      getMaskedIter(rClip),
     660                 :            :                                      maRawMaskedAccessor,
     661                 :            :                                      rBounds );
     662                 :      87613 :         }
     663                 :            : 
     664                 :            :         template< typename Iterator, typename RawAcc >
     665                 :     646743 :         void implDrawBitmap(const BitmapDeviceSharedPtr& rSrcBitmap,
     666                 :            :                             const basegfx::B2IBox&       rSrcRect,
     667                 :            :                             const basegfx::B2IBox&       rDstRect,
     668                 :            :                             const Iterator&              begin,
     669                 :            :                             const RawAcc&                acc)
     670                 :            :         {
     671 [ #  # ][ #  # ]:     646743 :             boost::shared_ptr<BitmapRenderer> pSrcBmp( getCompatibleBitmap(rSrcBitmap) );
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     672                 :            :             OSL_ASSERT( pSrcBmp );
     673                 :            : 
     674 [ #  # ][ #  # ]:     646743 :             scaleImage(
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     675                 :            :                 srcIterRange(pSrcBmp->maBegin,
     676                 :            :                              pSrcBmp->maRawAccessor,
     677                 :            :                              rSrcRect),
     678                 :            :                 destIterRange(begin,
     679                 :            :                               acc,
     680                 :            :                               rDstRect),
     681                 :            :                 rSrcBitmap.get() == this );
     682 [ #  # ][ #  # ]:     646743 :             damaged( rDstRect );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     683                 :     646743 :         }
     684                 :            : 
     685                 :            :         template< typename Iterator, typename Acc >
     686                 :        180 :         void implDrawBitmapGeneric(const BitmapDeviceSharedPtr& rSrcBitmap,
     687                 :            :                                    const basegfx::B2IBox&       rSrcRect,
     688                 :            :                                    const basegfx::B2IBox&       rDstRect,
     689                 :            :                                    const Iterator&              begin,
     690                 :            :                                    const Acc&                   acc)
     691                 :            :         {
     692 [ #  # ][ #  # ]:        180 :             GenericColorImageAccessor aSrcAcc( rSrcBitmap );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     693                 :            : 
     694 [ #  # ][ #  # ]:        180 :             scaleImage(
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     695                 :            :                 srcIterRange(vigra::Diff2D(),
     696                 :            :                              aSrcAcc,
     697                 :            :                              rSrcRect),
     698                 :            :                 destIterRange(begin,
     699                 :            :                               acc,
     700                 :            :                               rDstRect));
     701 [ #  # ][ #  # ]:        180 :             damaged( rDstRect );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     702                 :        180 :         }
     703                 :            : 
     704                 :     644253 :         virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
     705                 :            :                                   const basegfx::B2IBox&       rSrcRect,
     706                 :            :                                   const basegfx::B2IBox&       rDstRect,
     707                 :            :                                   DrawMode                     drawMode )
     708                 :            :         {
     709 [ #  # ][ +  - ]:     644253 :             if( isCompatibleBitmap( rSrcBitmap ) )
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ +  - ]
         [ #  # ][ #  # ]
         [ +  + ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     710                 :            :             {
     711 [ #  # ][ -  + ]:     644073 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ -  + ]
         [ #  # ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     712                 :          0 :                     implDrawBitmap(rSrcBitmap, rSrcRect, rDstRect,
     713                 :            :                                    maBegin,
     714                 :            :                                    maRawXorAccessor);
     715                 :            :                 else
     716                 :     644073 :                     implDrawBitmap(rSrcBitmap, rSrcRect, rDstRect,
     717                 :            :                                    maBegin,
     718                 :            :                                    maRawAccessor);
     719                 :            :             }
     720                 :            :             else
     721                 :            :             {
     722 [ #  # ][ #  # ]:        180 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     723                 :          0 :                     implDrawBitmapGeneric(rSrcBitmap, rSrcRect, rDstRect,
     724                 :            :                                           maBegin,
     725                 :            :                                           maXorAccessor);
     726                 :            :                 else
     727                 :        180 :                     implDrawBitmapGeneric(rSrcBitmap, rSrcRect, rDstRect,
     728                 :            :                                           maBegin,
     729                 :            :                                           maAccessor);
     730                 :            :             }
     731                 :     644253 :             damaged( rDstRect );
     732                 :     644253 :         }
     733                 :            : 
     734                 :       2670 :         virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
     735                 :            :                                   const basegfx::B2IBox&       rSrcRect,
     736                 :            :                                   const basegfx::B2IBox&       rDstRect,
     737                 :            :                                   DrawMode                     drawMode,
     738                 :            :                                   const BitmapDeviceSharedPtr& rClip )
     739                 :            :         {
     740 [ #  # ][ +  - ]:       2670 :             if( isCompatibleBitmap( rSrcBitmap ) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     741                 :            :             {
     742 [ #  # ][ -  + ]:       2670 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     743 [ #  # ][ #  # ]:          0 :                     implDrawBitmap(rSrcBitmap, rSrcRect, rDstRect,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     744                 :            :                                    getMaskedIter(rClip),
     745                 :            :                                    maRawMaskedXorAccessor);
     746                 :            :                 else
     747 [ #  # ][ +  - ]:       2670 :                     implDrawBitmap(rSrcBitmap, rSrcRect, rDstRect,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     748                 :            :                                    getMaskedIter(rClip),
     749                 :            :                                    maRawMaskedAccessor);
     750                 :            :             }
     751                 :            :             else
     752                 :            :             {
     753 [ #  # ][ #  # ]:          0 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     754 [ #  # ][ #  # ]:          0 :                     implDrawBitmapGeneric(rSrcBitmap, rSrcRect, rDstRect,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     755                 :            :                                           getMaskedIter(rClip),
     756                 :            :                                           maMaskedXorAccessor);
     757                 :            :                 else
     758 [ #  # ][ #  # ]:          0 :                     implDrawBitmapGeneric(rSrcBitmap, rSrcRect, rDstRect,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     759                 :            :                                           getMaskedIter(rClip),
     760                 :            :                                           maMaskedAccessor);
     761                 :            :             }
     762                 :       2670 :             damaged( rDstRect );
     763                 :       2670 :         }
     764                 :            : 
     765                 :    1584877 :         virtual void drawMaskedColor_i(Color                        aSrcColor,
     766                 :            :                                        const BitmapDeviceSharedPtr& rAlphaMask,
     767                 :            :                                        const basegfx::B2IBox&       rSrcRect,
     768                 :            :                                        const basegfx::B2IPoint&     rDstPoint )
     769                 :            :         {
     770 [ #  # ][ +  - ]:    1584877 :             boost::shared_ptr<mask_bitmap_type>      pMask( getCompatibleClipMask(rAlphaMask) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     771 [ #  # ][ +  - ]:    1584877 :             boost::shared_ptr<alphamask_bitmap_type> pAlpha( getCompatibleAlphaMask(rAlphaMask) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     772                 :            : 
     773 [ #  # ][ +  + ]:    1584877 :             if( pAlpha )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     774                 :            :             {
     775                 :    1584872 :                 maColorBlendAccessor.setColor( aSrcColor );
     776                 :            : 
     777 [ #  # ][ #  # ]:    1584872 :                 vigra::copyImage( srcIterRange(pAlpha->maBegin,
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     778                 :            :                                                pAlpha->maRawAccessor,
     779                 :            :                                                rSrcRect),
     780                 :            :                                   destIter(maBegin,
     781                 :            :                                            maColorBlendAccessor,
     782                 :            :                                            rDstPoint) );
     783                 :            :             }
     784 [ #  # ][ -  + ]:          5 :             else if( pMask )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     785                 :            :             {
     786                 :            :                 const composite_iterator_type aBegin(
     787                 :            :                     maBegin + vigra::Diff2D(rDstPoint.getX(),
     788                 :            :                                             rDstPoint.getY()),
     789 [ #  # ][ #  # ]:          0 :                     pMask->maBegin + topLeft(rSrcRect) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     790                 :            : 
     791 [ #  # ][ #  # ]:          0 :                 fillImage(aBegin,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     792                 :            :                           aBegin + vigra::Diff2D(rSrcRect.getWidth(),
     793                 :            :                                                  rSrcRect.getHeight()),
     794                 :            :                           maRawMaskedAccessor,
     795                 :            :                           maColorLookup(
     796                 :            :                               maAccessor,
     797                 :            :                               aSrcColor) );
     798                 :            :             }
     799                 :            :             else
     800                 :            :             {
     801 [ #  # ][ +  - ]:          5 :                 GenericColorImageAccessor aSrcAcc( rAlphaMask );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     802                 :          5 :                 maGenericColorBlendAccessor.setColor( aSrcColor );
     803                 :            : 
     804 [ #  # ][ #  # ]:          5 :                 vigra::copyImage( srcIterRange(vigra::Diff2D(),
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     805                 :            :                                                aSrcAcc,
     806                 :            :                                                rSrcRect),
     807                 :            :                                   destIter(maBegin,
     808                 :            :                                            maGenericColorBlendAccessor,
     809                 :            :                                            rDstPoint) );
     810                 :            :             }
     811 [ #  # ][ #  # ]:    1584877 :             damagedPointSize( rDstPoint, rSrcRect );
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     812                 :    1584877 :         }
     813                 :            : 
     814                 :        217 :         virtual void drawMaskedColor_i(Color                        aSrcColor,
     815                 :            :                                        const BitmapDeviceSharedPtr& rAlphaMask,
     816                 :            :                                        const basegfx::B2IBox&       rSrcRect,
     817                 :            :                                        const basegfx::B2IPoint&     rDstPoint,
     818                 :            :                                        const BitmapDeviceSharedPtr& rClip )
     819                 :            :         {
     820 [ #  # ][ +  - ]:        217 :             boost::shared_ptr<mask_bitmap_type>      pMask( getCompatibleClipMask(rAlphaMask) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     821 [ #  # ][ +  - ]:        217 :             boost::shared_ptr<alphamask_bitmap_type> pAlpha( getCompatibleAlphaMask(rAlphaMask) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     822                 :            : 
     823 [ #  # ][ +  - ]:        217 :             if( pAlpha )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     824                 :            :             {
     825 [ #  # ][ +  - ]:        217 :                 const composite_iterator_type aBegin( getMaskedIter(rClip) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
                 [ #  # ]
     826                 :        217 :                 maMaskedColorBlendAccessor.get1stWrappedAccessor().setColor(
     827                 :            :                     aSrcColor );
     828                 :            : 
     829 [ #  # ][ #  # ]:        217 :                 vigra::copyImage( srcIterRange(pAlpha->maBegin,
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     830                 :            :                                                pAlpha->maRawAccessor,
     831                 :            :                                                rSrcRect),
     832                 :            :                                   destIter(aBegin,
     833                 :            :                                            maMaskedColorBlendAccessor,
     834                 :            :                                            rDstPoint) );
     835                 :            :             }
     836 [ #  # ][ #  # ]:          0 :             else if( pMask )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     837                 :            :             {
     838 [ #  # ][ #  # ]:          0 :                 boost::shared_ptr<mask_bitmap_type> pClipMask( getCompatibleClipMask(rClip) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     839                 :            :                 OSL_ASSERT( pClipMask );
     840                 :            : 
     841                 :            :                 // setup a ((iter,mask),clipMask) composite composite
     842                 :            :                 // iterator, to pass both masks (clip and alpha mask)
     843                 :            :                 // to the algorithm
     844                 :            :                 const composite_composite_mask_iterator_type aBegin(
     845                 :            :                     composite_iterator_type(
     846                 :            :                         maBegin + vigra::Diff2D(rDstPoint.getX(),
     847                 :            :                                                 rDstPoint.getY()),
     848                 :            :                         pMask->maBegin + topLeft(rSrcRect)),
     849                 :            :                     pClipMask->maBegin + vigra::Diff2D(rDstPoint.getX(),
     850 [ #  # ][ #  # ]:          0 :                                                        rDstPoint.getY()) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     851                 :            : 
     852 [ #  # ][ #  # ]:          0 :                 fillImage(aBegin,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     853                 :            :                           aBegin + vigra::Diff2D(rSrcRect.getWidth(),
     854                 :            :                                                  rSrcRect.getHeight()),
     855                 :            :                           maRawMaskedMaskAccessor,
     856                 :            :                           maColorLookup(
     857                 :            :                               maAccessor,
     858                 :            :                               aSrcColor) );
     859                 :            :             }
     860                 :            :             else
     861                 :            :             {
     862 [ #  # ][ #  # ]:          0 :                 GenericColorImageAccessor aSrcAcc( rAlphaMask );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     863 [ #  # ][ #  # ]:          0 :                 const composite_iterator_type aBegin( getMaskedIter(rClip) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     864                 :          0 :                 maGenericMaskedColorBlendAccessor.get1stWrappedAccessor().setColor(
     865                 :            :                     aSrcColor );
     866                 :            : 
     867 [ #  # ][ #  # ]:          0 :                 vigra::copyImage( srcIterRange(vigra::Diff2D(),
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     868                 :            :                                                aSrcAcc,
     869                 :            :                                                rSrcRect),
     870                 :            :                                   destIter(aBegin,
     871                 :            :                                            maGenericMaskedColorBlendAccessor,
     872                 :            :                                            rDstPoint) );
     873                 :            :             }
     874 [ #  # ][ #  # ]:        217 :             damagedPointSize( rDstPoint, rSrcRect );
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     875                 :        217 :         }
     876                 :            : 
     877                 :            :         template< typename Iterator, typename Acc >
     878                 :         20 :         void implDrawMaskedBitmap(const BitmapDeviceSharedPtr& rSrcBitmap,
     879                 :            :                                   const BitmapDeviceSharedPtr& rMask,
     880                 :            :                                   const basegfx::B2IBox&       rSrcRect,
     881                 :            :                                   const basegfx::B2IBox&       rDstRect,
     882                 :            :                                   const Iterator&              begin,
     883                 :            :                                   const Acc&                   acc)
     884                 :            :         {
     885 [ #  # ][ #  # ]:         20 :             boost::shared_ptr<BitmapRenderer>   pSrcBmp( getCompatibleBitmap(rSrcBitmap) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     886 [ #  # ][ #  # ]:         20 :             boost::shared_ptr<mask_bitmap_type> pMask( getCompatibleClipMask(rMask) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     887                 :            :             OSL_ASSERT( pMask && pSrcBmp );
     888                 :            : 
     889 [ #  # ][ #  # ]:         20 :             scaleImage(
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     890                 :            :                 srcIterRange(composite_iterator_type(
     891                 :            :                                  pSrcBmp->maBegin,
     892                 :            :                                  pMask->maBegin),
     893                 :            :                              joined_image_accessor_type(
     894                 :            :                                  pSrcBmp->maAccessor,
     895                 :            :                                  pMask->maRawAccessor),
     896                 :            :                              rSrcRect),
     897                 :            :                 destIterRange(begin,
     898                 :            :                               typename masked_input_splitting_accessor<
     899                 :            :                                        Acc,
     900                 :            :                                        joined_image_accessor_type,
     901                 :            :                                        Masks::clipmask_polarity,
     902                 :            :                                        FastMask >::type(acc),
     903                 :            :                               rDstRect),
     904                 :            :                 rSrcBitmap.get() == this);
     905 [ #  # ][ #  # ]:         20 :             damaged( rDstRect );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     906                 :         20 :         }
     907                 :            : 
     908                 :            :         template< typename Iterator, typename Acc >
     909                 :       3087 :         void implDrawMaskedBitmapGeneric(const BitmapDeviceSharedPtr& rSrcBitmap,
     910                 :            :                                          const BitmapDeviceSharedPtr& rMask,
     911                 :            :                                          const basegfx::B2IBox&       rSrcRect,
     912                 :            :                                          const basegfx::B2IBox&       rDstRect,
     913                 :            :                                          const Iterator&              begin,
     914                 :            :                                          const Acc&                   acc)
     915                 :            :         {
     916 [ #  # ][ #  # ]:       3087 :             GenericColorImageAccessor aSrcAcc( rSrcBitmap );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     917 [ #  # ][ #  # ]:       3087 :             GenericColorImageAccessor aMaskAcc( rMask );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     918                 :            : 
     919                 :            :             const vigra::Diff2D aTopLeft(rSrcRect.getMinX(),
     920 [ #  # ][ #  # ]:       3087 :                                          rSrcRect.getMinY());
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     921                 :            :             const vigra::Diff2D aBottomRight(rSrcRect.getMaxX(),
     922 [ #  # ][ #  # ]:       3087 :                                              rSrcRect.getMaxY());
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     923 [ #  # ][ #  # ]:       3087 :             scaleImage(
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
           [ +  -  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
           [ +  -  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     924                 :            :                 vigra::make_triple(
     925                 :            :                     generic_composite_iterator_type(
     926                 :            :                         aTopLeft,aTopLeft),
     927                 :            :                     generic_composite_iterator_type(
     928                 :            :                         aBottomRight,aBottomRight),
     929                 :            :                     joined_generic_image_accessor_type(
     930                 :            :                         aSrcAcc,
     931                 :            :                         aMaskAcc)),
     932                 :            :                 destIterRange(begin,
     933                 :            :                               typename masked_input_splitting_accessor<
     934                 :            :                                        Acc,
     935                 :            :                                        joined_generic_image_accessor_type,
     936                 :            :                                        Masks::clipmask_polarity,
     937                 :            :                                        NoFastMask >::type(acc),
     938                 :            :                               rDstRect));
     939 [ #  # ][ #  # ]:       3087 :             damaged( rDstRect );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     940                 :       3087 :         }
     941                 :            : 
     942                 :       3105 :         virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
     943                 :            :                                         const BitmapDeviceSharedPtr& rMask,
     944                 :            :                                         const basegfx::B2IBox&       rSrcRect,
     945                 :            :                                         const basegfx::B2IBox&       rDstRect,
     946                 :            :                                         DrawMode                     drawMode )
     947                 :            :         {
     948 [ #  # ][ #  # ]:       3105 :             if( isCompatibleClipMask(rMask) &&
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     949                 :            :                 isCompatibleBitmap(rSrcBitmap) )
     950                 :            :             {
     951 [ #  # ][ -  + ]:         20 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ -  + ]
         [ #  # ][ #  # ]
                 [ #  # ]
     952                 :          0 :                     implDrawMaskedBitmap(rSrcBitmap, rMask,
     953                 :            :                                          rSrcRect, rDstRect,
     954                 :            :                                          maBegin,
     955                 :            :                                          maXorAccessor);
     956                 :            :                 else
     957                 :         20 :                     implDrawMaskedBitmap(rSrcBitmap, rMask,
     958                 :            :                                          rSrcRect, rDstRect,
     959                 :            :                                          maBegin,
     960                 :            :                                          maAccessor);
     961                 :            :             }
     962                 :            :             else
     963                 :            :             {
     964 [ #  # ][ #  # ]:       3085 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     965                 :          0 :                     implDrawMaskedBitmapGeneric(rSrcBitmap, rMask,
     966                 :            :                                                 rSrcRect, rDstRect,
     967                 :            :                                                 maBegin,
     968                 :            :                                                 maXorAccessor);
     969                 :            :                 else
     970                 :       3085 :                     implDrawMaskedBitmapGeneric(rSrcBitmap, rMask,
     971                 :            :                                                 rSrcRect, rDstRect,
     972                 :            :                                                 maBegin,
     973                 :            :                                                 maAccessor);
     974                 :            :             }
     975                 :       3105 :             damaged( rDstRect );
     976                 :       3105 :         }
     977                 :            : 
     978                 :          2 :         virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
     979                 :            :                                         const BitmapDeviceSharedPtr& rMask,
     980                 :            :                                         const basegfx::B2IBox&       rSrcRect,
     981                 :            :                                         const basegfx::B2IBox&       rDstRect,
     982                 :            :                                         DrawMode                     drawMode,
     983                 :            :                                         const BitmapDeviceSharedPtr& rClip )
     984                 :            :         {
     985 [ #  # ][ #  # ]:          2 :             if( isCompatibleClipMask(rMask) &&
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     986                 :            :                 isCompatibleBitmap(rSrcBitmap) )
     987                 :            :             {
     988 [ #  # ][ #  # ]:          0 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     989 [ #  # ][ #  # ]:          0 :                     implDrawMaskedBitmap(rSrcBitmap, rMask,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     990                 :            :                                          rSrcRect, rDstRect,
     991                 :            :                                          getMaskedIter(rClip),
     992                 :            :                                          maMaskedXorAccessor);
     993                 :            :                 else
     994 [ #  # ][ #  # ]:          0 :                     implDrawMaskedBitmap(rSrcBitmap, rMask,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     995                 :            :                                          rSrcRect, rDstRect,
     996                 :            :                                          getMaskedIter(rClip),
     997                 :            :                                          maMaskedAccessor);
     998                 :            :             }
     999                 :            :             else
    1000                 :            :             {
    1001 [ #  # ][ #  # ]:          2 :                 if( drawMode == DrawMode_XOR )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1002 [ #  # ][ #  # ]:          0 :                     implDrawMaskedBitmapGeneric(rSrcBitmap, rMask,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1003                 :            :                                                 rSrcRect, rDstRect,
    1004                 :            :                                                 getMaskedIter(rClip),
    1005                 :            :                                                 maMaskedXorAccessor);
    1006                 :            :                 else
    1007 [ #  # ][ #  # ]:          2 :                     implDrawMaskedBitmapGeneric(rSrcBitmap, rMask,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1008                 :            :                                                 rSrcRect, rDstRect,
    1009                 :            :                                                 getMaskedIter(rClip),
    1010                 :            :                                                 maMaskedAccessor);
    1011                 :            :             }
    1012                 :          2 :             damaged( rDstRect );
    1013                 :          2 :         }
    1014                 :            : 
    1015                 :     801506 :         IBitmapDeviceDamageTrackerSharedPtr getDamageTracker_i() const
    1016                 :            :         {
    1017                 :     801506 :             return mpDamage;
    1018                 :            :         }
    1019                 :          0 :         void setDamageTracker_i( const IBitmapDeviceDamageTrackerSharedPtr& rDamage )
    1020                 :            :         {
    1021                 :          0 :             mpDamage = rDamage;
    1022                 :          0 :         }
    1023                 :            :     };
    1024                 :            : } // namespace
    1025                 :            : 
    1026 [ +  - ][ +  - ]:    4532113 : struct ImplBitmapDevice
         [ +  - ][ +  - ]
                 [ +  - ]
    1027                 :            : {
    1028                 :            :     /** Bitmap memory plus deleter.
    1029                 :            : 
    1030                 :            :         Always points to the start of the mem
    1031                 :            :      */
    1032                 :            :     RawMemorySharedArray      mpMem;
    1033                 :            : 
    1034                 :            :     /// Palette memory plus deleter (might be NULL)
    1035                 :            :     PaletteMemorySharedVector mpPalette;
    1036                 :            : 
    1037                 :            :     /** Bounds of the device.
    1038                 :            : 
    1039                 :            :         maBounds.getWidth()/getHeight() yield the true size of the
    1040                 :            :         device (i.e. the rectangle given by maBounds covers the device
    1041                 :            :         area under the including-the-bottommost-and-rightmost-pixels
    1042                 :            :         fill rule)
    1043                 :            :      */
    1044                 :            :     basegfx::B2IBox           maBounds;
    1045                 :            : 
    1046                 :            :     /// Scanline format, as provided at the constructor
    1047                 :            :     sal_Int32                 mnScanlineFormat;
    1048                 :            : 
    1049                 :            :     /// Scanline stride. Negative for bottom-to-top formats
    1050                 :            :     sal_Int32                 mnScanlineStride;
    1051                 :            : 
    1052                 :            :     /// raw ptr to 0th scanline. used for cloning a generic renderer
    1053                 :            :     sal_uInt8*                mpFirstScanline;
    1054                 :            : 
    1055                 :            :     /** (Optional) device sharing the same memory, and used for input
    1056                 :            :         clip masks/alpha masks/bitmaps that don't match our exact
    1057                 :            :         bitmap format.
    1058                 :            : 
    1059                 :            :         This is to avoid the combinatorical explosion when dealing
    1060                 :            :         with n bitmap formats, which could be combined with n clip
    1061                 :            :         masks, alpha masks and bitmap masks (yielding a total of n^4
    1062                 :            :         combinations). Since each BitmapRenderer is specialized for
    1063                 :            :         one specific combination of said formats, a lot of duplicate
    1064                 :            :         code would be generated, most of which probably never
    1065                 :            :         used. Therefore, only the most common combinations are
    1066                 :            :         specialized templates, the remainder gets handled by this
    1067                 :            :         generic renderer (via runtime polymorphism).
    1068                 :            :      */
    1069                 :            :     BitmapDeviceSharedPtr     mpGenericRenderer;
    1070                 :            : };
    1071                 :            : 
    1072                 :            : 
    1073                 :    3162490 : BitmapDevice::BitmapDevice( const basegfx::B2IBox&           rBounds,
    1074                 :            :                             sal_Int32                        nScanlineFormat,
    1075                 :            :                             sal_Int32                        nScanlineStride,
    1076                 :            :                             sal_uInt8*                       pFirstScanline,
    1077                 :            :                             const RawMemorySharedArray&      rMem,
    1078                 :            :                             const PaletteMemorySharedVector& rPalette ) :
    1079 [ +  - ][ +  - ]:    3162490 :     mpImpl( new ImplBitmapDevice )
    1080                 :            : {
    1081         [ +  - ]:    3162490 :     mpImpl->mpMem = rMem;
    1082         [ +  - ]:    3162490 :     mpImpl->mpPalette = rPalette;
    1083                 :    3162490 :     mpImpl->maBounds = rBounds;
    1084                 :    3162490 :     mpImpl->mnScanlineFormat = nScanlineFormat;
    1085                 :    3162490 :     mpImpl->mnScanlineStride = nScanlineStride;
    1086                 :    3162490 :     mpImpl->mpFirstScanline  = pFirstScanline;
    1087                 :    3162490 : }
    1088                 :            : 
    1089         [ +  - ]:    1369623 : BitmapDevice::~BitmapDevice()
    1090                 :            : {
    1091                 :            :     // outline, because of internal ImplBitmapDevice
    1092         [ -  + ]:    1369623 : }
    1093                 :            : 
    1094                 :   10213049 : basegfx::B2IVector BitmapDevice::getSize() const
    1095                 :            : {
    1096                 :            :     return basegfx::B2IVector(
    1097                 :   10213049 :         mpImpl->maBounds.getMaxX() - mpImpl->maBounds.getMinX(),
    1098                 :   20426098 :         mpImpl->maBounds.getMaxY() - mpImpl->maBounds.getMinY() );
    1099                 :            : }
    1100                 :            : 
    1101                 :    2217057 : bool BitmapDevice::isTopDown() const
    1102                 :            : {
    1103                 :    2217057 :     return mpImpl->mnScanlineStride >= 0;
    1104                 :            : }
    1105                 :            : 
    1106                 :    6645397 : sal_Int32 BitmapDevice::getScanlineFormat() const
    1107                 :            : {
    1108                 :    6645397 :     return mpImpl->mnScanlineFormat;
    1109                 :            : }
    1110                 :            : 
    1111                 :    1280717 : sal_Int32 BitmapDevice::getScanlineStride() const
    1112                 :            : {
    1113                 :    1280717 :     return mpImpl->mnScanlineStride < 0 ?
    1114         [ +  + ]:    1280717 :         -mpImpl->mnScanlineStride : mpImpl->mnScanlineStride;
    1115                 :            : }
    1116                 :            : 
    1117                 :    1796301 : RawMemorySharedArray BitmapDevice::getBuffer() const
    1118                 :            : {
    1119                 :    1796301 :     return mpImpl->mpMem;
    1120                 :            : }
    1121                 :            : 
    1122                 :     801506 : IBitmapDeviceDamageTrackerSharedPtr BitmapDevice::getDamageTracker() const
    1123                 :            : {
    1124                 :     801506 :     return getDamageTracker_i();
    1125                 :            : }
    1126                 :            : 
    1127                 :          0 : void BitmapDevice::setDamageTracker( const IBitmapDeviceDamageTrackerSharedPtr& rDamage )
    1128                 :            : {
    1129                 :          0 :     setDamageTracker_i(rDamage);
    1130                 :          0 : }
    1131                 :            : 
    1132                 :    1461377 : PaletteMemorySharedVector BitmapDevice::getPalette() const
    1133                 :            : {
    1134                 :    1461377 :     return mpImpl->mpPalette;
    1135                 :            : }
    1136                 :            : 
    1137                 :      25173 : void BitmapDevice::clear( Color fillColor )
    1138                 :            : {
    1139                 :      25173 :     clear_i( fillColor, mpImpl->maBounds );
    1140                 :      25173 : }
    1141                 :            : 
    1142                 :     642275 : void BitmapDevice::setPixel( const basegfx::B2IPoint& rPt,
    1143                 :            :                              Color                    lineColor,
    1144                 :            :                              DrawMode                 drawMode )
    1145                 :            : {
    1146         [ +  + ]:     642275 :     if( mpImpl->maBounds.isInside(rPt) )
    1147                 :     543959 :         setPixel_i(rPt,lineColor,drawMode);
    1148                 :     642275 : }
    1149                 :            : 
    1150                 :     749008 : void BitmapDevice::setPixel( const basegfx::B2IPoint&     rPt,
    1151                 :            :                              Color                        lineColor,
    1152                 :            :                              DrawMode                     drawMode,
    1153                 :            :                              const BitmapDeviceSharedPtr& rClip )
    1154                 :            : {
    1155         [ +  + ]:     749008 :     if( !rClip )
    1156                 :            :     {
    1157                 :     642125 :         setPixel(rPt,lineColor,drawMode);
    1158                 :     749008 :         return;
    1159                 :            :     }
    1160                 :            : 
    1161         [ +  - ]:     106883 :     if( mpImpl->maBounds.isInside(rPt) )
    1162                 :            :     {
    1163         [ +  - ]:     106883 :         if( isCompatibleClipMask( rClip ) )
    1164                 :     106883 :             setPixel_i(rPt,lineColor,drawMode,rClip);
    1165                 :            :         else
    1166         [ #  # ]:          0 :             getGenericRenderer()->setPixel( rPt, lineColor, drawMode, rClip );
    1167                 :            :     }
    1168                 :            : }
    1169                 :            : 
    1170                 :   50917427 : Color BitmapDevice::getPixel( const basegfx::B2IPoint& rPt )
    1171                 :            : {
    1172         [ +  - ]:   50917427 :     if( mpImpl->maBounds.isInside(rPt) )
    1173                 :   50917427 :         return getPixel_i(rPt);
    1174                 :            : 
    1175                 :   50917427 :     return Color();
    1176                 :            : }
    1177                 :            : 
    1178                 :         30 : sal_uInt32 BitmapDevice::getPixelData( const basegfx::B2IPoint& rPt )
    1179                 :            : {
    1180         [ +  + ]:         30 :     if( mpImpl->maBounds.isInside(rPt) )
    1181                 :         20 :         return getPixelData_i(rPt);
    1182                 :            : 
    1183                 :         30 :     return 0;
    1184                 :            : }
    1185                 :            : 
    1186                 :    1065819 : void BitmapDevice::drawLine( const basegfx::B2IPoint& rPt1,
    1187                 :            :                              const basegfx::B2IPoint& rPt2,
    1188                 :            :                              Color                    lineColor,
    1189                 :            :                              DrawMode                 drawMode )
    1190                 :            : {
    1191                 :            :     drawLine_i( rPt1,
    1192                 :            :                 rPt2,
    1193                 :    1065819 :                 mpImpl->maBounds,
    1194                 :            :                 lineColor,
    1195                 :    1065819 :                 drawMode );
    1196                 :    1065819 : }
    1197                 :            : 
    1198                 :    1078839 : void BitmapDevice::drawLine( const basegfx::B2IPoint&     rPt1,
    1199                 :            :                              const basegfx::B2IPoint&     rPt2,
    1200                 :            :                              Color                        lineColor,
    1201                 :            :                              DrawMode                     drawMode,
    1202                 :            :                              const BitmapDeviceSharedPtr& rClip )
    1203                 :            : {
    1204         [ +  + ]:    1078839 :     if( !rClip )
    1205                 :            :     {
    1206                 :    1065689 :         drawLine(rPt1,rPt2,lineColor,drawMode);
    1207                 :    1078839 :         return;
    1208                 :            :     }
    1209                 :            : 
    1210         [ +  - ]:      13150 :     if( isCompatibleClipMask( rClip ) )
    1211                 :            :         drawLine_i( rPt1,
    1212                 :            :                     rPt2,
    1213                 :      13150 :                     mpImpl->maBounds,
    1214                 :            :                     lineColor,
    1215                 :            :                     drawMode,
    1216                 :      13150 :                     rClip );
    1217                 :            :     else
    1218                 :            :         getGenericRenderer()->drawLine( rPt1, rPt2, lineColor,
    1219         [ #  # ]:          0 :                                         drawMode, rClip );
    1220                 :            : }
    1221                 :            : 
    1222                 :     238232 : void BitmapDevice::drawPolygon( const basegfx::B2DPolygon& rPoly,
    1223                 :            :                                 Color                      lineColor,
    1224                 :            :                                 DrawMode                   drawMode )
    1225                 :            : {
    1226                 :     238232 :     const sal_uInt32 numVertices( rPoly.count() );
    1227         [ +  - ]:     238232 :     if( numVertices )
    1228                 :            :         drawPolygon_i( rPoly,
    1229                 :     238232 :                        mpImpl->maBounds,
    1230                 :     238232 :                        lineColor, drawMode );
    1231                 :     238232 : }
    1232                 :            : 
    1233                 :     240648 : void BitmapDevice::drawPolygon( const basegfx::B2DPolygon&   rPoly,
    1234                 :            :                                 Color                        lineColor,
    1235                 :            :                                 DrawMode                     drawMode,
    1236                 :            :                                 const BitmapDeviceSharedPtr& rClip )
    1237                 :            : {
    1238         [ +  + ]:     240648 :     if( !rClip )
    1239                 :            :     {
    1240                 :     238147 :         drawPolygon(rPoly,lineColor,drawMode);
    1241                 :     240648 :         return;
    1242                 :            :     }
    1243                 :            : 
    1244                 :       2501 :     const sal_uInt32 numVertices( rPoly.count() );
    1245         [ +  - ]:       2501 :     if( numVertices )
    1246                 :            :     {
    1247         [ +  - ]:       2501 :         if( isCompatibleClipMask( rClip ) )
    1248                 :            :             drawPolygon_i( rPoly,
    1249                 :       2501 :                            mpImpl->maBounds,
    1250                 :       2501 :                            lineColor, drawMode, rClip );
    1251                 :            :         else
    1252                 :            :             getGenericRenderer()->drawPolygon( rPoly, lineColor,
    1253         [ #  # ]:          0 :                                                drawMode, rClip );
    1254                 :            :     }
    1255                 :            : }
    1256                 :            : 
    1257                 :    3618568 : void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
    1258                 :            :                                     Color                          fillColor,
    1259                 :            :                                     DrawMode                       drawMode )
    1260                 :            : {
    1261                 :    3618568 :     fillPolyPolygon_i( rPoly, fillColor, drawMode, mpImpl->maBounds );
    1262                 :    3618568 : }
    1263                 :            : 
    1264                 :    3599232 : void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
    1265                 :            :                                     Color                          fillColor,
    1266                 :            :                                     DrawMode                       drawMode,
    1267                 :            :                                     const BitmapDeviceSharedPtr&   rClip )
    1268                 :            : {
    1269         [ +  + ]:    3599232 :     if( !rClip )
    1270                 :            :     {
    1271                 :    3511619 :         fillPolyPolygon(rPoly,fillColor,drawMode);
    1272                 :    3599232 :         return;
    1273                 :            :     }
    1274                 :            : 
    1275         [ +  - ]:      87613 :     if( isCompatibleClipMask( rClip ) )
    1276                 :      87613 :         fillPolyPolygon_i( rPoly, fillColor, drawMode, mpImpl->maBounds, rClip );
    1277                 :            :     else
    1278                 :            :         getGenericRenderer()->fillPolyPolygon( rPoly, fillColor,
    1279         [ #  # ]:          0 :                                                drawMode, rClip );
    1280                 :            : }
    1281                 :            : 
    1282                 :            : 
    1283                 :            : namespace
    1284                 :            : {
    1285                 :    1585094 :     void assertImagePoint( const basegfx::B2IPoint& rPt,
    1286                 :            :                            const basegfx::B2IBox&   rPermittedRange )
    1287                 :            :     {
    1288                 :            :         (void)rPt; (void)rPermittedRange;
    1289                 :            :         OSL_ASSERT( rPermittedRange.isInside(rPt) );
    1290                 :    1585094 :     }
    1291                 :            : 
    1292                 :    2885154 :     void assertImageRange( const basegfx::B2IBox& rRange,
    1293                 :            :                            const basegfx::B2IBox& rPermittedRange )
    1294                 :            :     {
    1295                 :            : #if OSL_DEBUG_LEVEL > 0
    1296                 :            :         basegfx::B2IBox aRange( rRange );
    1297                 :            :         aRange.intersect( rPermittedRange );
    1298                 :            : 
    1299                 :            :         OSL_ASSERT( aRange == rRange );
    1300                 :            : #else
    1301                 :            :         (void)rRange; (void)rPermittedRange;
    1302                 :            : #endif
    1303                 :    2885154 :     }
    1304                 :            : 
    1305                 :            :     // TODO(Q3): Move canvas/canvastools.hxx clipBlit() down
    1306                 :            :     // to basegfx, and use here!
    1307                 :    1789230 :     bool clipAreaImpl( ::basegfx::B2IBox&       io_rSourceArea,
    1308                 :            :                        ::basegfx::B2IPoint&     io_rDestPoint,
    1309                 :            :                        const ::basegfx::B2IBox& rSourceBounds,
    1310                 :            :                        const ::basegfx::B2IBox& rDestBounds )
    1311                 :            :     {
    1312                 :            :         const ::basegfx::B2IPoint aSourceTopLeft(
    1313         [ +  - ]:    1789230 :             io_rSourceArea.getMinimum() );
    1314                 :            : 
    1315                 :    1789230 :         ::basegfx::B2IBox aLocalSourceArea( io_rSourceArea );
    1316                 :            : 
    1317                 :            :         // clip source area (which must be inside rSourceBounds)
    1318         [ +  - ]:    1789230 :         aLocalSourceArea.intersect( rSourceBounds );
    1319                 :            : 
    1320         [ -  + ]:    1789230 :         if( aLocalSourceArea.isEmpty() )
    1321                 :          0 :             return false;
    1322                 :            : 
    1323                 :            :         // calc relative new source area points (relative to orig
    1324                 :            :         // source area)
    1325                 :            :         const ::basegfx::B2IVector aUpperLeftOffset(
    1326 [ +  - ][ +  - ]:    1789230 :             aLocalSourceArea.getMinimum()-aSourceTopLeft );
    1327                 :            :         const ::basegfx::B2IVector aLowerRightOffset(
    1328 [ +  - ][ +  - ]:    1789230 :             aLocalSourceArea.getMaximum()-aSourceTopLeft );
    1329                 :            : 
    1330                 :            :         ::basegfx::B2IBox aLocalDestArea( io_rDestPoint + aUpperLeftOffset,
    1331 [ +  - ][ +  - ]:    1789230 :                                           io_rDestPoint + aLowerRightOffset );
                 [ +  - ]
    1332                 :            : 
    1333                 :            :         // clip dest area (which must be inside rDestBounds)
    1334         [ +  - ]:    1789230 :         aLocalDestArea.intersect( rDestBounds );
    1335                 :            : 
    1336         [ +  + ]:    1789230 :         if( aLocalDestArea.isEmpty() )
    1337                 :     204136 :             return false;
    1338                 :            : 
    1339                 :            :         // calc relative new dest area points (relative to orig
    1340                 :            :         // source area)
    1341                 :            :         const ::basegfx::B2IVector aDestUpperLeftOffset(
    1342 [ +  - ][ +  - ]:    1585094 :             aLocalDestArea.getMinimum()-io_rDestPoint );
    1343                 :            :         const ::basegfx::B2IVector aDestLowerRightOffset(
    1344 [ +  - ][ +  - ]:    1585094 :             aLocalDestArea.getMaximum()-io_rDestPoint );
    1345                 :            : 
    1346                 :            :         io_rSourceArea = ::basegfx::B2IBox( aSourceTopLeft + aDestUpperLeftOffset,
    1347 [ +  - ][ +  - ]:    1585094 :                                             aSourceTopLeft + aDestLowerRightOffset );
                 [ +  - ]
    1348 [ +  - ][ +  - ]:    1585094 :         io_rDestPoint  = aLocalDestArea.getMinimum();
    1349                 :            : 
    1350                 :    1789230 :         return true;
    1351                 :            :     }
    1352                 :            : 
    1353                 :            :     // TODO(Q3): Move canvas/canvastools.hxx clipBlit() down
    1354                 :            :     // to basegfx, and use here!
    1355                 :     655149 :     bool clipAreaImpl( ::basegfx::B2IBox&       io_rDestArea,
    1356                 :            :                        ::basegfx::B2IBox&       io_rSourceArea,
    1357                 :            :                        const ::basegfx::B2IBox& rDestBounds,
    1358                 :            :                        const ::basegfx::B2IBox& rSourceBounds )
    1359                 :            :     {
    1360                 :            :         // extract inherent scale
    1361 [ +  - ][ +  - ]:     655149 :         const double nScaleX( io_rDestArea.getWidth() / (double)io_rSourceArea.getWidth() );
    1362 [ +  - ][ +  - ]:     655149 :         const double nScaleY( io_rDestArea.getHeight() / (double)io_rSourceArea.getHeight() );
    1363                 :            : 
    1364                 :            :         // extract range origins
    1365                 :            :         const basegfx::B2IPoint   aDestTopLeft(
    1366         [ +  - ]:     655149 :             io_rDestArea.getMinimum() );
    1367                 :            :         const ::basegfx::B2IPoint aSourceTopLeft(
    1368         [ +  - ]:     655149 :             io_rSourceArea.getMinimum() );
    1369                 :            : 
    1370                 :     655149 :         ::basegfx::B2IBox aLocalSourceArea( io_rSourceArea );
    1371                 :            : 
    1372                 :            :         // clip source area (which must be inside rSourceBounds)
    1373         [ +  - ]:     655149 :         aLocalSourceArea.intersect( rSourceBounds );
    1374                 :            : 
    1375         [ -  + ]:     655149 :         if( aLocalSourceArea.isEmpty() )
    1376                 :          0 :             return false;
    1377                 :            : 
    1378                 :            :         // calc relative new source area points (relative to orig
    1379                 :            :         // source area)
    1380                 :            :         const ::basegfx::B2IVector aUpperLeftOffset(
    1381 [ +  - ][ +  - ]:     655149 :             aLocalSourceArea.getMinimum()-aSourceTopLeft );
    1382                 :            :         const ::basegfx::B2IVector aLowerRightOffset(
    1383 [ +  - ][ +  - ]:     655149 :             aLocalSourceArea.getMaximum()-aSourceTopLeft );
    1384                 :            : 
    1385                 :     655149 :         ::basegfx::B2IBox aLocalDestArea( basegfx::fround(aDestTopLeft.getX() + nScaleX*aUpperLeftOffset.getX()),
    1386                 :     655149 :                                           basegfx::fround(aDestTopLeft.getY() + nScaleY*aUpperLeftOffset.getY()),
    1387                 :     655149 :                                           basegfx::fround(aDestTopLeft.getX() + nScaleX*aLowerRightOffset.getX()),
    1388         [ +  - ]:    2620596 :                                           basegfx::fround(aDestTopLeft.getY() + nScaleY*aLowerRightOffset.getY()) );
    1389                 :            : 
    1390                 :            :         // clip dest area (which must be inside rDestBounds)
    1391         [ +  - ]:     655149 :         aLocalDestArea.intersect( rDestBounds );
    1392                 :            : 
    1393         [ +  + ]:     655149 :         if( aLocalDestArea.isEmpty() )
    1394                 :       5119 :             return false;
    1395                 :            : 
    1396                 :            :         // calc relative new dest area points (relative to orig
    1397                 :            :         // source area)
    1398                 :            :         const ::basegfx::B2IVector aDestUpperLeftOffset(
    1399 [ +  - ][ +  - ]:     650030 :             aLocalDestArea.getMinimum()-aDestTopLeft );
    1400                 :            :         const ::basegfx::B2IVector aDestLowerRightOffset(
    1401 [ +  - ][ +  - ]:     650030 :             aLocalDestArea.getMaximum()-aDestTopLeft );
    1402                 :            : 
    1403                 :     650030 :         io_rSourceArea = ::basegfx::B2IBox( basegfx::fround(aSourceTopLeft.getX() + aDestUpperLeftOffset.getX()/nScaleX),
    1404                 :     650030 :                                             basegfx::fround(aSourceTopLeft.getY() + aDestUpperLeftOffset.getY()/nScaleY),
    1405                 :     650030 :                                             basegfx::fround(aSourceTopLeft.getX() + aDestLowerRightOffset.getX()/nScaleX),
    1406         [ +  - ]:    2600120 :                                             basegfx::fround(aSourceTopLeft.getY() + aDestLowerRightOffset.getY()/nScaleY) );
    1407                 :     650030 :         io_rDestArea   = aLocalDestArea;
    1408                 :            : 
    1409                 :            :         // final source area clip (chopping round-offs)
    1410         [ +  - ]:     650030 :         io_rSourceArea.intersect( rSourceBounds );
    1411                 :            : 
    1412         [ -  + ]:     650030 :         if( io_rSourceArea.isEmpty() )
    1413                 :          0 :             return false;
    1414                 :            : 
    1415                 :            : 
    1416                 :     655149 :         return true;
    1417                 :            :     }
    1418                 :            : }
    1419                 :            : 
    1420                 :     649372 : void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
    1421                 :            :                                const basegfx::B2IBox&       rSrcRect,
    1422                 :            :                                const basegfx::B2IBox&       rDstRect,
    1423                 :            :                                DrawMode                     drawMode )
    1424                 :            : {
    1425         [ +  - ]:     649372 :     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
    1426         [ +  - ]:     649372 :     const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
    1427                 :     649372 :     basegfx::B2IBox           aSrcRange( rSrcRect );
    1428                 :     649372 :     basegfx::B2IBox           aDestRange( rDstRect );
    1429                 :            : 
    1430 [ +  + ][ +  - ]:     649372 :     if( clipAreaImpl( aDestRange,
    1431                 :            :                       aSrcRange,
    1432                 :     649372 :                       mpImpl->maBounds,
    1433                 :     649372 :                       aSrcBounds ))
    1434                 :            :     {
    1435                 :     644253 :         assertImageRange(aDestRange,mpImpl->maBounds);
    1436                 :     644253 :         assertImageRange(aSrcRange,aSrcBounds);
    1437                 :            : 
    1438         [ +  - ]:     644253 :         drawBitmap_i( rSrcBitmap, aSrcRange, aDestRange, drawMode );
    1439                 :     649372 :     }
    1440                 :     649372 : }
    1441                 :            : 
    1442                 :     260615 : void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
    1443                 :            :                                const basegfx::B2IBox&       rSrcRect,
    1444                 :            :                                const basegfx::B2IBox&       rDstRect,
    1445                 :            :                                DrawMode                     drawMode,
    1446                 :            :                                const BitmapDeviceSharedPtr& rClip )
    1447                 :            : {
    1448         [ +  + ]:     260615 :     if( !rClip )
    1449                 :            :     {
    1450         [ +  - ]:     257945 :         drawBitmap(rSrcBitmap,rSrcRect,rDstRect,drawMode);
    1451                 :     260615 :         return;
    1452                 :            :     }
    1453                 :            : 
    1454         [ +  - ]:       2670 :     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
    1455         [ +  - ]:       2670 :     const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
    1456                 :       2670 :     basegfx::B2IBox           aSrcRange( rSrcRect );
    1457                 :       2670 :     basegfx::B2IBox           aDestRange( rDstRect );
    1458                 :            : 
    1459 [ +  - ][ +  - ]:       2670 :     if( clipAreaImpl( aDestRange,
    1460                 :            :                       aSrcRange,
    1461                 :       2670 :                       mpImpl->maBounds,
    1462                 :       2670 :                       aSrcBounds ))
    1463                 :            :     {
    1464                 :       2670 :         assertImageRange(aDestRange,mpImpl->maBounds);
    1465                 :       2670 :         assertImageRange(aSrcRange,aSrcBounds);
    1466                 :            : 
    1467 [ +  - ][ +  - ]:       2670 :         if( isCompatibleClipMask( rClip ) )
    1468                 :            :         {
    1469         [ +  - ]:       2670 :             drawBitmap_i( rSrcBitmap, aSrcRange, aDestRange, drawMode, rClip );
    1470                 :            :         }
    1471                 :            :         else
    1472                 :            :         {
    1473                 :            :             getGenericRenderer()->drawBitmap( rSrcBitmap, rSrcRect,
    1474 [ #  # ][ #  # ]:          0 :                                               rDstRect, drawMode, rClip );
                 [ #  # ]
    1475                 :            :         }
    1476                 :     260615 :     }
    1477                 :            : }
    1478                 :            : 
    1479                 :    1789013 : void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
    1480                 :            :                                     const BitmapDeviceSharedPtr& rAlphaMask,
    1481                 :            :                                     const basegfx::B2IBox&       rSrcRect,
    1482                 :            :                                     const basegfx::B2IPoint&     rDstPoint )
    1483                 :            : {
    1484         [ +  - ]:    1789013 :     const basegfx::B2IVector& rSrcSize( rAlphaMask->getSize() );
    1485         [ +  - ]:    1789013 :     const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
    1486                 :    1789013 :     basegfx::B2IBox           aSrcRange( rSrcRect );
    1487                 :    1789013 :     basegfx::B2IPoint         aDestPoint( rDstPoint );
    1488                 :            : 
    1489 [ +  + ][ +  - ]:    1789013 :     if( clipAreaImpl( aSrcRange,
    1490                 :            :                       aDestPoint,
    1491                 :            :                       aSrcBounds,
    1492                 :    1789013 :                       mpImpl->maBounds ))
    1493                 :            :     {
    1494                 :    1584877 :         assertImagePoint(aDestPoint,mpImpl->maBounds);
    1495                 :    1584877 :         assertImageRange(aSrcRange,aSrcBounds);
    1496                 :            : 
    1497         [ -  + ]:    1584877 :         if( rAlphaMask.get() == this )
    1498                 :            :         {
    1499                 :            :             // src == dest, copy rAlphaMask beforehand
    1500                 :            :             // ---------------------------------------------------
    1501                 :            : 
    1502         [ #  # ]:          0 :             const basegfx::B2ITuple aSize( aSrcRange.getWidth(),
    1503         [ #  # ]:          0 :                                            aSrcRange.getHeight() );
    1504                 :            :             BitmapDeviceSharedPtr pAlphaCopy(
    1505                 :            :                 cloneBitmapDevice( aSize,
    1506 [ #  # ][ #  # ]:          0 :                                    shared_from_this()) );
                 [ #  # ]
    1507                 :          0 :             basegfx::B2ITuple aGcc3WorkaroundTemporary;
    1508                 :            :             const basegfx::B2IBox aAlphaRange( aGcc3WorkaroundTemporary,
    1509         [ #  # ]:          0 :                                                aSize );
    1510                 :            :             pAlphaCopy->drawBitmap(rAlphaMask,
    1511                 :            :                                    aSrcRange,
    1512                 :            :                                    aAlphaRange,
    1513         [ #  # ]:          0 :                                    DrawMode_PAINT);
    1514 [ #  # ][ #  # ]:          0 :             drawMaskedColor_i( aSrcColor, pAlphaCopy, aAlphaRange, aDestPoint );
    1515                 :            :         }
    1516                 :            :         else
    1517                 :            :         {
    1518         [ +  - ]:    1584877 :             drawMaskedColor_i( aSrcColor, rAlphaMask, aSrcRange, aDestPoint );
    1519                 :            :         }
    1520                 :    1789013 :     }
    1521                 :    1789013 : }
    1522                 :            : 
    1523                 :    1789190 : void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
    1524                 :            :                                     const BitmapDeviceSharedPtr& rAlphaMask,
    1525                 :            :                                     const basegfx::B2IBox&       rSrcRect,
    1526                 :            :                                     const basegfx::B2IPoint&     rDstPoint,
    1527                 :            :                                     const BitmapDeviceSharedPtr& rClip )
    1528                 :            : {
    1529         [ +  + ]:    1789190 :     if( !rClip )
    1530                 :            :     {
    1531         [ +  - ]:    1788973 :         drawMaskedColor(aSrcColor,rAlphaMask,rSrcRect,rDstPoint);
    1532                 :    1789190 :         return;
    1533                 :            :     }
    1534                 :            : 
    1535         [ +  - ]:        217 :     const basegfx::B2IVector& rSrcSize( rAlphaMask->getSize() );
    1536         [ +  - ]:        217 :     const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
    1537                 :        217 :     basegfx::B2IBox           aSrcRange( rSrcRect );
    1538                 :        217 :     basegfx::B2IPoint         aDestPoint( rDstPoint );
    1539                 :            : 
    1540 [ +  - ][ +  - ]:        217 :     if( clipAreaImpl( aSrcRange,
    1541                 :            :                       aDestPoint,
    1542                 :            :                       aSrcBounds,
    1543                 :        217 :                       mpImpl->maBounds ))
    1544                 :            :     {
    1545                 :        217 :         assertImagePoint(aDestPoint,mpImpl->maBounds);
    1546                 :        217 :         assertImageRange(aSrcRange,aSrcBounds);
    1547                 :            : 
    1548 [ +  - ][ +  - ]:        217 :         if( isCompatibleClipMask( rClip ) )
    1549                 :            :         {
    1550         [ -  + ]:        217 :             if( rAlphaMask.get() == this )
    1551                 :            :             {
    1552                 :            :                 // src == dest, copy rAlphaMask beforehand
    1553                 :            :                 // ---------------------------------------------------
    1554                 :            : 
    1555         [ #  # ]:          0 :                 const basegfx::B2ITuple aSize( aSrcRange.getWidth(),
    1556         [ #  # ]:          0 :                                                aSrcRange.getHeight() );
    1557                 :            :                 BitmapDeviceSharedPtr pAlphaCopy(
    1558                 :            :                     cloneBitmapDevice( aSize,
    1559 [ #  # ][ #  # ]:          0 :                                        shared_from_this()) );
                 [ #  # ]
    1560                 :          0 :                 basegfx::B2ITuple aGcc3WorkaroundTemporary;
    1561                 :            :                 const basegfx::B2IBox aAlphaRange( aGcc3WorkaroundTemporary,
    1562         [ #  # ]:          0 :                                                    aSize );
    1563                 :            :                 pAlphaCopy->drawBitmap(rAlphaMask,
    1564                 :            :                                        aSrcRange,
    1565                 :            :                                        aAlphaRange,
    1566         [ #  # ]:          0 :                                        DrawMode_PAINT);
    1567 [ #  # ][ #  # ]:          0 :                 drawMaskedColor_i( aSrcColor, pAlphaCopy, aAlphaRange, aDestPoint, rClip );
    1568                 :            :             }
    1569                 :            :             else
    1570                 :            :             {
    1571         [ +  - ]:        217 :                 drawMaskedColor_i( aSrcColor, rAlphaMask, aSrcRange, aDestPoint, rClip );
    1572                 :            :             }
    1573                 :            :         }
    1574                 :            :         else
    1575                 :            :         {
    1576                 :            :             getGenericRenderer()->drawMaskedColor( aSrcColor, rAlphaMask,
    1577 [ #  # ][ #  # ]:          0 :                                                    rSrcRect, rDstPoint, rClip );
                 [ #  # ]
    1578                 :            :         }
    1579                 :    1789190 :     }
    1580                 :            : }
    1581                 :            : 
    1582                 :       3105 : void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
    1583                 :            :                                      const BitmapDeviceSharedPtr& rMask,
    1584                 :            :                                      const basegfx::B2IBox&       rSrcRect,
    1585                 :            :                                      const basegfx::B2IBox&       rDstRect,
    1586                 :            :                                      DrawMode                     drawMode )
    1587                 :            : {
    1588                 :            :     OSL_ASSERT( rMask->getSize() == rSrcBitmap->getSize() );
    1589                 :            : 
    1590         [ +  - ]:       3105 :     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
    1591         [ +  - ]:       3105 :     const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
    1592                 :       3105 :     basegfx::B2IBox           aSrcRange( rSrcRect );
    1593                 :       3105 :     basegfx::B2IBox           aDestRange( rDstRect );
    1594                 :            : 
    1595 [ +  - ][ +  - ]:       3105 :     if( clipAreaImpl( aDestRange,
    1596                 :            :                       aSrcRange,
    1597                 :       3105 :                       mpImpl->maBounds,
    1598                 :       3105 :                       aSrcBounds ))
    1599                 :            :     {
    1600                 :       3105 :         assertImageRange(aDestRange,mpImpl->maBounds);
    1601                 :       3105 :         assertImageRange(aSrcRange,aSrcBounds);
    1602                 :            : 
    1603         [ +  - ]:       3105 :         drawMaskedBitmap_i( rSrcBitmap, rMask, aSrcRange, aDestRange, drawMode );
    1604                 :       3105 :     }
    1605                 :       3105 : }
    1606                 :            : 
    1607                 :       3087 : void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
    1608                 :            :                                      const BitmapDeviceSharedPtr& rMask,
    1609                 :            :                                      const basegfx::B2IBox&       rSrcRect,
    1610                 :            :                                      const basegfx::B2IBox&       rDstRect,
    1611                 :            :                                      DrawMode                     drawMode,
    1612                 :            :                                      const BitmapDeviceSharedPtr& rClip )
    1613                 :            : {
    1614         [ +  + ]:       3087 :     if( !rClip )
    1615                 :            :     {
    1616         [ +  - ]:       3085 :         drawMaskedBitmap(rSrcBitmap,rMask,rSrcRect,rDstRect,drawMode);
    1617                 :       3087 :         return;
    1618                 :            :     }
    1619                 :            : 
    1620                 :            :     OSL_ASSERT( rMask->getSize() == rSrcBitmap->getSize() );
    1621                 :            : 
    1622         [ +  - ]:          2 :     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
    1623         [ +  - ]:          2 :     const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
    1624                 :          2 :     basegfx::B2IBox           aSrcRange( rSrcRect );
    1625                 :          2 :     basegfx::B2IBox           aDestRange( rDstRect );
    1626                 :            : 
    1627 [ +  - ][ +  - ]:          2 :     if( clipAreaImpl( aDestRange,
    1628                 :            :                       aSrcRange,
    1629                 :          2 :                       mpImpl->maBounds,
    1630                 :          2 :                       aSrcBounds ))
    1631                 :            :     {
    1632                 :          2 :         assertImageRange(aDestRange,mpImpl->maBounds);
    1633                 :          2 :         assertImageRange(aSrcRange,aSrcBounds);
    1634                 :            : 
    1635 [ +  - ][ +  - ]:          2 :         if( isCompatibleClipMask( rClip ) )
    1636                 :            :         {
    1637         [ +  - ]:          2 :             drawMaskedBitmap_i( rSrcBitmap, rMask, aSrcRange, aDestRange, drawMode, rClip );
    1638                 :            :         }
    1639                 :            :         else
    1640                 :            :         {
    1641                 :            :             getGenericRenderer()->drawMaskedBitmap( rSrcBitmap, rMask, rSrcRect,
    1642 [ #  # ][ #  # ]:          0 :                                                     rDstRect, drawMode, rClip );
                 [ #  # ]
    1643                 :            :         }
    1644                 :       3087 :     }
    1645                 :            : }
    1646                 :            : 
    1647                 :            : 
    1648                 :            : //----------------------------------------------------------------------------------
    1649                 :            : 
    1650                 :            : /** Standard clip and alpha masks
    1651                 :            :  */
    1652                 :            : struct StdMasks
    1653                 :            : {
    1654                 :            :     typedef PixelFormatTraits_GREY1_MSB   clipmask_format_traits;
    1655                 :            :     typedef PixelFormatTraits_GREY8       alphamask_format_traits;
    1656                 :            : 
    1657                 :            :     /// Clipmask: 0 means opaque
    1658                 :            :     static const bool clipmask_polarity  = false;
    1659                 :            : 
    1660                 :            :     /// Alpha mask: 0 means fully transparent
    1661                 :            :     static const bool alphamask_polarity = true;
    1662                 :            : };
    1663                 :            : 
    1664                 :            : //----------------------------------------------------------------------------------
    1665                 :            : 
    1666                 :            : // Some compilers don't like the nested template wrap_accessor
    1667                 :            : // reference in the parameter list - being slightly less type safe,
    1668                 :            : // then.
    1669                 :            : #ifndef BASEBMP_NO_NESTED_TEMPLATE_PARAMETER
    1670                 :            : 
    1671                 :            : /// Produces a specialized renderer for the given pixel format
    1672                 :            : template< class FormatTraits, class MaskTraits >
    1673                 :    3162490 : BitmapDeviceSharedPtr createRenderer(
    1674                 :            :     const basegfx::B2IBox&                                       rBounds,
    1675                 :            :     sal_Int32                                                    nScanlineFormat,
    1676                 :            :     sal_Int32                                                    nScanlineStride,
    1677                 :            :     sal_uInt8*                                                   pFirstScanline,
    1678                 :            :     typename FormatTraits::raw_accessor_type const&              rRawAccessor,
    1679                 :            :     typename FormatTraits::accessor_selector::template wrap_accessor<
    1680                 :            :           typename FormatTraits::raw_accessor_type>::type const& rAccessor,
    1681                 :            :     boost::shared_array< sal_uInt8 >                             pMem,
    1682                 :            :     const PaletteMemorySharedVector&                             pPal,
    1683                 :            :     const IBitmapDeviceDamageTrackerSharedPtr&                   pDamage )
    1684                 :            : #else
    1685                 :            : 
    1686                 :            : template< class FormatTraits, class MaskTraits, class Accessor >
    1687                 :            : BitmapDeviceSharedPtr createRenderer(
    1688                 :            :     const basegfx::B2IBox&                                       rBounds,
    1689                 :            :     sal_Int32                                                    nScanlineFormat,
    1690                 :            :     sal_Int32                                                    nScanlineStride,
    1691                 :            :     sal_uInt8*                                                   pFirstScanline,
    1692                 :            :     typename FormatTraits::raw_accessor_type const&              rRawAccessor,
    1693                 :            :     Accessor const&                                              rAccessor,
    1694                 :            :     boost::shared_array< sal_uInt8 >                             pMem,
    1695                 :            :     const PaletteMemorySharedVector&                             pPal,
    1696                 :            :     const IBitmapDeviceDamageTrackerSharedPtr&                   pDamage )
    1697                 :            : 
    1698                 :            : #endif
    1699                 :            : {
    1700                 :            :     typedef typename FormatTraits::iterator_type                Iterator;
    1701                 :            :     typedef BitmapRenderer< Iterator,
    1702                 :            :                             typename FormatTraits::raw_accessor_type,
    1703                 :            :                             typename FormatTraits::accessor_selector,
    1704                 :            :                             MaskTraits >                        Renderer;
    1705                 :            : 
    1706                 :            :     return BitmapDeviceSharedPtr(
    1707                 :            :         new Renderer( rBounds,
    1708                 :            :                       nScanlineFormat,
    1709                 :            :                       nScanlineStride,
    1710                 :            :                       pFirstScanline,
    1711                 :            :                       Iterator(
    1712                 :            :                           reinterpret_cast<typename Iterator::value_type*>(
    1713                 :            :                               pFirstScanline),
    1714                 :            :                           nScanlineStride),
    1715                 :            :                       rRawAccessor,
    1716                 :            :                       rAccessor,
    1717                 :            :                       pMem,
    1718                 :            :                       pPal,
    1719 [ #  # ][ #  # ]:    3162490 :                       pDamage ));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
    1720                 :            : }
    1721                 :            : 
    1722                 :            : /// Create standard grey level palette
    1723                 :     295128 : PaletteMemorySharedVector createStandardPalette(
    1724                 :            :     const PaletteMemorySharedVector& pPal,
    1725                 :            :     sal_Int32                        nNumEntries )
    1726                 :            : {
    1727 [ +  + ][ -  + ]:     295128 :     if( pPal || nNumEntries <= 0 )
                 [ +  + ]
    1728         [ +  - ]:     294948 :         return pPal;
    1729                 :            : 
    1730                 :            :     boost::shared_ptr< std::vector<Color> > pLocalPal(
    1731 [ +  - ][ +  - ]:        180 :         new std::vector<Color>(nNumEntries) );
                 [ +  - ]
    1732                 :            : 
    1733                 :        180 :     const sal_Int32 nIncrement( 0x00FFFFFF/nNumEntries );
    1734                 :        180 :     --nNumEntries;
    1735         [ +  + ]:        360 :     for( sal_Int32 i=0, c=0; i<nNumEntries; ++i,c+=nIncrement )
    1736         [ +  - ]:        180 :         pLocalPal->at(i) = Color(0xFF000000 | c);
    1737                 :            : 
    1738         [ +  - ]:        180 :     pLocalPal->at(nNumEntries) = Color(0xFFFFFFFF);
    1739                 :            : 
    1740 [ +  - ][ +  - ]:     295128 :     return pLocalPal;
    1741                 :            : }
    1742                 :            : 
    1743                 :            : template< class FormatTraits, class MaskTraits >
    1744                 :    2867362 : BitmapDeviceSharedPtr createRenderer(
    1745                 :            :     const basegfx::B2IBox&                     rBounds,
    1746                 :            :     sal_Int32                                  nScanlineFormat,
    1747                 :            :     sal_Int32                                  nScanlineStride,
    1748                 :            :     sal_uInt8*                                 pFirstScanline,
    1749                 :            :     boost::shared_array< sal_uInt8 >           pMem,
    1750                 :            :     const PaletteMemorySharedVector&           pPal,
    1751                 :            :     const IBitmapDeviceDamageTrackerSharedPtr& pDamage )
    1752                 :            : {
    1753                 :            :     return createRenderer<FormatTraits,
    1754                 :            :                           MaskTraits>(rBounds,
    1755                 :            :                                       nScanlineFormat,
    1756                 :            :                                       nScanlineStride,
    1757                 :            :                                       pFirstScanline,
    1758                 :            :                                       typename FormatTraits::raw_accessor_type(),
    1759                 :            :                                       typename FormatTraits::accessor_selector::template
    1760                 :            :                                       wrap_accessor<
    1761                 :            :                                           typename FormatTraits::raw_accessor_type>::type(),
    1762                 :            :                                       pMem,
    1763                 :            :                                       pPal,
    1764 [ #  # ][ #  # ]:    2867362 :                                       pDamage);
         [ #  # ][ +  - ]
         [ +  - ][ #  # ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ +  - ][ +  - ]
    1765                 :            : }
    1766                 :            : 
    1767                 :            : template< class FormatTraits, class MaskTraits >
    1768                 :     295128 : BitmapDeviceSharedPtr createRenderer(
    1769                 :            :     const basegfx::B2IBox&                     rBounds,
    1770                 :            :     sal_Int32                                  nScanlineFormat,
    1771                 :            :     sal_Int32                                  nScanlineStride,
    1772                 :            :     sal_uInt8*                                 pFirstScanline,
    1773                 :            :     boost::shared_array< sal_uInt8 >           pMem,
    1774                 :            :     PaletteMemorySharedVector                  pPal,
    1775                 :            :     int                                        nBitsPerPixel,
    1776                 :            :     const IBitmapDeviceDamageTrackerSharedPtr& pDamage )
    1777                 :            : {
    1778 [ +  - ][ #  # ]:     295128 :     pPal = createStandardPalette(pPal,
         [ +  - ][ +  - ]
                 [ +  - ]
    1779                 :            :                                  1UL << nBitsPerPixel);
    1780                 :            : 
    1781                 :            :     OSL_ASSERT(pPal);
    1782                 :            :     return createRenderer<FormatTraits,
    1783                 :            :                           MaskTraits>(rBounds,
    1784                 :            :                                       nScanlineFormat,
    1785                 :            :                                       nScanlineStride,
    1786                 :            :                                       pFirstScanline,
    1787                 :            :                                       typename FormatTraits::raw_accessor_type(),
    1788                 :            :                                       typename FormatTraits::accessor_selector::template
    1789                 :            :                                           wrap_accessor<
    1790                 :            :                                       typename FormatTraits::raw_accessor_type>::type(
    1791                 :            :                                           &pPal->at(0),
    1792                 :            :                                           pPal->size()),
    1793                 :            :                                       pMem,
    1794                 :            :                                       pPal,
    1795 [ +  - ][ #  # ]:     295128 :                                       pDamage);
         [ #  # ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
    1796                 :            : }
    1797                 :            : 
    1798                 :            : //----------------------------------------------------------------------------------
    1799                 :            : 
    1800                 :            : // TODO(Q3): consolidate with canvas/canvastools.hxx! Best move this
    1801                 :            : // to o3tl or sal/bithacks.hxx ...
    1802                 :            : 
    1803                 :            : /** Compute the next highest power of 2 of a 32-bit value
    1804                 :            : 
    1805                 :            :     Code devised by Sean Anderson, in good ole HAKMEM
    1806                 :            :     tradition.
    1807                 :            : 
    1808                 :            :     @return 1 << (lg(x - 1) + 1)
    1809                 :            : */
    1810                 :    3162495 : inline sal_uInt32 nextPow2( sal_uInt32 x )
    1811                 :            : {
    1812                 :    3162495 :     --x;
    1813                 :    3162495 :     x |= x >> 1;
    1814                 :    3162495 :     x |= x >> 2;
    1815                 :    3162495 :     x |= x >> 4;
    1816                 :    3162495 :     x |= x >> 8;
    1817                 :    3162495 :     x |= x >> 16;
    1818                 :            : 
    1819                 :    3162495 :     return ++x;
    1820                 :            : }
    1821                 :            : 
    1822                 :            : //----------------------------------------------------------------------------------
    1823                 :            : 
    1824                 :            : namespace
    1825                 :            : {
    1826                 :    3162495 : BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector&                  rSize,
    1827                 :            :                                               bool                                       bTopDown,
    1828                 :            :                                               sal_Int32                                  nScanlineFormat,
    1829                 :            :                                               boost::shared_array< sal_uInt8 >           pMem,
    1830                 :            :                                               PaletteMemorySharedVector                  pPal,
    1831                 :            :                                               const basegfx::B2IBox*                     pSubset,
    1832                 :            :                                               const IBitmapDeviceDamageTrackerSharedPtr& rDamage )
    1833                 :            : {
    1834                 :            :     OSL_ASSERT(rSize.getX() > 0 && rSize.getY() > 0);
    1835                 :            : 
    1836 [ +  - ][ -  + ]:    3162495 :     if( nScanlineFormat <= Format::NONE ||
    1837                 :            :         nScanlineFormat >  Format::MAX )
    1838         [ #  # ]:          0 :         return BitmapDeviceSharedPtr();
    1839                 :            : 
    1840                 :            :     static const sal_uInt8 bitsPerPixel[] =
    1841                 :            :     {
    1842                 :            :         0,  // NONE
    1843                 :            :         1,  // ONE_BIT_MSB_GREY
    1844                 :            :         1,  // ONE_BIT_LSB_GREY
    1845                 :            :         1,  // ONE_BIT_MSB_PAL
    1846                 :            :         1,  // ONE_BIT_LSB_PAL
    1847                 :            :         4,  // FOUR_BIT_MSB_GREY
    1848                 :            :         4,  // FOUR_BIT_LSB_GREY
    1849                 :            :         4,  // FOUR_BIT_MSB_PAL
    1850                 :            :         4,  // FOUR_BIT_LSB_PAL
    1851                 :            :         8,  // EIGHT_BIT_PAL
    1852                 :            :         8,  // EIGHT_BIT_GREY
    1853                 :            :         16, // SIXTEEN_BIT_LSB_TC_MASK
    1854                 :            :         16, // SIXTEEN_BIT_MSB_TC_MASK
    1855                 :            :         24, // TWENTYFOUR_BIT_TC_MASK
    1856                 :            :         32, // THIRTYTWO_BIT_TC_MASK_BGRA
    1857                 :            :         32, // THIRTYTWO_BIT_TC_MASK_ARGB
    1858                 :            :         32, // THIRTYTWO_BIT_TC_MASK_ABGR
    1859                 :            :         32, // THIRTYTWO_BIT_TC_MASK_RGBA
    1860                 :            :    };
    1861                 :            : 
    1862                 :    3162495 :     sal_Int32  nScanlineStride(0);
    1863                 :            : 
    1864                 :            :     // round up to full 8 bit, divide by 8
    1865                 :    3162495 :     nScanlineStride = (rSize.getX()*bitsPerPixel[nScanlineFormat] + 7) >> 3;
    1866                 :            : 
    1867                 :            :     // rounded up to next full power-of-two number of bytes
    1868                 :            :     const sal_uInt32 bytesPerPixel = nextPow2(
    1869                 :    3162495 :         (bitsPerPixel[nScanlineFormat] + 7) >> 3);
    1870                 :            : 
    1871                 :            :     // now make nScanlineStride a multiple of bytesPerPixel
    1872                 :    3162495 :     nScanlineStride = (nScanlineStride + bytesPerPixel - 1) / bytesPerPixel * bytesPerPixel;
    1873                 :            : 
    1874                 :            :     // factor in bottom-up scanline order case
    1875         [ +  + ]:    3162495 :     nScanlineStride *= bTopDown ? 1 : -1;
    1876                 :            : 
    1877                 :    3162495 :     const sal_uInt32 nWidth(nScanlineStride < 0 ? -nScanlineStride : nScanlineStride);
    1878                 :    3162495 :     const sal_uInt32 nHeight(rSize.getY());
    1879                 :            : 
    1880 [ +  - ][ +  + ]:    3162495 :     if (nHeight && nWidth && nWidth > SAL_MAX_INT32 / nHeight)
                 [ +  + ]
    1881                 :            :     {
    1882                 :            :         SAL_WARN( "basebmp", "suspicious massive alloc " << nWidth << " * " << nHeight);
    1883         [ +  - ]:          5 :         return BitmapDeviceSharedPtr();
    1884                 :            :     }
    1885                 :            : 
    1886                 :    3162490 :     const std::size_t nMemSize(nWidth * nHeight);
    1887                 :            : 
    1888         [ +  + ]:    3162490 :     if( !pMem )
    1889                 :            :     {
    1890                 :            :         pMem.reset(
    1891                 :     857751 :             reinterpret_cast<sal_uInt8*>(rtl_allocateMemory( nMemSize )),
    1892         [ +  - ]:     857751 :             &rtl_freeMemory );
    1893 [ +  + ][ -  + ]:     857751 :         if (pMem.get() == 0 && nMemSize != 0)
                 [ -  + ]
    1894         [ #  # ]:          0 :             return BitmapDeviceSharedPtr();
    1895         [ +  - ]:     857751 :         rtl_zeroMemory(pMem.get(),nMemSize);
    1896                 :            :     }
    1897                 :            : 
    1898                 :            :     sal_uInt8* pFirstScanline = nScanlineStride < 0 ?
    1899         [ +  + ]:    3162490 :         pMem.get() + nMemSize + nScanlineStride : pMem.get();
    1900                 :            : 
    1901                 :            :     // shrink render area to given subset, if given
    1902         [ +  - ]:    3162490 :     basegfx::B2IBox aBounds(0,0,rSize.getX(),rSize.getY());
    1903         [ +  + ]:    3162490 :     if( pSubset )
    1904         [ +  - ]:     380725 :         aBounds.intersect( *pSubset );
    1905                 :            : 
    1906   [ +  +  +  +  :    3162490 :     switch( nScanlineFormat )
          -  -  +  -  +  
          +  +  -  +  +  
             -  -  -  - ]
    1907                 :            :     {
    1908                 :            :         // ----------------------------------------------------------------------
    1909                 :            :         // one bit formats
    1910                 :            : 
    1911                 :            :         case Format::ONE_BIT_MSB_GREY:
    1912                 :            :             return createRenderer<PixelFormatTraits_GREY1_MSB,StdMasks>(
    1913                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1914 [ +  - ][ +  - ]:      24838 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ +  - ]
    1915                 :            : 
    1916                 :            :         case Format::ONE_BIT_LSB_GREY:
    1917                 :            :             return createRenderer<PixelFormatTraits_GREY1_LSB,StdMasks>(
    1918                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1919 [ +  - ][ +  - ]:          5 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ +  - ]
    1920                 :            : 
    1921                 :            :         case Format::ONE_BIT_MSB_PAL:
    1922                 :            :             return createRenderer<PixelFormatTraits_PAL1_MSB,StdMasks>(
    1923                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1924                 :            :                 pFirstScanline, pMem, pPal,
    1925 [ +  - ][ +  - ]:      21562 :                 bitsPerPixel[nScanlineFormat], rDamage );
         [ +  - ][ +  - ]
                 [ +  - ]
    1926                 :            : 
    1927                 :            :         case Format::ONE_BIT_LSB_PAL:
    1928                 :            :             return createRenderer<PixelFormatTraits_PAL1_LSB,StdMasks>(
    1929                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1930                 :            :                 pFirstScanline, pMem, pPal,
    1931 [ +  - ][ +  - ]:          5 :                 bitsPerPixel[nScanlineFormat], rDamage );
         [ +  - ][ +  - ]
                 [ +  - ]
    1932                 :            : 
    1933                 :            : 
    1934                 :            :         // ----------------------------------------------------------------------
    1935                 :            :         // four bit formats
    1936                 :            : 
    1937                 :            :         case Format::FOUR_BIT_MSB_GREY:
    1938                 :            :             return createRenderer<PixelFormatTraits_GREY4_MSB,StdMasks>(
    1939                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1940 [ #  # ][ #  # ]:          0 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ #  # ]
    1941                 :            : 
    1942                 :            :         case Format::FOUR_BIT_LSB_GREY:
    1943                 :            :             return createRenderer<PixelFormatTraits_GREY4_LSB,StdMasks>(
    1944                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1945 [ #  # ][ #  # ]:          0 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ #  # ]
    1946                 :            : 
    1947                 :            :         case Format::FOUR_BIT_MSB_PAL:
    1948                 :            :             return createRenderer<PixelFormatTraits_PAL4_MSB,StdMasks>(
    1949                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1950                 :            :                 pFirstScanline, pMem, pPal,
    1951 [ +  - ][ +  - ]:       1050 :                 bitsPerPixel[nScanlineFormat], rDamage );
         [ +  - ][ +  - ]
                 [ +  - ]
    1952                 :            : 
    1953                 :            :         case Format::FOUR_BIT_LSB_PAL:
    1954                 :            :             return createRenderer<PixelFormatTraits_PAL4_LSB,StdMasks>(
    1955                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1956                 :            :                 pFirstScanline, pMem, pPal,
    1957 [ #  # ][ #  # ]:          0 :                 bitsPerPixel[nScanlineFormat], rDamage );
         [ #  # ][ #  # ]
                 [ #  # ]
    1958                 :            : 
    1959                 :            : 
    1960                 :            :         // ----------------------------------------------------------------------
    1961                 :            :         // eight bit formats
    1962                 :            : 
    1963                 :            :         case Format::EIGHT_BIT_GREY:
    1964                 :            :             return createRenderer<PixelFormatTraits_GREY8,StdMasks>(
    1965                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1966 [ +  - ][ +  - ]:    1789200 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ +  - ]
    1967                 :            : 
    1968                 :            :         case Format::EIGHT_BIT_PAL:
    1969                 :            :             return createRenderer<PixelFormatTraits_PAL8,StdMasks>(
    1970                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1971                 :            :                 pFirstScanline, pMem, pPal,
    1972 [ +  - ][ +  - ]:     272511 :                 bitsPerPixel[nScanlineFormat], rDamage );
         [ +  - ][ +  - ]
                 [ +  - ]
    1973                 :            : 
    1974                 :            : 
    1975                 :            :         // ----------------------------------------------------------------------
    1976                 :            :         // sixteen bit formats
    1977                 :            : 
    1978                 :            :         case Format::SIXTEEN_BIT_LSB_TC_MASK:
    1979                 :            :             return createRenderer<PixelFormatTraits_RGB16_565_LSB,StdMasks>(
    1980                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1981 [ +  - ][ +  - ]:          5 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ +  - ]
    1982                 :            : 
    1983                 :            :         case Format::SIXTEEN_BIT_MSB_TC_MASK:
    1984                 :            :             return createRenderer<PixelFormatTraits_RGB16_565_MSB,StdMasks>(
    1985                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1986 [ #  # ][ #  # ]:          0 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ #  # ]
    1987                 :            : 
    1988                 :            : 
    1989                 :            :         // ----------------------------------------------------------------------
    1990                 :            :         // twentyfour bit formats
    1991                 :            :         case Format::TWENTYFOUR_BIT_TC_MASK:
    1992                 :            :             return createRenderer<PixelFormatTraits_BGR24,StdMasks>(
    1993                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    1994 [ +  - ][ +  - ]:    1053139 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ +  - ]
    1995                 :            : 
    1996                 :            : 
    1997                 :            :         // ----------------------------------------------------------------------
    1998                 :            :         // thirtytwo bit formats
    1999                 :            : 
    2000                 :            :         case Format::THIRTYTWO_BIT_TC_MASK_BGRA:
    2001                 :            :             return createRenderer<PixelFormatTraits_BGRX32_8888,StdMasks>(
    2002                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    2003 [ +  - ][ +  - ]:        175 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ +  - ]
    2004                 :            : 
    2005                 :            :         case Format::THIRTYTWO_BIT_TC_MASK_ARGB:
    2006                 :            :             return createRenderer<PixelFormatTraits_XRGB32_8888,StdMasks>(
    2007                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    2008 [ #  # ][ #  # ]:          0 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ #  # ]
    2009                 :            : 
    2010                 :            :         case Format::THIRTYTWO_BIT_TC_MASK_ABGR:
    2011                 :            :             return createRenderer<PixelFormatTraits_XBGR32_8888,StdMasks>(
    2012                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    2013 [ #  # ][ #  # ]:          0 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ #  # ]
    2014                 :            : 
    2015                 :            :         case Format::THIRTYTWO_BIT_TC_MASK_RGBA:
    2016                 :            :             return createRenderer<PixelFormatTraits_RGBX32_8888,StdMasks>(
    2017                 :            :                 aBounds, nScanlineFormat, nScanlineStride,
    2018 [ #  # ][ #  # ]:          0 :                 pFirstScanline, pMem, pPal, rDamage );
                 [ #  # ]
    2019                 :            :     }
    2020                 :            : 
    2021                 :            :     // TODO(F3): other formats not yet implemented
    2022         [ #  # ]:    3162495 :     return BitmapDeviceSharedPtr();
    2023                 :            : }
    2024                 :            : } // namespace
    2025                 :            : 
    2026                 :            : 
    2027                 :     310787 : BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize,
    2028                 :            :                                           bool                      bTopDown,
    2029                 :            :                                           sal_Int32                 nScanlineFormat )
    2030                 :            : {
    2031                 :            :     return createBitmapDeviceImpl( rSize,
    2032                 :            :                                    bTopDown,
    2033                 :            :                                    nScanlineFormat,
    2034                 :            :                                    boost::shared_array< sal_uInt8 >(),
    2035                 :            :                                    PaletteMemorySharedVector(),
    2036                 :            :                                    NULL,
    2037 [ +  - ][ +  - ]:     310787 :                                    IBitmapDeviceDamageTrackerSharedPtr() );
         [ +  - ][ +  - ]
                 [ +  - ]
    2038                 :            : }
    2039                 :            : 
    2040                 :      13258 : BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector&        rSize,
    2041                 :            :                                           bool                             bTopDown,
    2042                 :            :                                           sal_Int32                        nScanlineFormat,
    2043                 :            :                                           const PaletteMemorySharedVector& rPalette )
    2044                 :            : {
    2045                 :            :     return createBitmapDeviceImpl( rSize,
    2046                 :            :                                    bTopDown,
    2047                 :            :                                    nScanlineFormat,
    2048                 :            :                                    boost::shared_array< sal_uInt8 >(),
    2049                 :            :                                    rPalette,
    2050                 :            :                                    NULL,
    2051 [ +  - ][ +  - ]:      13258 :                                    IBitmapDeviceDamageTrackerSharedPtr() );
         [ +  - ][ +  - ]
                 [ +  - ]
    2052                 :            : }
    2053                 :            : 
    2054                 :    2036944 : BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector&        rSize,
    2055                 :            :                                           bool                             bTopDown,
    2056                 :            :                                           sal_Int32                        nScanlineFormat,
    2057                 :            :                                           const RawMemorySharedArray&      rMem,
    2058                 :            :                                           const PaletteMemorySharedVector& rPalette )
    2059                 :            : {
    2060                 :            :     return createBitmapDeviceImpl( rSize,
    2061                 :            :                                    bTopDown,
    2062                 :            :                                    nScanlineFormat,
    2063                 :            :                                    rMem,
    2064                 :            :                                    rPalette,
    2065                 :            :                                    NULL,
    2066 [ +  - ][ +  - ]:    2036944 :                                    IBitmapDeviceDamageTrackerSharedPtr() );
         [ +  - ][ +  - ]
                 [ +  - ]
    2067                 :            : }
    2068                 :            : 
    2069                 :     380725 : BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto,
    2070                 :            :                                           const basegfx::B2IBox&       rSubset )
    2071                 :            : {
    2072                 :            :     return createBitmapDeviceImpl( rProto->getSize(),
    2073         [ +  - ]:     380725 :                                    rProto->isTopDown(),
    2074                 :            :                                    rProto->getScanlineFormat(),
    2075                 :            :                                    rProto->getBuffer(),
    2076                 :            :                                    rProto->getPalette(),
    2077                 :            :                                    &rSubset,
    2078 [ +  - ][ +  - ]:     761450 :                                    rProto->getDamageTracker() );
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
    2079                 :            : }
    2080                 :            : 
    2081                 :     420781 : BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector&    rSize,
    2082                 :            :                                          const BitmapDeviceSharedPtr& rProto )
    2083                 :            : {
    2084                 :            :     return createBitmapDeviceImpl( rSize,
    2085         [ +  - ]:     420781 :                                    rProto->isTopDown(),
    2086                 :            :                                    rProto->getScanlineFormat(),
    2087                 :            :                                    boost::shared_array< sal_uInt8 >(),
    2088                 :            :                                    rProto->getPalette(),
    2089                 :            :                                    NULL,
    2090 [ +  - ][ +  - ]:     841562 :                                    rProto->getDamageTracker() );
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
    2091                 :            : }
    2092                 :            : 
    2093                 :            : //----------------------------------------------------------------------------------
    2094                 :            : 
    2095                 :            : /// Clone our device, with GenericImageAccessor to handle all formats
    2096                 :          0 : BitmapDeviceSharedPtr BitmapDevice::getGenericRenderer() const
    2097                 :            : {
    2098                 :          0 :     return mpImpl->mpGenericRenderer;
    2099                 :            : }
    2100                 :            : 
    2101                 :            : } // namespace basebmp
    2102                 :            : 
    2103                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10