Line data Source code
1 :
2 : /* Copyright (c) 2007-2016, 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 : #ifndef EQSERVER_CHANNELUPDATEVISITOR_H
19 : #define EQSERVER_CHANNELUPDATEVISITOR_H
20 :
21 : #include "compoundVisitor.h" // base class
22 : #include "types.h"
23 :
24 : #include <eq/fabric/eye.h> // member
25 :
26 : namespace eq
27 : {
28 : namespace server
29 : {
30 :
31 : /** The compound visitor generating the draw tasks for a channel. */
32 : class ChannelUpdateVisitor : public CompoundVisitor
33 : {
34 : public:
35 : ChannelUpdateVisitor( Channel* channel, const uint128_t frameID,
36 : const uint32_t frameNumber );
37 0 : virtual ~ChannelUpdateVisitor() {}
38 :
39 0 : void setEye( const fabric::Eye eye ) { _eye = eye; }
40 :
41 : /** Visit a non-leaf compound on the down traversal. */
42 : virtual VisitorResult visitPre( const Compound* compound );
43 : /** Visit a leaf compound. */
44 : virtual VisitorResult visitLeaf( const Compound* compound );
45 : /** Visit a non-leaf compound on the up traversal. */
46 : virtual VisitorResult visitPost( const Compound* compound );
47 :
48 0 : bool isUpdated() const { return _updated; }
49 :
50 : private:
51 : Channel* _channel;
52 : fabric::Eye _eye;
53 : const uint128_t _frameID;
54 : const uint32_t _frameNumber;
55 : bool _updated;
56 :
57 : bool _skipCompound( const Compound* compound );
58 : void _sendClear( const RenderContext& context );
59 :
60 : void _updateDraw( const Compound* compound,
61 : const RenderContext& context );
62 : void _updateDrawTiles( const Compound* compound,
63 : const RenderContext& context );
64 : void _updateDrawFinish( const Compound* compound ) const;
65 : void _updateFrameRate( const Compound* compound ) const;
66 :
67 : uint32_t _getDrawBuffer( const Compound* compound ) const;
68 : fabric::ColorMask _getDrawBufferMask( const Compound* compound ) const;
69 :
70 : RenderContext _setupRenderContext( const Compound* compound );
71 :
72 : void _updatePostDraw( const Compound* compound,
73 : const fabric::RenderContext& context );
74 : void _updateAssemble( const Compound* compound,
75 : const fabric::RenderContext& context );
76 : void _updateReadback( const Compound* compound,
77 : const fabric::RenderContext& context );
78 : void _updateViewStart( const Compound* compound,
79 : const fabric::RenderContext& context );
80 : void _updateViewFinish( const Compound* compound,
81 : const fabric::RenderContext& context );
82 : };
83 : }
84 : }
85 : #endif // EQSERVER_CONSTCOMPOUNDVISITOR_H
|