LCOV - code coverage report
Current view: top level - eq/server - configUpdateDataVisitor.cpp (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 30 30 100.0 %
Date: 2014-06-18 Functions: 10 10 100.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2008-2013, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *
       4             :  * This library is free software; you can redistribute it and/or modify it under
       5             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       6             :  * by the Free Software Foundation.
       7             :  *
       8             :  * This library is distributed in the hope that it will be useful, but WITHOUT
       9             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      10             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      11             :  * details.
      12             :  *
      13             :  * You should have received a copy of the GNU Lesser General Public License
      14             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      15             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      16             :  */
      17             : 
      18             : #include "configUpdateDataVisitor.h"
      19             : 
      20             : #include "channel.h"
      21             : #include "node.h"
      22             : #include "pipe.h"
      23             : #include "view.h"
      24             : #include "window.h"
      25             : 
      26             : namespace eq
      27             : {
      28             : namespace server
      29             : {
      30           5 : ConfigUpdateDataVisitor::ConfigUpdateDataVisitor()
      31             :     : _lastDrawChannel( 0 )
      32             :     , _lastDrawWindow( 0 )
      33           5 :     , _lastDrawPipe( 0 )
      34           5 : {}
      35             : 
      36             : 
      37           5 : VisitorResult ConfigUpdateDataVisitor::visitPre( Node* )
      38             : {
      39           5 :     _lastDrawPipe = 0;
      40           5 :     return TRAVERSE_CONTINUE;
      41             : }
      42           5 : VisitorResult ConfigUpdateDataVisitor::visitPost( Node* node )
      43             : {
      44           5 :     node->setLastDrawPipe( _lastDrawPipe );
      45           5 :     return TRAVERSE_CONTINUE;
      46             : }
      47             : 
      48           7 : VisitorResult ConfigUpdateDataVisitor::visitPre( Pipe* )
      49             : {
      50           7 :     _lastDrawWindow = 0;
      51           7 :     return TRAVERSE_CONTINUE;
      52             : }
      53           7 : VisitorResult ConfigUpdateDataVisitor::visitPost( Pipe* pipe )
      54             : {
      55           7 :     pipe->setLastDrawWindow( _lastDrawWindow );
      56           7 :     if( _lastDrawWindow )
      57           5 :         _lastDrawPipe = pipe;
      58           7 :     return TRAVERSE_CONTINUE;
      59             : }
      60             : 
      61           7 : VisitorResult ConfigUpdateDataVisitor::visitPre( Window* )
      62             : {
      63           7 :     _lastDrawChannel = 0;
      64           7 :     return TRAVERSE_CONTINUE;
      65             : }
      66           7 : VisitorResult ConfigUpdateDataVisitor::visitPost( Window* window )
      67             : {
      68           7 :     window->setLastDrawChannel( _lastDrawChannel );
      69           7 :     if( _lastDrawChannel )
      70           5 :         _lastDrawWindow = window;
      71           7 :     return TRAVERSE_CONTINUE;
      72             : }
      73             : 
      74          24 : VisitorResult ConfigUpdateDataVisitor::visit( Channel* channel )
      75             : {
      76          24 :     if( channel->getLastDrawCompound( ))
      77           5 :         _lastDrawChannel = channel;
      78             : 
      79          24 :     return TRAVERSE_CONTINUE;
      80             : }
      81             : 
      82             : }
      83          27 : }

Generated by: LCOV version 1.10