[4.0] Add NativeImageSourceQueueX
[platform/core/uifw/dali-adaptor.git] / adaptors / x11 / native-image-source-queue-impl-x.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <native-image-source-queue-impl-x.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23 #include <dali/integration-api/gl-defines.h>
24
25 // INTERNAL INCLUDES
26 #include <gl/egl-image-extensions.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 namespace Adaptor
35 {
36
37 namespace
38 {
39 #define TBM_SURFACE_QUEUE_SIZE  3
40
41 const char* FRAGMENT_PREFIX = "\n";
42 const char* SAMPLER_TYPE = "sampler2D";
43
44 }
45
46 NativeImageSourceQueueX* NativeImageSourceQueueX::New( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
47 {
48   NativeImageSourceQueueX* image = new NativeImageSourceQueueX( width, height, depth, nativeImageSourceQueue );
49   return image;
50 }
51
52 NativeImageSourceQueueX::NativeImageSourceQueueX( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
53 : mWidth( width ),
54   mHeight( height )
55 {
56   DALI_LOG_ERROR( "NativeImageSourceQueueX::NativeImageSourceQueueX: Not supported\n" );
57 }
58
59 NativeImageSourceQueueX::~NativeImageSourceQueueX()
60 {
61 }
62
63 Any NativeImageSourceQueueX::GetNativeImageSourceQueue() const
64 {
65   return Any();
66 }
67
68 void NativeImageSourceQueueX::SetSource( Any source )
69 {
70 }
71
72 bool NativeImageSourceQueueX::GlExtensionCreate()
73 {
74   return true;
75 }
76
77 void NativeImageSourceQueueX::GlExtensionDestroy()
78 {
79 }
80
81 unsigned int NativeImageSourceQueueX::TargetTexture()
82 {
83   return 0;
84 }
85
86 void NativeImageSourceQueueX::PrepareTexture()
87 {
88 }
89
90 const char* NativeImageSourceQueueX::GetCustomFragmentPreFix()
91 {
92   return FRAGMENT_PREFIX;
93 }
94
95 const char* NativeImageSourceQueueX::GetCustomSamplerTypename()
96 {
97   return SAMPLER_TYPE;
98 }
99
100 int NativeImageSourceQueueX::GetEglImageTextureTarget()
101 {
102   return 0;
103 }
104
105 void NativeImageSourceQueueX::SetDestructorNotification( void* notification )
106 {
107 }
108
109 } // namespace Adaptor
110
111 } // namespace internal
112
113 } // namespace Dali