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