2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include <dali/graphics/vulkan/vulkan-types.h>
19 #include <dali/graphics/vulkan/vulkan-graphics.h>
20 #include <dali/graphics/vulkan/vulkan-surface.h>
22 #include <dali/integration-api/graphics/graphics.h>
26 /// fixme: substituting directly the vulkan implementation
29 using GraphicsImpl = Dali::Graphics::Vulkan::Graphics;
40 auto impl = Dali::Graphics::MakeUnique<Dali::Graphics::GraphicsImpl>();
44 mGraphicsImpl = std::move(impl);
52 Dali::Graphics::FBID Graphics::Create(
53 std::unique_ptr<Dali::Integration::Graphics::SurfaceFactory> surfaceFactory)
57 auto retval = mGraphicsImpl->CreateSurface(std::move(surfaceFactory));
60 mGraphicsImpl->CreateDevice();
63 mGraphicsImpl->GetSurface( retval ).CreateSwapchain();
68 Dali::Graphics::FBID Graphics::CreateSurface(
69 std::unique_ptr<Dali::Integration::Graphics::SurfaceFactory> surfaceFactory)
74 void Graphics::PreRender(Dali::Graphics::FBID framebufferId)
76 assert(framebufferId != 0u && "Invalid FBID!");
77 auto &surface = mGraphicsImpl->GetSurface(framebufferId);
78 surface.AcquireNextImage();
84 void Graphics::PostRender(Dali::Graphics::FBID framebufferId)
86 assert(framebufferId != 0u && "Invalid FBID!");
87 auto &surface = mGraphicsImpl->GetSurface(framebufferId);
91 void IncludeThisLibrary()
93 // dummy function to create linker dependency
96 } // Namespace Graphics
97 } // Namespace Integration