LCOV - code coverage report
Current view: top level - drawinglayer/source/processor2d - processorfromoutputdevice.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 7 8 87.5 %
Date: 2012-08-25 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 9 16 56.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                 :            : 
      21                 :            : #include <vcl/outdev.hxx>
      22                 :            : #include <basegfx/matrix/b2dhommatrix.hxx>
      23                 :            : #include <basegfx/range/b2drange.hxx>
      24                 :            : #include <vcl/gdimtf.hxx>
      25                 :            : #include <basegfx/tools/canvastools.hxx>
      26                 :            : #include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
      27                 :            : #include <drawinglayer/processor2d/vclmetafileprocessor2d.hxx>
      28                 :            : #include <drawinglayer/processor2d/vclpixelprocessor2d.hxx>
      29                 :            : #include <drawinglayer/processor2d/canvasprocessor.hxx>
      30                 :            : #include <vcl/window.hxx>
      31                 :            : 
      32                 :            : //////////////////////////////////////////////////////////////////////////////
      33                 :            : 
      34                 :            : using namespace com::sun::star;
      35                 :            : 
      36                 :            : //////////////////////////////////////////////////////////////////////////////
      37                 :            : 
      38                 :            : namespace drawinglayer
      39                 :            : {
      40                 :            :     namespace processor2d
      41                 :            :     {
      42                 :      46664 :         drawinglayer::processor2d::BaseProcessor2D* createBaseProcessor2DFromOutputDevice(
      43                 :            :             OutputDevice& rTargetOutDev,
      44                 :            :             const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
      45                 :            :         {
      46                 :      46664 :             const GDIMetaFile* pMetaFile = rTargetOutDev.GetConnectMetaFile();
      47 [ +  - ][ +  - ]:      46664 :             const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
                 [ +  + ]
      48                 :            : 
      49         [ +  + ]:      46664 :             if(bOutputToRecordingMetaFile)
      50                 :            :             {
      51                 :            :                 // create MetaFile Vcl-Processor and process
      52         [ +  - ]:        145 :                 return new drawinglayer::processor2d::VclMetafileProcessor2D(rViewInformation2D, rTargetOutDev);
      53                 :            :             }
      54                 :            :             else
      55                 :            :             {
      56                 :            : #ifdef WIN32
      57                 :            :                 // for a first AA incarnation VCL-PixelRenderer will be okay since
      58                 :            :                 // simple (and fast) GDIPlus support over VCL will be used.
      59                 :            :                 // Leaving the code below as a hint for what to do when we will
      60                 :            :                 // use canvas renderers in the future
      61                 :            : 
      62                 :            :                 //static SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
      63                 :            : 
      64                 :            :                 //if(false && aSvtOptionsDrawinglayer.IsAntiAliasing())
      65                 :            :                 //{
      66                 :            :                 //  // for WIN32 AA, create cairo canvas processor
      67                 :            :                 //  return new drawinglayer::processor2d::canvasProcessor2D(rViewInformation2D, rTargetOutDev);
      68                 :            :                 //}
      69                 :            :                 //else
      70                 :            :                 //{
      71                 :            :                     // create Pixel Vcl-Processor
      72                 :            :                     return new drawinglayer::processor2d::VclPixelProcessor2D(rViewInformation2D, rTargetOutDev);
      73                 :            :                 //}
      74                 :            : #else
      75                 :            :                 static bool bTryTestCanvas(false);
      76                 :            : 
      77         [ -  + ]:      46519 :                 if(bTryTestCanvas)
      78                 :            :                 {
      79                 :            :                     // create test-cancas-Processor
      80         [ #  # ]:          0 :                     return new drawinglayer::processor2d::canvasProcessor2D(rViewInformation2D, rTargetOutDev);
      81                 :            :                 }
      82                 :            :                 else
      83                 :            :                 {
      84                 :            :                     // create Pixel Vcl-Processor
      85         [ +  - ]:      46664 :                     return new drawinglayer::processor2d::VclPixelProcessor2D(rViewInformation2D, rTargetOutDev);
      86                 :            :                 }
      87                 :            : #endif
      88                 :            :             }
      89                 :            :         }
      90                 :            :     } // end of namespace processor2d
      91                 :            : } // end of namespace drawinglayer
      92                 :            : 
      93                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10