1 // GnashVaapiImageProxy.h: GnashVaapiImage proxy class used for delayed rendering
3 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
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.
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.
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>
27 // Forward declarations
28 class GnashVaapiImage
;
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
43 /// Y-position of the rendered image, in pixels
46 /// Width of the rendered image, in pixels
49 /// Height of the rendered image, in pixels
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
)
57 GnashVaapiImageProxy(const GnashVaapiImageProxy
& o
)
58 : _surface(o
.surface())
59 , _x(o
.x()), _y(o
.y()), _width(o
.width()), _height(o
.height())
62 /// Get access to the underlying surface
64 /// @return A pointer to the VA surface.
65 boost::shared_ptr
<VaapiSurface
> surface() const
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
; }
91 #endif // end of GNASH_GNASHVAAPIIMAGEPROXY_H
96 // indent-tabs-mode: t