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(image::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,
00072 image::ImageType type);
00073 virtual ~GnashTexture();
00074
00076 unsigned int flags() const
00077 { return _flags; }
00078
00080 unsigned int width() const
00081 { return _width; }
00082
00084 unsigned int height() const
00085 { return _height; }
00086
00088 unsigned int texture() const
00089 { return _texture; }
00090
00092 unsigned int internal_format() const
00093 { return _format.internal_format(); }
00094
00096 unsigned int format() const
00097 { return _format.format(); }
00098
00100 bool bind();
00101
00103 void release();
00104
00106
00112 void update(const boost::uint8_t *data);
00113 };
00114
00115 }
00116
00117 #endif