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