Add NativeImageSurface
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor-framework / native-image-surface.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/integration-api/adaptor-framework/native-image-surface.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/window-system/common/native-image-surface-factory.h>
23 #include <dali/internal/window-system/common/native-image-surface-impl.h>
24
25 namespace Dali
26 {
27 NativeImageSurfacePtr NativeImageSurface::New(Dali::NativeImageSourceQueuePtr queue)
28 {
29   NativeImageSurfacePtr surface = new NativeImageSurface(queue);
30   if(surface->mImpl)
31   {
32     return surface;
33   }
34   return nullptr;
35 }
36
37 Any NativeImageSurface::GetNativeRenderable()
38 {
39   return mImpl->GetNativeRenderable();
40 }
41
42 void NativeImageSurface::InitializeGraphics()
43 {
44   mImpl->InitializeGraphics();
45 }
46
47 void NativeImageSurface::TerminateGraphics()
48 {
49   mImpl->TerminateGraphics();
50 }
51
52 void NativeImageSurface::PreRender()
53 {
54   mImpl->PreRender();
55 }
56
57 void NativeImageSurface::PostRender()
58 {
59   mImpl->PostRender();
60 }
61
62 bool NativeImageSurface::CanRender()
63 {
64   return mImpl->CanRender();
65 }
66
67 bool NativeImageSurface::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
68 {
69   return mImpl->SetGraphicsConfig(depth, stencil, msaa, version);
70 }
71
72 NativeImageSurface::NativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
73 {
74   mImpl = Dali::Internal::Adaptor::NativeImageSurfaceFactory::CreateNativeImageSurface(queue);
75 }
76
77 NativeImageSurface::~NativeImageSurface()
78 {
79 }
80
81 } // namespace Dali