LCOV - code coverage report
Current view: top level - eq - frame.cpp (source / functions) Hit Total Coverage
Test: Equalizer Lines: 38 76 50.0 %
Date: 2017-12-16 05:07:20 Functions: 16 27 59.3 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2006-2017, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                          Daniel Nachbaur <danielnachbaur@gmail.com>
       4             :  *
       5             :  * This library is free software; you can redistribute it and/or modify it under
       6             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       7             :  * by the Free Software Foundation.
       8             :  *
       9             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      10             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      11             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      12             :  * details.
      13             :  *
      14             :  * You should have received a copy of the GNU Lesser General Public License
      15             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      16             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      17             :  */
      18             : 
      19             : #include "frame.h"
      20             : 
      21             : #include "frameData.h"
      22             : #include "image.h"
      23             : #include <eq/util/objectManager.h>
      24             : 
      25             : namespace eq
      26             : {
      27             : namespace detail
      28             : {
      29             : class Frame
      30             : {
      31             : public:
      32             :     FrameDataPtr frameData;
      33             : 
      34             :     ZoomFilter zoomFilter; // texture filter
      35             : 
      36           3 :     Frame()
      37           3 :         : zoomFilter(FILTER_LINEAR)
      38             :     {
      39           3 :     }
      40           3 :     ~Frame()
      41           3 :     {
      42           3 :         if (frameData)
      43           1 :             LBDEBUG << "FrameData attached in frame destructor" << std::endl;
      44           3 :     }
      45             : };
      46             : }
      47             : 
      48           3 : Frame::Frame()
      49           3 :     : _impl(new detail::Frame)
      50             : {
      51           3 : }
      52             : 
      53           8 : Frame::~Frame()
      54             : {
      55           3 :     delete _impl;
      56           5 : }
      57             : 
      58           0 : void Frame::setZoomFilter(const ZoomFilter zoomFilter)
      59             : {
      60           0 :     _impl->zoomFilter = zoomFilter;
      61           0 : }
      62             : 
      63           0 : ZoomFilter Frame::getZoomFilter() const
      64             : {
      65           0 :     return _impl->zoomFilter;
      66             : }
      67             : 
      68           5 : void Frame::setFrameData(FrameDataPtr data)
      69             : {
      70           5 :     _impl->frameData = data;
      71           5 : }
      72             : 
      73           3 : FrameDataPtr Frame::getFrameData()
      74             : {
      75           3 :     return _impl->frameData;
      76             : }
      77             : 
      78         193 : ConstFrameDataPtr Frame::getFrameData() const
      79             : {
      80         193 :     return _impl->frameData;
      81             : }
      82             : 
      83           0 : Frame::Buffer Frame::getBuffers() const
      84             : {
      85           0 :     return _impl->frameData->getBuffers();
      86             : }
      87             : 
      88          24 : const Images& Frame::getImages() const
      89             : {
      90          24 :     return _impl->frameData->getImages();
      91             : }
      92             : 
      93           0 : void Frame::clear()
      94             : {
      95           0 :     _impl->frameData->clear();
      96           0 : }
      97             : 
      98           0 : void Frame::deleteGLObjects(util::ObjectManager& om)
      99             : {
     100           0 :     if (_impl->frameData)
     101           0 :         _impl->frameData->deleteGLObjects(om);
     102           0 : }
     103             : 
     104           0 : void Frame::setAlphaUsage(const bool useAlpha)
     105             : {
     106           0 :     if (_impl->frameData)
     107           0 :         _impl->frameData->setAlphaUsage(useAlpha);
     108           0 : }
     109             : 
     110           0 : void Frame::setQuality(const Buffer buffer, const float quality)
     111             : {
     112           0 :     if (_impl->frameData)
     113           0 :         _impl->frameData->setQuality(buffer, quality);
     114           0 : }
     115             : 
     116           0 : void Frame::useCompressor(const Buffer buffer, const uint32_t name)
     117             : {
     118           0 :     if (_impl->frameData)
     119           0 :         _impl->frameData->useCompressor(buffer, name);
     120           0 : }
     121             : 
     122           0 : void Frame::readback(util::ObjectManager& glObjects,
     123             :                      const DrawableConfig& config,
     124             :                      const PixelViewports& regions,
     125             :                      const RenderContext& context)
     126             : {
     127             :     const Images& images =
     128           0 :         _impl->frameData->startReadback(*this, glObjects, config, regions,
     129           0 :                                         context);
     130           0 :     for (Image* image : images)
     131           0 :         image->finishReadback(glObjects.glewGetContext());
     132           0 : }
     133             : 
     134           1 : Images Frame::startReadback(util::ObjectManager& glObjects,
     135             :                             const DrawableConfig& config,
     136             :                             const PixelViewports& regions,
     137             :                             const RenderContext& context)
     138             : {
     139           1 :     return _impl->frameData->startReadback(*this, glObjects, config, regions,
     140           1 :                                            context);
     141             : }
     142             : 
     143           0 : void Frame::setReady()
     144             : {
     145           0 :     _impl->frameData->setReady();
     146           0 : }
     147             : 
     148           1 : bool Frame::isReady() const
     149             : {
     150           1 :     return _impl->frameData->isReady();
     151             : }
     152             : 
     153          21 : void Frame::waitReady(const uint32_t timeout) const
     154             : {
     155          21 :     _impl->frameData->waitReady(timeout);
     156          21 : }
     157             : 
     158           0 : void Frame::disableBuffer(const Buffer buffer)
     159             : {
     160           0 :     _impl->frameData->disableBuffer(buffer);
     161           0 : }
     162             : 
     163           1 : void Frame::addListener(lunchbox::Monitor<uint32_t>& listener)
     164             : {
     165           1 :     _impl->frameData->addListener(listener);
     166           1 : }
     167             : 
     168           1 : void Frame::removeListener(lunchbox::Monitor<uint32_t>& listener)
     169             : {
     170           1 :     _impl->frameData->removeListener(listener);
     171           1 : }
     172          30 : }

Generated by: LCOV version 1.11