LCOV - code coverage report
Current view: top level - libreoffice/canvas/source/tools - cachedprimitivebase.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 28 0.0 %
Date: 2012-12-27 Functions: 0 8 0.0 %
Legend: Lines: hit not hit

          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             : 
      21             : #include <canvas/debug.hxx>
      22             : #include <canvas/base/cachedprimitivebase.hxx>
      23             : 
      24             : #include <com/sun/star/rendering/RepaintResult.hpp>
      25             : 
      26             : #include <basegfx/matrix/b2dhommatrix.hxx>
      27             : #include <basegfx/tools/canvastools.hxx>
      28             : 
      29             : 
      30             : using namespace ::com::sun::star;
      31             : 
      32             : #define IMPLEMENTATION_NAME "canvas::CachedPrimitiveBase"
      33             : #define SERVICE_NAME "com.sun.star.rendering.CachedBitmap"
      34             : 
      35             : namespace canvas
      36             : {
      37           0 :     CachedPrimitiveBase::CachedPrimitiveBase( const rendering::ViewState&                   rUsedViewState,
      38             :                                               const uno::Reference< rendering::XCanvas >&   rTarget,
      39             :                                               bool                                          bFailForChangedViewTransform ) :
      40             :         CachedPrimitiveBase_Base( m_aMutex ),
      41             :         maUsedViewState( rUsedViewState ),
      42             :         mxTarget( rTarget ),
      43           0 :         mbFailForChangedViewTransform( bFailForChangedViewTransform )
      44             :     {
      45           0 :     }
      46             : 
      47           0 :     CachedPrimitiveBase::~CachedPrimitiveBase()
      48             :     {
      49           0 :     }
      50             : 
      51           0 :     void SAL_CALL CachedPrimitiveBase::disposing()
      52             :     {
      53           0 :         ::osl::MutexGuard aGuard( m_aMutex );
      54             : 
      55           0 :         maUsedViewState.Clip.clear();
      56           0 :         mxTarget.clear();
      57           0 :     }
      58             : 
      59           0 :     sal_Int8 SAL_CALL CachedPrimitiveBase::redraw( const rendering::ViewState& aState ) throw (lang::IllegalArgumentException, uno::RuntimeException)
      60             :     {
      61           0 :         ::basegfx::B2DHomMatrix aUsedTransformation;
      62           0 :         ::basegfx::B2DHomMatrix aNewTransformation;
      63             : 
      64             :         ::basegfx::unotools::homMatrixFromAffineMatrix( aUsedTransformation,
      65           0 :                                                         maUsedViewState.AffineTransform );
      66             :         ::basegfx::unotools::homMatrixFromAffineMatrix( aNewTransformation,
      67           0 :                                                         aState.AffineTransform );
      68             : 
      69           0 :         const bool bSameViewTransforms( aUsedTransformation == aNewTransformation );
      70             : 
      71           0 :         if( mbFailForChangedViewTransform &&
      72           0 :             !bSameViewTransforms )
      73             :         {
      74             :             // differing transformations, don't try to draft the
      75             :             // output, just plain fail here.
      76           0 :             return rendering::RepaintResult::FAILED;
      77             :         }
      78             : 
      79             :         return doRedraw( aState,
      80             :                          maUsedViewState,
      81             :                          mxTarget,
      82           0 :                          bSameViewTransforms );
      83             :     }
      84             : 
      85           0 :     ::rtl::OUString SAL_CALL CachedPrimitiveBase::getImplementationName(  ) throw (uno::RuntimeException)
      86             :     {
      87           0 :         return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
      88             :     }
      89             : 
      90           0 :     sal_Bool SAL_CALL CachedPrimitiveBase::supportsService( const ::rtl::OUString& ServiceName ) throw (uno::RuntimeException)
      91             :     {
      92           0 :         return ServiceName == SERVICE_NAME;
      93             :     }
      94             : 
      95           0 :     uno::Sequence< ::rtl::OUString > SAL_CALL CachedPrimitiveBase::getSupportedServiceNames(  ) throw (uno::RuntimeException)
      96             :     {
      97           0 :         uno::Sequence< ::rtl::OUString > aRet(1);
      98           0 :         aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
      99             : 
     100           0 :         return aRet;
     101             :     }
     102             : }
     103             : 
     104             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10