Removed legacy resource tracking / logging
[platform/core/uifw/dali-core.git] / dali / internal / render / gl-resources / native-texture.h
1 #ifndef __DALI_INTERNAL_NATIVE_TEXTURE_H__
2 #define __DALI_INTERNAL_NATIVE_TEXTURE_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 // INTERNAL INCLUDES
21 #include <dali/public-api/images/native-image.h>
22 #include <dali/internal/render/gl-resources/texture.h>
23
24 namespace Dali
25 {
26
27 namespace Internal
28 {
29
30 class Texture;
31
32 /**
33  *
34  * Native texture class.
35  * Used for handing already loaded image data to Dali.
36  *
37  */
38 class NativeTexture : public Texture
39 {
40 public:
41   /**
42    * Constructor.
43    * @pre nativeImg has to be initialized. (GLTexture is already created)
44    * @param nativeImg         the NativeImage to be used
45    * @param context           the GL context
46    */
47   NativeTexture(NativeImage* nativeImg, Context& context);
48
49   /**
50    * Destructor.
51    */
52   virtual ~NativeTexture();
53
54   /**
55    * @copydoc Texture::Bind
56    */
57   virtual bool Bind(GLenum target, GLenum textureunit = GL_TEXTURE0);
58
59   /**
60    * @copydoc Texture::IsFullyOpaque
61    */
62   virtual bool IsFullyOpaque() const;
63
64   /**
65    * @copydoc Texture::HasAlphaChannel
66    */
67   virtual bool HasAlphaChannel() const;
68
69
70   /**
71    * @copydoc Texture::GetPixelFormat
72    */
73   virtual Pixel::Format GetPixelFormat() const;
74
75   /**
76    * @copydoc Texture::Init
77    */
78   virtual bool Init();
79
80 protected:
81   /**
82    * @copydoc Texture::CreateGlTexture
83    */
84   virtual bool CreateGlTexture();
85
86   /**
87    * @copydoc Texture::GlCleanup
88    */
89   virtual void GlCleanup();
90
91
92 private:
93
94   NativeImagePtr mNativeImage; ///< reference to NativeImage the Texture was created from
95 };
96
97 }  //namespace Internal
98
99 }  //namespace Dali
100
101 #endif //__DALI_INTERNAL_NATIVE_TEXTURE_H__