Updates for NativeImageInterface
[platform/core/uifw/dali-adaptor.git] / dali / internal / imaging / ubuntu-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 <dali/internal/imaging/ubuntu-x11/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 <dali/internal/graphics/common/egl-image-extensions.h>
27 #include <dali/internal/graphics/gles/egl-graphics.h>
28 #include <dali/internal/adaptor/common/adaptor-impl.h>
29
30 namespace Dali
31 {
32
33 namespace Internal
34 {
35
36 namespace Adaptor
37 {
38
39 namespace
40 {
41 #define TBM_SURFACE_QUEUE_SIZE  3
42
43 const char* FRAGMENT_PREFIX = "\n";
44 const char* SAMPLER_TYPE = "sampler2D";
45
46 }
47
48 NativeImageSourceQueueX* NativeImageSourceQueueX::New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
49 {
50   NativeImageSourceQueueX* image = new NativeImageSourceQueueX( width, height, depth, nativeImageSourceQueue );
51   return image;
52 }
53
54 NativeImageSourceQueueX::NativeImageSourceQueueX( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
55 : mWidth( width ),
56   mHeight( height )
57 {
58   DALI_LOG_ERROR( "NativeImageSourceQueueX::NativeImageSourceQueueX: Not supported\n" );
59 }
60
61 NativeImageSourceQueueX::~NativeImageSourceQueueX()
62 {
63 }
64
65 Any NativeImageSourceQueueX::GetNativeImageSourceQueue() const
66 {
67   return Any();
68 }
69
70 void NativeImageSourceQueueX::SetSize( uint32_t width, uint32_t height )
71 {
72   mWidth = width;
73   mHeight = height;
74 }
75
76 void NativeImageSourceQueueX::IgnoreSourceImage()
77 {
78 }
79
80 bool NativeImageSourceQueueX::CreateResource()
81 {
82   return true;
83 }
84
85 void NativeImageSourceQueueX::DestroyResource()
86 {
87 }
88
89 uint32_t NativeImageSourceQueueX::TargetTexture()
90 {
91   return 0;
92 }
93
94 void NativeImageSourceQueueX::PrepareTexture()
95 {
96 }
97
98 const char* NativeImageSourceQueueX::GetCustomFragmentPrefix() const
99 {
100   return FRAGMENT_PREFIX;
101 }
102
103 const char* NativeImageSourceQueueX::GetCustomSamplerTypename() const
104 {
105   return SAMPLER_TYPE;
106 }
107
108 int NativeImageSourceQueueX::GetTextureTarget() const
109 {
110   return 0;
111 }
112
113 Any NativeImageSourceQueueX::GetNativeImageHandle() const
114 {
115   return nullptr;
116 }
117
118 bool NativeImageSourceQueueX::SourceChanged() const
119 {
120   return false;
121 }
122
123 } // namespace Adaptor
124
125 } // namespace internal
126
127 } // namespace Dali