48b83592e833631eb4c09718a3cb53db76a543a6
[platform/core/uifw/dali-adaptor.git] / adaptors / 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 <native-image-source-queue.h>
20
21 // INTERNAL INCLUDES
22 #include <native-image-source-queue-impl.h>
23 #include <native-image-source-factory.h>
24
25 namespace Dali
26 {
27
28 NativeImageSourceQueuePtr NativeImageSourceQueue::New( unsigned int width, unsigned int 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::SetSource( Any source )
55 {
56   mImpl->SetSource( source );
57 }
58
59 bool NativeImageSourceQueue::GlExtensionCreate()
60 {
61   return mImpl->GlExtensionCreate();
62 }
63
64 void NativeImageSourceQueue::GlExtensionDestroy()
65 {
66   mImpl->GlExtensionDestroy();
67 }
68
69 unsigned int NativeImageSourceQueue::TargetTexture()
70 {
71   return mImpl->TargetTexture();
72 }
73
74 void NativeImageSourceQueue::PrepareTexture()
75 {
76   mImpl->PrepareTexture();
77 }
78
79 unsigned int NativeImageSourceQueue::GetWidth() const
80 {
81   return mImpl->GetWidth();
82 }
83
84 unsigned int NativeImageSourceQueue::GetHeight() const
85 {
86   return mImpl->GetHeight();
87 }
88
89 bool NativeImageSourceQueue::RequiresBlending() const
90 {
91   return mImpl->RequiresBlending();
92 }
93
94 NativeImageInterface::Extension* NativeImageSourceQueue::GetExtension()
95 {
96   return mImpl->GetNativeImageInterfaceExtension();
97 }
98
99 NativeImageSourceQueue::NativeImageSourceQueue( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSourceQueue )
100 {
101   auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
102   mImpl = factory->CreateNativeImageSourceQueue( width, height, depth, nativeImageSourceQueue );
103 }
104
105 NativeImageSourceQueue::~NativeImageSourceQueue()
106 {
107 }
108
109 } // namespace Dali