NativeImageSurface is a GL Rendering surface.
But it's not an actual window, it's like a pixmap.
It creates EGL resources.
Change-Id: Ib69a1dba557483e87bb05c76842cf012dc4423a5
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/integration-api/adaptor-framework/native-image-surface.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+namespace Dali
+{
+NativeImageSurfacePtr NativeImageSurface::New(Dali::NativeImageSourceQueuePtr queue)
+{
+ NativeImageSurfacePtr surface = new NativeImageSurface(queue);
+ if(surface->mImpl)
+ {
+ return surface;
+ }
+ return nullptr;
+}
+
+Any NativeImageSurface::GetNativeRenderable()
+{
+ return mImpl->GetNativeRenderable();
+}
+
+void NativeImageSurface::InitializeGraphics()
+{
+ mImpl->InitializeGraphics();
+}
+
+void NativeImageSurface::TerminateGraphics()
+{
+ mImpl->TerminateGraphics();
+}
+
+void NativeImageSurface::PreRender()
+{
+ mImpl->PreRender();
+}
+
+void NativeImageSurface::PostRender()
+{
+ mImpl->PostRender();
+}
+
+bool NativeImageSurface::CanRender()
+{
+ return mImpl->CanRender();
+}
+
+bool NativeImageSurface::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
+{
+ return mImpl->SetGraphicsConfig(depth, stencil, msaa, version);
+}
+
+NativeImageSurface::NativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+{
+ mImpl = Dali::Internal::Adaptor::NativeImageSurfaceFactory::CreateNativeImageSurface(queue);
+}
+
+NativeImageSurface::~NativeImageSurface()
+{
+}
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_NATIVE_IMAGE_SURFACE_H
+#define DALI_NATIVE_IMAGE_SURFACE_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurface;
+}
+} // namespace Internal
+
+class NativeImageSurface;
+
+/**
+ * @brief Pointer to Dali::NativeImageSurface.
+ */
+typedef Dali::IntrusivePtr<Dali::NativeImageSurface> NativeImageSurfacePtr;
+
+/**
+ * Native image surface is a surface that GL can render.
+ * The surface is not a window, it's like a pixmap.
+ */
+class DALI_ADAPTOR_API NativeImageSurface : public RefObject
+{
+public:
+ /**
+ * Creates a NativeImageSurface
+ *
+ * @param [in] queue the native image source queue handle
+ * @return A smart-pointer to a newly allocated native image surface
+ */
+ static NativeImageSurfacePtr New(Dali::NativeImageSourceQueuePtr queue);
+
+ /**
+ * @brief Gets the native renderable handle
+ * @return The native renderable handle
+ */
+ Any GetNativeRenderable();
+
+ /**
+ * @brief Initializes the graphics resources
+ */
+ void InitializeGraphics();
+
+ /**
+ * @brief Terminate the graphics resources
+ */
+ void TerminateGraphics();
+
+ /**
+ * @brief Invoked by render thread before rendering
+ */
+ void PreRender();
+
+ /**
+ * @brief Invoked by render thread after rendering
+ */
+ void PostRender();
+
+ /**
+ * @brief Checks to render
+ */
+ bool CanRender();
+
+ /**
+ * @brief Sets Graphics configuration to the surface
+ *
+ * @param[in] depth the flag of depth buffer. If true is set, 24bit depth buffer is enabled.
+ * @param[in] stencil the flag of stencil. it true is set, 8bit stencil buffer is enabled.
+ * @param[in] msaa the bit of msaa.
+ * @param[in] version the GLES version.
+ * @return True if the config exists, false otherwise.
+ */
+ bool SetGraphicsConfig(bool depth, bool stencil, int msaa, int version);
+
+private:
+ /// @cond internal
+ /**
+ * @brief Private constructor.
+ * @param[in] queue the native image source queue handle
+ */
+ DALI_INTERNAL NativeImageSurface(Dali::NativeImageSourceQueuePtr queue);
+
+ /**
+ * @brief A reference counted object may only be deleted by calling Unreference().
+ */
+ DALI_INTERNAL ~NativeImageSurface() override;
+
+ /**
+ * @brief Undefined copy constructor.
+ *
+ * This avoids accidental calls to a default copy constructor.
+ * @param[in] nativeImageSurface A reference to the object to copy
+ */
+ DALI_INTERNAL NativeImageSurface(const NativeImageSurface& nativeImageSurface);
+
+ /**
+ * @brief Undefined assignment operator.
+ *
+ * This avoids accidental calls to a default assignment operator.
+ * @param[in] rhs A reference to the object to copy
+ */
+ DALI_INTERNAL NativeImageSurface& operator=(const NativeImageSurface& rhs);
+ /// @endcond
+
+private:
+ std::unique_ptr<Internal::Adaptor::NativeImageSurface> mImpl; ///< Implementation pointer
+};
+
+} // namespace Dali
+
+#endif // DALI_NATIVE_IMAGE_SURFACE_H
SET( adaptor_integration_api_src_files
${adaptor_integration_api_dir}/adaptor-framework/scene-holder.cpp
${adaptor_integration_api_dir}/adaptor-framework/scene-holder-impl.cpp
+ ${adaptor_integration_api_dir}/adaptor-framework/native-image-surface.cpp
)
${adaptor_integration_api_dir}/adaptor-framework/thread-synchronization-interface.h
${adaptor_integration_api_dir}/adaptor-framework/trigger-event-interface.h
${adaptor_integration_api_dir}/adaptor-framework/trigger-event-factory.h
+ ${adaptor_integration_api_dir}/adaptor-framework/native-image-surface.h
)
configAttribs.PushBack(8);
// For underlay video playback, we also need to set the alpha value of the 24/32bit window.
+ // TODO: When the tbm queue of GlView is 24bit, do we have to set the alpha size??
configAttribs.PushBack(EGL_ALPHA_SIZE);
configAttribs.PushBack(8);
mEglGraphics(NULL),
mEglImageExtensions(NULL),
mOwnTbmQueue(false),
- mBlendingRequired(false)
+ mBlendingRequired(false),
+ mIsResized(false)
{
DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
{
Dali::Mutex::ScopedLock lock(mMutex);
- tbm_surface_queue_reset(mTbmQueue, width, height, tbm_surface_queue_get_format(mTbmQueue));
+ if(mWidth == width && mHeight == height)
+ {
+ return;
+ }
- mWidth = width;
- mHeight = height;
+ tbm_surface_queue_reset(mTbmQueue, width, height, tbm_surface_queue_get_format(mTbmQueue));
- ResetEglImageList();
+ mWidth = width;
+ mHeight = height;
+ mIsResized = true;
}
void NativeImageSourceQueueTizen::IgnoreSourceImage()
{
Dali::Mutex::ScopedLock lock(mMutex);
- ResetEglImageList();
+ ResetEglImageList(true);
}
uint32_t NativeImageSourceQueueTizen::TargetTexture()
}
}
+ if(mIsResized)
+ {
+ ResetEglImageList(false);
+ mIsResized = false;
+ }
+
if(mConsumeSurface)
{
bool existing = false;
return false;
}
-void NativeImageSourceQueueTizen::ResetEglImageList()
+void NativeImageSourceQueueTizen::ResetEglImageList(bool releaseConsumeSurface)
{
- if(mConsumeSurface)
+ // When Tbm surface queue is reset(resized), the surface acquired before reset() is still valid, not the others.
+ // We can still use the acquired surface so that we will release it as the oldSurface in PrepareTexture() when the next surface is ready.
+ if(releaseConsumeSurface && mConsumeSurface)
{
if(tbm_surface_internal_is_valid(mConsumeSurface))
{
void Initialize(Dali::NativeImageSourceQueue::ColorFormat colorFormat);
- void ResetEglImageList();
+ void ResetEglImageList(bool releaseConsumeSurface);
tbm_surface_queue_h GetSurfaceFromAny(Any source) const;
EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
bool mOwnTbmQueue; ///< Whether we created tbm queue
bool mBlendingRequired; ///< Whether blending is required
+ bool mIsResized; ///< Whether the size has changed
};
} // namespace Adaptor
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/android/native-image-surface-impl-android.h>
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> NativeImageSurfaceFactory::CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+{
+ return std::make_unique<Internal::Adaptor::NativeImageSurfaceAndroid>(queue);
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/android/native-image-surface-impl-android.h>
+
+using namespace Dali::Internal::Adaptor;
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+NativeImageSurfaceAndroid::NativeImageSurfaceAndroid(Dali::NativeImageSourceQueuePtr queue)
+{
+}
+
+NativeImageSurfaceAndroid::~NativeImageSurfaceAndroid()
+{
+}
+
+Any NativeImageSurfaceAndroid::GetNativeRenderable()
+{
+ return Any();
+}
+
+void NativeImageSurfaceAndroid::InitializeGraphics()
+{
+}
+
+void NativeImageSurfaceAndroid::TerminateGraphics()
+{
+}
+
+void NativeImageSurfaceAndroid::PreRender()
+{
+}
+
+void NativeImageSurfaceAndroid::PostRender()
+{
+}
+
+bool NativeImageSurfaceAndroid::CanRender()
+{
+ return false;
+}
+
+bool NativeImageSurfaceAndroid::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
+{
+ return false;
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_ANDROID_NATIVE_IMAGE_SURFACE_IMPL_ANDROID_H
+#define DALI_INTERNAL_WINDOWSYSTEM_ANDROID_NATIVE_IMAGE_SURFACE_IMPL_ANDROID_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurfaceAndroid : public Dali::Internal::Adaptor::NativeImageSurface
+{
+public:
+ /**
+ * @param [in] queue the NativeImageSourceQueue pointer
+ */
+ NativeImageSurfaceAndroid(Dali::NativeImageSourceQueuePtr queue);
+
+ /**
+ * @brief Destructor
+ */
+ ~NativeImageSurfaceAndroid();
+
+public:
+ /**
+ * @copydoc Dali::NativeImageSurface::GetNativeRenderable()
+ */
+ Any GetNativeRenderable() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::InitializeGraphics()
+ */
+ void InitializeGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::TerminateGraphics()
+ */
+ void TerminateGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PreRender()
+ */
+ void PreRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PostRender()
+ */
+ void PostRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::CanRender()
+ */
+ bool CanRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::SetGraphicsConfig()
+ */
+ bool SetGraphicsConfig(bool depth, bool stencil, int msaa, int version) override;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_ANDROID_NATIVE_IMAGE_SURFACE_IMPL_ANDROID_H
--- /dev/null
+#ifndef DALI_INTERNAL_NATIVE_IMAGE_SURFACE_FACTORY_H
+#define DALI_INTERNAL_NATIVE_IMAGE_SURFACE_FACTORY_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurface;
+
+class NativeImageSurfaceFactory
+{
+public:
+ /**
+ * Factory function for native image surface
+ * A native image surface is created.
+ *
+ * @param [in] queue the native image surface handle
+ * @return A pointer to a newly allocated surface
+ */
+ static std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue);
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_NATIVE_IMAGE_SURFACE_FACTORY_H
--- /dev/null
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_NATIVE_IMAGE_SURFACE_IMPL_H
+#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_NATIVE_IMAGE_SURFACE_IMPL_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+
+#include <dali/public-api/object/any.h>
+#include <dali/public-api/object/base-object.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+
+namespace Dali
+{
+class NativeImageSurface;
+
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurface
+{
+public:
+ /**
+ * @copydoc Dali::NativeImageSurface::GetNativeRenderable()
+ */
+ virtual Any GetNativeRenderable() = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::InitializeGraphics()
+ */
+ virtual void InitializeGraphics() = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::TerminateGraphics()
+ */
+ virtual void TerminateGraphics() = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PreRender()
+ */
+ virtual void PreRender() = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PostRender()
+ */
+ virtual void PostRender() = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::CanRender()
+ */
+ virtual bool CanRender() = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::SetGraphicsConfig()
+ */
+ virtual bool SetGraphicsConfig(bool depth, bool stencil, int msaa, int version) = 0;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_NATIVE_IMAGE_SURFACE_IMPL_H
SET( adaptor_window_system_tizen_wayland_src_files
${adaptor_window_system_dir}/tizen-wayland/display-connection-factory-ecore-wl.cpp
${adaptor_window_system_dir}/tizen-wayland/display-connection-impl-ecore-wl.cpp
+ ${adaptor_window_system_dir}/tizen-wayland/native-image-surface-factory-ecore-wl.cpp
+ ${adaptor_window_system_dir}/tizen-wayland/native-image-surface-impl-ecore-wl.cpp
${adaptor_window_system_dir}/tizen-wayland/native-render-surface-ecore-wl.cpp
)
${adaptor_window_system_dir}/ubuntu-x11/window-base-ecore-x.cpp
${adaptor_window_system_dir}/ubuntu-x11/window-factory-ecore-x.cpp
${adaptor_window_system_dir}/ubuntu-x11/window-system-ecore-x.cpp
+ ${adaptor_window_system_dir}/ubuntu-x11/native-image-surface-factory-x.cpp
+ ${adaptor_window_system_dir}/ubuntu-x11/native-image-surface-impl-x.cpp
)
# module: window-system, backend: android
${adaptor_window_system_dir}/android/window-base-android.cpp
${adaptor_window_system_dir}/android/window-factory-android.cpp
${adaptor_window_system_dir}/android/window-system-android.cpp
+ ${adaptor_window_system_dir}/android/native-image-surface-factory-android.cpp
+ ${adaptor_window_system_dir}/android/native-image-surface-impl-android.cpp
)
# module: window-system, backend: windows
${adaptor_window_system_dir}/windows/window-base-win.cpp
${adaptor_window_system_dir}/windows/window-factory-win.cpp
${adaptor_window_system_dir}/windows/window-system-win.cpp
+ ${adaptor_window_system_dir}/windows/native-image-surface-factory-win.cpp
+ ${adaptor_window_system_dir}/windows/native-image-surface-impl-win.cpp
)
# module: window-system, backend: macos
${adaptor_window_system_dir}/macos/window-base-mac.mm
${adaptor_window_system_dir}/macos/window-factory-mac.cpp
${adaptor_window_system_dir}/macos/render-surface-factory-mac.cpp
+ ${adaptor_window_system_dir}/macos/native-image-surface-factory-mac.cpp
+ ${adaptor_window_system_dir}/macos/native-image-surface-impl-mac.cpp
)
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+#include <dali/internal/window-system/macos/native-image-surface-impl-mac.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> NativeImageSurfaceFactory::CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+{
+ return std::make_unique<Internal::Adaptor::NativeImageSurfaceCocoa>(queue);
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/macos/native-image-surface-impl-mac.h>
+
+using namespace Dali::Internal::Adaptor;
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+NativeImageSurfaceCocoa::NativeImageSurfaceCocoa(Dali::NativeImageSourceQueuePtr queue)
+{
+}
+
+NativeImageSurfaceCocoa::~NativeImageSurfaceCocoa()
+{
+}
+
+Any NativeImageSurfaceCocoa::GetNativeRenderable()
+{
+ return Any();
+}
+
+void NativeImageSurfaceCocoa::InitializeGraphics()
+{
+}
+
+void NativeImageSurfaceCocoa::TerminateGraphics()
+{
+}
+
+void NativeImageSurfaceCocoa::PreRender()
+{
+}
+
+void NativeImageSurfaceCocoa::PostRender()
+{
+}
+
+bool NativeImageSurfaceCocoa::CanRender()
+{
+ return false;
+}
+
+bool NativeImageSurfaceCocoa::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
+{
+ return false;
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+#pragma once
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurfaceCocoa : public Dali::Internal::Adaptor::NativeImageSurface
+{
+public:
+ /**
+ * @param [in] queue the NativeImageSourceQueue pointer
+ */
+ NativeImageSurfaceCocoa(Dali::NativeImageSourceQueuePtr queue);
+
+ /**
+ * @brief Destructor
+ */
+ ~NativeImageSurfaceCocoa();
+
+public:
+ /**
+ * @copydoc Dali::NativeImageSurface::GetNativeRenderable()
+ */
+ Any GetNativeRenderable() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::InitializeGraphics()
+ */
+ void InitializeGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::TerminateGraphics()
+ */
+ void TerminateGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PreRender()
+ */
+ void PreRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PostRender()
+ */
+ void PostRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::CanRender()
+ */
+ bool CanRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::SetGraphicsConfig()
+ */
+ bool SetGraphicsConfig(bool depth, bool stencil, int msaa, int version) override;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+#include <dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> NativeImageSurfaceFactory::CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+{
+ return std::make_unique<Internal::Adaptor::NativeImageSurfaceEcoreWl>(queue);
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+#include <system_info.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/gles/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/window-system/common/display-utils.h>
+
+using namespace Dali::Internal::Adaptor;
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+NativeImageSurfaceEcoreWl::NativeImageSurfaceEcoreWl(Dali::NativeImageSourceQueuePtr queue)
+: mDisplayConnection(nullptr),
+ mGraphics(nullptr),
+ mEGL(nullptr),
+ mEGLSurface(nullptr),
+ mEGLContext(nullptr),
+ mColorDepth(COLOR_DEPTH_32),
+ mTbmQueue(nullptr),
+ mDepth(false),
+ mStencil(false),
+ mGLESVersion(30),
+ mMSAA(0)
+{
+ if(queue)
+ {
+ mTbmQueue = AnyCast<tbm_surface_queue_h>(queue->GetNativeImageSourceQueue());
+ mTbmFormat = tbm_surface_queue_get_format(mTbmQueue);
+ mColorDepth = (mTbmFormat == TBM_FORMAT_ARGB8888) ? COLOR_DEPTH_32 : COLOR_DEPTH_24;
+ }
+ else
+ {
+ DALI_LOG_ERROR("NativeImageSourceQueue is null.");
+ }
+}
+
+bool NativeImageSurfaceEcoreWl::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
+{
+ bool featureFlag = false;
+ int error = SYSTEM_INFO_ERROR_NONE;
+
+ if(version == 30)
+ {
+ error = system_info_get_platform_bool("http://tizen.org/feature/opengles.version.3_0", &featureFlag);
+ }
+ else if(version == 20)
+ {
+ error = system_info_get_platform_bool("http://tizen.org/feature/opengles.version.2_0", &featureFlag);
+ }
+ else
+ {
+ DALI_LOG_ERROR("version is not valid");
+ return false;
+ }
+
+ if(error != SYSTEM_INFO_ERROR_NONE)
+ {
+ DALI_LOG_ERROR("Can't check platform feature.\n");
+ return false;
+ }
+
+ if(featureFlag)
+ {
+ mDepth = depth;
+ mStencil = stencil;
+ if(mMSAA == 0)
+ {
+ //EGL_DONT_CARE is -1
+ mMSAA = -1;
+ }
+ else
+ {
+ mMSAA = msaa;
+ }
+ mGLESVersion = version;
+ }
+
+ return featureFlag;
+}
+
+Any NativeImageSurfaceEcoreWl::GetNativeRenderable()
+{
+ return mTbmQueue;
+}
+
+void NativeImageSurfaceEcoreWl::InitializeGraphics()
+{
+ std::unique_ptr<GraphicsFactory> graphicsFactoryPtr = Utils::MakeUnique<GraphicsFactory>(*(new EnvironmentOptions()));
+ auto graphicsFactory = *graphicsFactoryPtr.get();
+
+ mGraphics = std::unique_ptr<GraphicsInterface>(&graphicsFactory.Create());
+ GraphicsInterface* graphics = mGraphics.get();
+ auto eglGraphics = static_cast<EglGraphics*>(graphics);
+ eglGraphics->Initialize(mDepth, mStencil, false, mMSAA);
+
+ mDisplayConnection = std::unique_ptr<Dali::DisplayConnection>(Dali::DisplayConnection::New(*mGraphics, Dali::RenderSurfaceInterface::Type::NATIVE_RENDER_SURFACE));
+ mDisplayConnection->Initialize();
+
+ mEGL = &eglGraphics->GetEglInterface();
+
+ if(mEGLContext == NULL)
+ {
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+ eglImpl.SetGlesVersion(mGLESVersion);
+
+ if(eglImpl.ChooseConfig(true, mColorDepth) == false)
+ {
+ DALI_LOG_ERROR("InitializeGraphics: Fail to choose config. Version:%d, ColorDepth:%d, depth:%d, stencil:%d, MSAA:%d",
+ mGLESVersion,
+ mColorDepth == COLOR_DEPTH_32 ? 32 : 24,
+ mDepth ? 24 : 0,
+ mStencil ? 8 : 0,
+ mMSAA);
+ return;
+ }
+
+ // Create the OpenGL Surface & Context
+ eglImpl.CreateWindowContext(mEGLContext);
+ mEGLSurface = eglImpl.CreateSurfaceWindow(reinterpret_cast<EGLNativeWindowType>(mTbmQueue), mColorDepth);
+
+ MakeContextCurrent();
+ }
+}
+
+void NativeImageSurfaceEcoreWl::TerminateGraphics()
+{
+ GraphicsInterface* graphics = mGraphics.get();
+ auto eglGraphics = static_cast<EglGraphics*>(graphics);
+
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ if(mEGLSurface)
+ {
+ eglImpl.DestroySurface(mEGLSurface);
+ }
+
+ if(mEGLContext)
+ {
+ eglImpl.DestroyContext(mEGLContext);
+ }
+}
+
+void NativeImageSurfaceEcoreWl::PreRender()
+{
+ MakeContextCurrent();
+}
+
+void NativeImageSurfaceEcoreWl::PostRender()
+{
+ GraphicsInterface* graphics = mGraphics.get();
+ auto eglGraphics = static_cast<EglGraphics*>(graphics);
+ if(eglGraphics)
+ {
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ eglImpl.SwapBuffers(mEGLSurface);
+ }
+}
+
+void NativeImageSurfaceEcoreWl::MakeContextCurrent()
+{
+ if(mEGL != nullptr)
+ {
+ if(mEGLSurface && mEGLContext)
+ {
+ mEGL->MakeContextCurrent(mEGLSurface, mEGLContext);
+ }
+ else
+ {
+ DALI_LOG_ERROR("EGLSurface(%p) or mEGLContext(%p) is null\n", mEGLSurface, mEGLContext);
+ }
+ }
+}
+
+bool NativeImageSurfaceEcoreWl::CanRender()
+{
+ return tbm_surface_queue_can_dequeue(mTbmQueue, 0);
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_IMAGE_SURFACE_IMPL_ECORE_WL_H
+#define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_IMAGE_SURFACE_IMPL_ECORE_WL_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+#include <tbm_surface.h>
+#include <tbm_surface_queue.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+#include <dali/integration-api/adaptor-framework/egl-interface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
+#include <dali/internal/window-system/common/display-connection.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurfaceEcoreWl : public Dali::Internal::Adaptor::NativeImageSurface
+{
+public:
+ /**
+ * @param [in] queue the NativeImageSourceQueue pointer
+ */
+ NativeImageSurfaceEcoreWl(Dali::NativeImageSourceQueuePtr queue);
+
+ /**
+ * @brief Destructor
+ */
+ ~NativeImageSurfaceEcoreWl() = default;
+
+public:
+ /**
+ * @copydoc Dali::NativeImageSurface::GetNativeRenderable()
+ */
+ Any GetNativeRenderable() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::InitializeGraphics()
+ */
+ void InitializeGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::TerminateGraphics()
+ */
+ void TerminateGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PreRender()
+ */
+ void PreRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PostRender()
+ */
+ void PostRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::CanRender()
+ */
+ bool CanRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::SetGraphicsConfig()
+ */
+ bool SetGraphicsConfig(bool depth, bool stencil, int msaa, int version) override;
+
+private:
+ void MakeContextCurrent();
+
+private: // Data
+ std::unique_ptr<Dali::DisplayConnection> mDisplayConnection; ///< The native display connection
+ std::unique_ptr<GraphicsInterface> mGraphics; ///< Graphics interface
+ EglInterface* mEGL;
+ EGLSurface mEGLSurface;
+ EGLContext mEGLContext;
+ ColorDepth mColorDepth;
+ tbm_format mTbmFormat;
+ tbm_surface_queue_h mTbmQueue;
+
+ bool mDepth : 1;
+ bool mStencil : 1;
+ int mGLESVersion;
+ int mMSAA;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_IMAGE_SURFACE_IMPL_ECORE_WL_H
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+#include <dali/internal/window-system/ubuntu-x11/native-image-surface-impl-x.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> NativeImageSurfaceFactory::CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+{
+ return std::make_unique<Internal::Adaptor::NativeImageSurfaceX>(queue);
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/ubuntu-x11/native-image-surface-impl-x.h>
+
+using namespace Dali::Internal::Adaptor;
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+NativeImageSurfaceX::NativeImageSurfaceX(Dali::NativeImageSourceQueuePtr queue)
+{
+}
+
+NativeImageSurfaceX::~NativeImageSurfaceX()
+{
+}
+
+Any NativeImageSurfaceX::GetNativeRenderable()
+{
+ return Any();
+}
+
+void NativeImageSurfaceX::InitializeGraphics()
+{
+}
+
+void NativeImageSurfaceX::TerminateGraphics()
+{
+}
+
+void NativeImageSurfaceX::PreRender()
+{
+}
+
+void NativeImageSurfaceX::PostRender()
+{
+}
+
+bool NativeImageSurfaceX::CanRender()
+{
+ return false;
+}
+
+bool NativeImageSurfaceX::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
+{
+ return false;
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_X_NATIVE_IMAGE_SURFACE_IMPL_X_H
+#define DALI_INTERNAL_WINDOWSYSTEM_X_NATIVE_IMAGE_SURFACE_IMPL_X_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurfaceX : public Dali::Internal::Adaptor::NativeImageSurface
+{
+public:
+ /**
+ * @param [in] queue the NativeImageSourceQueue pointer
+ */
+ NativeImageSurfaceX(Dali::NativeImageSourceQueuePtr queue);
+
+ /**
+ * @brief Destructor
+ */
+ ~NativeImageSurfaceX();
+
+public:
+ /**
+ * @copydoc Dali::NativeImageSurface::GetNativeRenderable()
+ */
+ Any GetNativeRenderable() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::InitializeGraphics()
+ */
+ void InitializeGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::InitializeGraphics()
+ */
+ void TerminateGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PreRender()
+ */
+ void PreRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PostRender()
+ */
+ void PostRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::CanRender()
+ */
+ bool CanRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::SetGraphicsConfig()
+ */
+ bool SetGraphicsConfig(bool depth, bool stencil, int msaa, int version) override;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_X_NATIVE_IMAGE_SURFACE_IMPL_X_H
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+#include <dali/internal/window-system/windows/native-image-surface-impl-win.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> NativeImageSurfaceFactory::CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+{
+ return std::make_unique<Internal::Adaptor::NativeImageSurfaceWin>(queue);
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/windows/native-image-surface-impl-win.cpp>
+
+using namespace Dali::Internal::Adaptor;
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+NativeImageSurfaceWin::NativeImageSurfaceWin(Dali::NativeImageSourceQueuePtr queue)
+{
+}
+
+NativeImageSurfaceWin::~NativeImageSurfaceWin()
+{
+}
+
+Any NativeImageSurfaceWin::GetNativeRenderable()
+{
+ return Any();
+}
+
+void NativeImageSurfaceWin::InitializeGraphics()
+{
+}
+
+void NativeImageSurfaceWin::TerminateGraphics()
+{
+}
+
+void NativeImageSurfaceWin::PreRender()
+{
+}
+
+void NativeImageSurfaceWin::PostRender()
+{
+}
+
+bool NativeImageSurfaceWin::CanRender()
+{
+ return false;
+}
+
+bool NativeImageSurfaceWin::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
+{
+ return false;
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_WIN_NATIVE_IMAGE_SURFACE_IMPL_WIN_H
+#define DALI_INTERNAL_WINDOWSYSTEM_WIN_NATIVE_IMAGE_SURFACE_IMPL_WIN_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class NativeImageSurfaceWin : public Dali::Internal::Adaptor::NativeImageSurface
+{
+public:
+ /**
+ * @param [in] queue the NativeImageSourceQueue pointer
+ */
+ NativeImageSurfaceWin(Dali::NativeImageSourceQueuePtr queue);
+
+ /**
+ * @brief Destructor
+ */
+ ~NativeImageSurfaceWin();
+
+public:
+ /**
+ * @copydoc Dali::NativeImageSurface::GetNativeRenderable()
+ */
+ Any GetNativeRenderable() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::InitializeGraphics()
+ */
+ void InitializeGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::TerminateGraphics()
+ */
+ void TerminateGraphics() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PreRender()
+ */
+ void PreRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::PostRender()
+ */
+ void PostRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::CanRender()
+ */
+ bool CanRender() override;
+
+ /**
+ * @copydoc Dali::NativeImageSurface::SetGraphicsConfig()
+ */
+ bool SetGraphicsConfig(bool depth, bool stencil, int msaa, int version) override;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_WIN_NATIVE_IMAGE_SURFACE_IMPL_WIN_H