Gnash  0.8.10
GnashVaapiImageProxy.h
Go to the documentation of this file.
00001 // GnashVaapiImageProxy.h: GnashVaapiImage proxy class used for delayed rendering
00002 // 
00003 //   Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
00004 //   Free Software Foundation, Inc.
00005 // 
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 3 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU General Public License
00017 // along with this program; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 //
00020 
00021 #ifndef GNASH_GNASHVAAPIIMAGEPROXY_H
00022 #define GNASH_GNASHVAAPIIMAGEPROXY_H
00023 
00024 #include <boost/shared_ptr.hpp>
00025 
00026 namespace gnash {
00027 
00028 // Forward declarations
00029 class GnashVaapiImage;
00030 class VaapiSurface;
00031 
00034 class DSOEXPORT GnashVaapiImageProxy
00035 {
00036     /* XXX: Should Renderers use boost::shared_ptr<> we could simple
00037        derive from a GnashImageProxy base that would itself contain a
00038        shared pointer to the image */
00039     boost::shared_ptr<VaapiSurface> _surface;
00040 
00042     const int _x;
00043 
00045     const int _y;
00046 
00048     const size_t _width;
00049 
00051     const size_t _height;
00052 
00053 public:
00054     GnashVaapiImageProxy(GnashVaapiImage *image, int x, int y, size_t w, size_t h)
00055         : _surface(image->surface()), _x(x), _y(y), _width(w), _height(h)
00056         { }
00057 
00058     GnashVaapiImageProxy(const GnashVaapiImageProxy& o)
00059         : _surface(o.surface())
00060         , _x(o.x()), _y(o.y()), _width(o.width()), _height(o.height())
00061         { }
00062 
00064     //
00066     boost::shared_ptr<VaapiSurface> surface() const
00067         { return _surface; }
00068 
00070     //
00072     int x() const { return _x; }
00073 
00075     //
00077     int y() const { return _y; }
00078 
00080     //
00082     size_t width() const { return _width; }
00083 
00085     //
00087     size_t height() const { return _height; }
00088 };
00089 
00090 } // gnash namespace
00091 
00092 #endif // end of GNASH_GNASHVAAPIIMAGEPROXY_H
00093 
00094 
00095 // local Variables:
00096 // mode: C++
00097 // indent-tabs-mode: t
00098 // End: