Removed legacy resource tracking / logging
[platform/core/uifw/dali-core.git] / dali / internal / render / gl-resources / texture-factory.h
1 #ifndef __DALI_INTERNAL_TEXTURE_FACTORY_H__
2 #define __DALI_INTERNAL_TEXTURE_FACTORY_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/object/ref-object.h>
22 #include <dali/public-api/images/native-image.h>
23
24
25 namespace Dali
26 {
27 class NativeImage;
28
29 namespace Integration
30 {
31 class Bitmap;
32 }
33
34 namespace Internal
35 {
36 class Context;
37 class Texture;
38
39 namespace TextureFactory
40 {
41 /**
42  * Creates a new texture object from a Bitmap
43  * @param[in] bitmap The Bitmap
44  * @param[in] context The GL context
45  * @return A newly allocated texture
46  */
47 Internal::Texture* NewBitmapTexture( Integration::Bitmap* const bitmap, Context& context );
48
49 /**
50  * Creates a new bitmap texture object of the given dimensions.
51  * @param[in] width       The width (pixels)
52  * @param[in] height      The height (pixels)
53  * @param[in] pixelFormat The pixel format
54  * @param[in] clearPixels True if the pixel data should be cleared first
55  * @param[in] context The GL context
56  */
57 Internal::Texture* NewBitmapTexture( unsigned int      width,
58                                      unsigned int      height,
59                                      Pixel::Format     pixelFormat,
60                                      bool              clearPixels,
61                                      Context&          context );
62
63 /**
64  * Creates a texture object from a native image (eg.: EGLImage).
65  * @param[in] nativeImage The native image to load
66  * @param[in] context The GL context
67  * @return A newly allocated texture
68  */
69 Internal::Texture* NewNativeImageTexture( NativeImage& nativeImage, Context& context );
70
71 /**
72  * @copydoc FrameBufferTexture::FrameBufferTexture
73  * @return A newly allocated texture
74  */
75 Internal::Texture* NewFrameBufferTexture( unsigned int width,
76                                           unsigned int height,
77                                           Pixel::Format pixelFormat,
78                                           Context& context );
79
80 /**
81  * @copydoc FrameBufferTexture::FrameBufferTexture
82  * @return A newly allocated texture
83  */
84 Internal::Texture* NewFrameBufferTexture( NativeImagePtr nativeImage, Context& context );
85
86 };
87
88 } // namespace Internal
89
90 } // namespace Dali
91
92 #endif // __DALI_INTERNAL_TEXTURE_FACTORY_H__