Do not expect exact load timing. Hopefull makes buildbot results more stable (see...
[gnash.git] / libbase / GnashVaapiImageProxy.h
blobe6a668a0a9439026dd366c7090550228c4de9254
1 // GnashVaapiImageProxy.h: GnashVaapiImage proxy class used for delayed rendering
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef GNASH_GNASHVAAPIIMAGEPROXY_H
21 #define GNASH_GNASHVAAPIIMAGEPROXY_H
23 #include <boost/shared_ptr.hpp>
25 namespace gnash {
27 // Forward declarations
28 class GnashVaapiImage;
29 class VaapiSurface;
31 /// GnashVaapiImage proxy for delayed rendering
32 /// XXX: call it GnashRenderedVaapiImage instead?
33 class DSOEXPORT GnashVaapiImageProxy
35 /* XXX: Should Renderers use boost::shared_ptr<> we could simple
36 derive from a GnashImageProxy base that would itself contain a
37 shared pointer to the image */
38 boost::shared_ptr<VaapiSurface> _surface;
40 /// X-position of the rendered image, in pixels
41 const int _x;
43 /// Y-position of the rendered image, in pixels
44 const int _y;
46 /// Width of the rendered image, in pixels
47 const size_t _width;
49 /// Height of the rendered image, in pixels
50 const size_t _height;
52 public:
53 GnashVaapiImageProxy(GnashVaapiImage *image, int x, int y, size_t w, size_t h)
54 : _surface(image->surface()), _x(x), _y(y), _width(w), _height(h)
55 { }
57 GnashVaapiImageProxy(const GnashVaapiImageProxy& o)
58 : _surface(o.surface())
59 , _x(o.x()), _y(o.y()), _width(o.width()), _height(o.height())
60 { }
62 /// Get access to the underlying surface
64 /// @return A pointer to the VA surface.
65 boost::shared_ptr<VaapiSurface> surface() const
66 { return _surface; }
68 /// Get the rendered image's x position
70 /// @return The rendered image's x position in pixels.
71 int x() const { return _x; }
73 /// Get the rendered image's y position
75 /// @return The rendered image's y position in pixels.
76 int y() const { return _y; }
78 /// Get the rendered image's width
80 /// @return The rendered image's width in pixels.
81 size_t width() const { return _width; }
83 /// Get the rendered image's width
85 /// @return The rendered image's height in pixels.
86 size_t height() const { return _height; }
89 } // gnash namespace
91 #endif // end of GNASH_GNASHVAAPIIMAGEPROXY_H
94 // local Variables:
95 // mode: C++
96 // indent-tabs-mode: t
97 // End: