acb10d50f06cbd6af6dfcab89e7e28e60edbc9a0
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / native-image-source-queue.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/devel-api/adaptor-framework/native-image-source-queue.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/imaging/common/native-image-source-queue-impl.h>
23 #include <dali/internal/imaging/common/native-image-source-factory.h>
24
25 namespace Dali
26 {
27
28 NativeImageSourceQueuePtr NativeImageSourceQueue::New( uint32_t width, uint32_t height, ColorDepth depth )
29 {
30   Any empty;
31   NativeImageSourceQueuePtr image = new NativeImageSourceQueue( width, height, depth, empty );
32   if( image->mImpl )
33   {
34     return image;
35   }
36   return nullptr;
37 }
38
39 NativeImageSourceQueuePtr NativeImageSourceQueue::New( Any nativeImageSourceQueue )
40 {
41   NativeImageSourceQueuePtr image = new NativeImageSourceQueue( 0, 0, COLOR_DEPTH_DEFAULT, nativeImageSourceQueue );
42   if( image->mImpl )
43   {
44     return image;
45   }
46   return nullptr;
47 }
48
49 Any NativeImageSourceQueue::GetNativeImageSourceQueue()
50 {
51   return mImpl->GetNativeImageSourceQueue();
52 }
53
54 void NativeImageSourceQueue::SetSize( uint32_t width, uint32_t height )
55 {
56   return mImpl->SetSize( width, height );
57 }
58
59 void NativeImageSourceQueue::IgnoreSourceImage()
60 {
61   mImpl->IgnoreSourceImage();
62 }
63
64 bool NativeImageSourceQueue::GlExtensionCreate()
65 {
66   return mImpl->GlExtensionCreate();
67 }
68
69 void NativeImageSourceQueue::GlExtensionDestroy()
70 {
71   mImpl->GlExtensionDestroy();
72 }
73
74 uint32_t NativeImageSourceQueue::TargetTexture()
75 {
76   return mImpl->TargetTexture();
77 }
78
79 void NativeImageSourceQueue::PrepareTexture()
80 {
81   mImpl->PrepareTexture();
82 }
83
84 uint32_t NativeImageSourceQueue::GetWidth() const
85 {
86   return mImpl->GetWidth();
87 }
88
89 uint32_t NativeImageSourceQueue::GetHeight() const
90 {
91   return mImpl->GetHeight();
92 }
93
94 bool NativeImageSourceQueue::RequiresBlending() const
95 {
96   return mImpl->RequiresBlending();
97 }
98
99 NativeImageInterface::Extension* NativeImageSourceQueue::GetExtension()
100 {
101   return mImpl->GetNativeImageInterfaceExtension();
102 }
103
104 NativeImageSourceQueue::NativeImageSourceQueue( uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue )
105 {
106   auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
107   mImpl = factory->CreateNativeImageSourceQueue( width, height, depth, nativeImageSourceQueue );
108 }
109
110 NativeImageSourceQueue::~NativeImageSourceQueue()
111 {
112 }
113
114 } // namespace Dali