Gnash  0.8.11dev
GnashVaapiImageProxy.h
Go to the documentation of this file.
1 // GnashVaapiImageProxy.h: GnashVaapiImage proxy class used for delayed rendering
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 
21 #ifndef GNASH_GNASHVAAPIIMAGEPROXY_H
22 #define GNASH_GNASHVAAPIIMAGEPROXY_H
23 
24 
25 namespace gnash {
26 
27 // Forward declarations
28 class GnashVaapiImage;
29 class VaapiSurface;
30 
34 {
35  /* XXX: Should Renderers use std::shared_ptr<> we could simple
36  derive from a GnashImageProxy base that would itself contain a
37  shared pointer to the image */
38  std::shared_ptr<VaapiSurface> _surface;
39 
41  const int _x;
42 
44  const int _y;
45 
47  const size_t _width;
48 
50  const size_t _height;
51 
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  { }
56 
58  : _surface(o.surface())
59  , _x(o.x()), _y(o.y()), _width(o.width()), _height(o.height())
60  { }
61 
63  //
65  std::shared_ptr<VaapiSurface> surface() const
66  { return _surface; }
67 
69  //
71  int x() const { return _x; }
72 
74  //
76  int y() const { return _y; }
77 
79  //
81  size_t width() const { return _width; }
82 
84  //
86  size_t height() const { return _height; }
87 };
88 
89 } // gnash namespace
90 
91 #endif // end of GNASH_GNASHVAAPIIMAGEPROXY_H
92 
93 
94 // local Variables:
95 // mode: C++
96 // indent-tabs-mode: t
97 // End:
size_t width() const
Get the rendered image&#39;s width.
Definition: GnashVaapiImageProxy.h:81
GnashVaapiImageProxy(const GnashVaapiImageProxy &o)
Definition: GnashVaapiImageProxy.h:57
GnashImage implementation using a VA surface.
Definition: GnashVaapiImage.h:35
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
GnashVaapiImageProxy(GnashVaapiImage *image, int x, int y, size_t w, size_t h)
Definition: GnashVaapiImageProxy.h:53
Definition: klash_part.cpp:329
Definition: GnashKey.h:161
std::shared_ptr< VaapiSurface > surface() const
Get access to the underlying surface.
Definition: GnashVaapiImageProxy.h:65
Definition: klash_part.cpp:329
int y() const
Get the rendered image&#39;s y position.
Definition: GnashVaapiImageProxy.h:76
std::int32_t x
Definition: BitmapData_as.cpp:434
#define DSOEXPORT
Definition: dsodefs.h:55
size_t height() const
Get the rendered image&#39;s width.
Definition: GnashVaapiImageProxy.h:86
std::int32_t y
Definition: BitmapData_as.cpp:435
Definition: GnashKey.h:154
w
Definition: test.py:8
Definition: GnashVaapiImageProxy.h:33
int x() const
Get the rendered image&#39;s x position.
Definition: GnashVaapiImageProxy.h:71