[dali_2.3.33] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / imaging / ubuntu-x11 / native-image-source-factory-x.cpp
1 /*
2  * Copyright (c) 2024 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-factory-x.h>
20
21 // INTERNAL HEADERS
22 #include <dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h>
23 #include <dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h>
24
25 namespace Dali
26 {
27 namespace Internal
28 {
29 namespace Adaptor
30 {
31 std::unique_ptr<NativeImageSource> NativeImageSourceFactoryX::CreateNativeImageSource(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
32 {
33 #if !defined(VULKAN_ENABLED)
34   return std::unique_ptr<NativeImageSource>(NativeImageSourceX::New(width, height, depth, nativeImageSource));
35 #else
36   return nullptr;
37 #endif
38 }
39
40 std::unique_ptr<NativeImageSourceQueue> NativeImageSourceFactoryX::CreateNativeImageSourceQueue(uint32_t queueCount, uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue)
41 {
42 #if !defined(VULKAN_ENABLED)
43   return std::unique_ptr<NativeImageSourceQueue>(NativeImageSourceQueueX::New(queueCount, width, height, colorFormat, nativeImageSourceQueue));
44 #else
45   return nullptr;
46 #endif
47 }
48
49 // this should be created from somewhere
50 std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory()
51 {
52   // returns native image source factory
53   return std::unique_ptr<NativeImageSourceFactoryX>(new NativeImageSourceFactoryX());
54 }
55
56 } // namespace Adaptor
57 } // namespace Internal
58 } // namespace Dali