Merge branch 'devel/master' into tizen
[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( unsigned int width, unsigned int height, ColorDepth depth )
29 {
30   Any empty;
31   NativeImageSourceQueuePtr image = new NativeImageSourceQueue( width, height, depth, empty );
32   return image;
33 }
34
35 NativeImageSourceQueuePtr NativeImageSourceQueue::New( Any nativeImageSourceQueue )
36 {
37   NativeImageSourceQueuePtr image = new NativeImageSourceQueue( 0, 0, COLOR_DEPTH_DEFAULT, nativeImageSourceQueue );
38   return image;
39 }
40
41 Any NativeImageSourceQueue::GetNativeImageSourceQueue()
42 {
43   return mImpl->GetNativeImageSourceQueue();
44 }
45
46 void NativeImageSourceQueue::SetSource( Any source )
47 {
48   mImpl->SetSource( source );
49 }
50
51 bool NativeImageSourceQueue::GlExtensionCreate()
52 {
53   return mImpl->GlExtensionCreate();
54 }
55
56 void NativeImageSourceQueue::GlExtensionDestroy()
57 {
58   mImpl->GlExtensionDestroy();
59 }
60
61 unsigned int NativeImageSourceQueue::TargetTexture()
62 {
63   return mImpl->TargetTexture();
64 }
65
66 void NativeImageSourceQueue::PrepareTexture()
67 {
68   mImpl->PrepareTexture();
69 }
70
71 unsigned int NativeImageSourceQueue::GetWidth() const
72 {
73   return mImpl->GetWidth();
74 }
75
76 unsigned int NativeImageSourceQueue::GetHeight() const
77 {
78   return mImpl->GetHeight();
79 }
80
81 bool NativeImageSourceQueue::RequiresBlending() const
82 {
83   return mImpl->RequiresBlending();
84 }
85
86 NativeImageInterface::Extension* NativeImageSourceQueue::GetExtension()
87 {
88   return mImpl->GetNativeImageInterfaceExtension();
89 }
90
91 NativeImageSourceQueue::NativeImageSourceQueue( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSourceQueue )
92 {
93   auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
94   mImpl = factory->CreateNativeImageSourceQueue( width, height, depth, nativeImageSourceQueue );
95 }
96
97 NativeImageSourceQueue::~NativeImageSourceQueue()
98 {
99 }
100
101 } // namespace Dali