Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GNASH_GNASHTEXTURE_H
00021 #define GNASH_GNASHTEXTURE_H
00022
00023 #include "GnashImage.h"
00024 #include <boost/shared_ptr.hpp>
00025
00026 namespace gnash {
00027
00029 enum {
00030 GNASH_TEXTURE_VAAPI = 1 << 0,
00031 };
00032
00034 class DSOEXPORT GnashTextureFormat {
00035 unsigned int _internal_format;
00036 unsigned int _format;
00037
00038 public:
00039 GnashTextureFormat(ImageType type);
00040
00042 unsigned int internal_format() const
00043 { return _internal_format; }
00044
00046 unsigned int format() const
00047 { return _format; }
00048 };
00049
00051 class DSOEXPORT GnashTexture {
00052 unsigned int _width;
00053 unsigned int _height;
00054 unsigned int _texture;
00055 GnashTextureFormat _format;
00056
00058 struct TextureState {
00059 unsigned int old_texture;
00060 unsigned int was_enabled : 1;
00061 unsigned int was_bound : 1;
00062 } _texture_state;
00063
00064 protected:
00065 unsigned int _flags;
00066
00067 private:
00068 bool init();
00069
00070 public:
00071 GnashTexture(unsigned int width, unsigned int height, ImageType type);
00072 virtual ~GnashTexture();
00073
00075 unsigned int flags() const
00076 { return _flags; }
00077
00079 unsigned int width() const
00080 { return _width; }
00081
00083 unsigned int height() const
00084 { return _height; }
00085
00087 unsigned int texture() const
00088 { return _texture; }
00089
00091 unsigned int internal_format() const
00092 { return _format.internal_format(); }
00093
00095 unsigned int format() const
00096 { return _format.format(); }
00097
00099 bool bind();
00100
00102 void release();
00103
00105
00111 void update(const boost::uint8_t *data);
00112 };
00113
00114 }
00115
00116 #endif