../dali-adaptor/dali-test-suite-utils/test-native-image.cpp
../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
+ ../dali-adaptor/dali-test-suite-utils/test-render-surface.cpp
../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
)
dali-test-suite-utils/test-native-image.cpp
dali-test-suite-utils/test-platform-abstraction.cpp
dali-test-suite-utils/test-render-controller.cpp
+ dali-test-suite-utils/test-render-surface.cpp
dali-test-suite-utils/test-trace-call-stack.cpp
dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
)
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
Integration::StencilBufferAvailable::TRUE );
mCore->ContextCreated();
- mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
- mCore->SetDpi( mDpi.x, mDpi.y );
Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
Dali::Integration::Log::InstallLogFunction(logFunction);
Dali::Integration::Trace::LogContext( true, "Test" );
+ mRenderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, mSurfaceWidth, mSurfaceHeight ) );
+ mScene = Dali::Integration::Scene::New( Vector2( static_cast<float>( mSurfaceWidth ), static_cast<float>( mSurfaceHeight ) ) );
+ mScene.SetSurface( *mRenderSurface );
+
+ mScene.SetDpi( Vector2( static_cast<float>( mDpi.x ), static_cast<float>( mDpi.y ) ) );
+
+ mCore->SurfaceResized( mRenderSurface );
+
mCore->SceneCreated();
+ mCore->Initialize();
}
TestApplication::~TestApplication()
{
Dali::Integration::Log::UninstallLogFunction();
+ delete mRenderSurface;
delete mCore;
}
mCore->ProcessEvents();
}
-void TestApplication::SetSurfaceWidth( uint32_t width, uint32_t height )
-{
- mSurfaceWidth = width;
- mSurfaceHeight = height;
-
- mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
-}
-
-void TestApplication::SetTopMargin( uint32_t margin )
-{
- mCore->SetTopMargin( margin );
-}
-
void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location )
{
if( GetUpdateStatus() == 0 &&
#define __DALI_TEST_APPLICATION_H__
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
#include "test-gl-sync-abstraction.h"
#include "test-gl-abstraction.h"
#include "test-render-controller.h"
+#include "test-render-surface.h"
#include <dali/public-api/common/dali-common.h>
#include <dali/integration-api/resource-policies.h>
#include <dali/integration-api/trace.h>
+#include <dali/integration-api/scene.h>
namespace Dali
{
TestGestureManager& GetGestureManager();
void ProcessEvent(const Integration::Event& event);
void SendNotification();
- void SetSurfaceWidth( uint32_t width, unsigned height );
- void SetTopMargin( uint32_t margin );
bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
uint32_t GetUpdateStatus();
bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
mLoggingEnabled = enabled;
}
+ Integration::Scene GetScene() const
+ {
+ return mScene;
+ }
+
private:
void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
TestGlAbstraction mGlAbstraction;
TestGlSyncAbstraction mGlSyncAbstraction;
TestGestureManager mGestureManager;
+ TestRenderSurface* mRenderSurface;
Integration::UpdateStatus mStatus;
Integration::RenderStatus mRenderStatus;
Integration::Core* mCore;
+ Dali::Integration::Scene mScene;
uint32_t mSurfaceWidth;
uint32_t mSurfaceHeight;
--- /dev/null
+/*
+ * Copyright (c) 2019 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.
+ *
+ */
+
+#include "test-render-surface.h"
+
+namespace Dali
+{
+
+TestRenderSurface::TestRenderSurface( Dali::PositionSize positionSize )
+: mPositionSize( positionSize ),
+ mBackgroundColor()
+{
+}
+
+TestRenderSurface::~TestRenderSurface()
+{
+}
+
+Dali::PositionSize TestRenderSurface::GetPositionSize() const
+{
+ return mPositionSize;
+};
+
+void TestRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
+{
+ dpiHorizontal = dpiVertical = 96;
+};
+
+void TestRenderSurface::InitializeGraphics()
+{
+}
+
+void TestRenderSurface::CreateSurface()
+{
+}
+
+void TestRenderSurface::DestroySurface()
+{
+}
+
+bool TestRenderSurface::ReplaceGraphicsSurface()
+{
+ return false;
+}
+
+void TestRenderSurface::MoveResize( Dali::PositionSize positionSize )
+{
+ mPositionSize = positionSize;
+}
+
+void TestRenderSurface::StartRender()
+{
+}
+
+bool TestRenderSurface::PreRender( bool resizingSurface )
+{
+ return true;
+}
+
+void TestRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
+{
+}
+
+void TestRenderSurface::StopRender()
+{
+}
+
+void TestRenderSurface::ReleaseLock()
+{
+}
+
+Dali::Integration::RenderSurface::Type TestRenderSurface::GetSurfaceType()
+{
+ return WINDOW_RENDER_SURFACE;
+}
+
+void TestRenderSurface::MakeContextCurrent()
+{
+}
+
+Integration::DepthBufferAvailable TestRenderSurface::GetDepthBufferRequired()
+{
+ return Integration::DepthBufferAvailable::TRUE;
+}
+
+Integration::StencilBufferAvailable TestRenderSurface::GetStencilBufferRequired()
+{
+ return Integration::StencilBufferAvailable::TRUE;
+}
+
+void TestRenderSurface::SetBackgroundColor( Vector4 color )
+{
+ mBackgroundColor = color;
+}
+
+Vector4 TestRenderSurface::GetBackgroundColor()
+{
+ return mBackgroundColor;
+}
+
+} // Namespace dali
--- /dev/null
+#ifndef TEST_REENDER_SURFACE_H
+#define TEST_REENDER_SURFACE_H
+
+/*
+ * Copyright (c) 2019 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/public-api/common/dali-common.h>
+#include <dali/integration-api/render-surface.h>
+
+namespace Dali
+{
+
+/**
+ * Concrete implementation of the RenderSurface class.
+ */
+class DALI_CORE_API TestRenderSurface : public Dali::Integration::RenderSurface
+{
+public:
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::RenderSurface
+ */
+ TestRenderSurface( Dali::PositionSize positionSize );
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::~RenderSurface
+ */
+ virtual ~TestRenderSurface();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetPositionSize
+ */
+ virtual Dali::PositionSize GetPositionSize() const;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetDpi
+ */
+ virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical );
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::InitializeGraphics
+ */
+ virtual void InitializeGraphics();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::CreateSurface
+ */
+ virtual void CreateSurface();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::DestroySurface
+ */
+ virtual void DestroySurface();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface
+ */
+ virtual bool ReplaceGraphicsSurface();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::MoveResize
+ */
+ virtual void MoveResize( Dali::PositionSize positionSize );
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::StartRender
+ */
+ virtual void StartRender();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::PreRender
+ */
+ virtual bool PreRender( bool resizingSurface );
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::PostRender
+ */
+ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::StopRender
+ */
+ virtual void StopRender();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::ReleaseLock
+ */
+ virtual void ReleaseLock();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetSurfaceType
+ */
+ virtual Dali::Integration::RenderSurface::Type GetSurfaceType();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent
+ */
+ virtual void MakeContextCurrent();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired
+ */
+ virtual Integration::DepthBufferAvailable GetDepthBufferRequired();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired
+ */
+ virtual Integration::StencilBufferAvailable GetStencilBufferRequired();
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::SetBackgroundColor
+ */
+ virtual void SetBackgroundColor( Vector4 color );
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetBackgroundColor
+ */
+ virtual Vector4 GetBackgroundColor();
+
+private:
+
+ /**
+ * @brief Undefined copy constructor. RenderSurface cannot be copied
+ */
+ TestRenderSurface( const TestRenderSurface& rhs );
+
+ /**
+ * @brief Undefined assignment operator. RenderSurface cannot be copied
+ */
+ TestRenderSurface& operator=( const TestRenderSurface& rhs );
+
+private:
+
+ Dali::PositionSize mPositionSize;
+ Vector4 mBackgroundColor; ///< The background color of the surface
+};
+
+} // Dali
+
+#endif
../dali-adaptor/dali-test-suite-utils/test-native-image.cpp
../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
+ ../dali-adaptor/dali-test-suite-utils/test-render-surface.cpp
../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
tct-dali-platform-abstraction-core.cpp
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
GetImplementation( window ).SetPositionSize( positionSize );
}
+void Add( Window window, Dali::Actor actor )
+{
+ GetImplementation( window ).Add( actor );
+}
+
+void Remove( Window window, Dali::Actor actor )
+{
+ GetImplementation( window ).Remove( actor );
+}
+
+void SetBackgroundColor( Window window, Vector4 color )
+{
+ GetImplementation( window ).SetBackgroundColor( color );
+}
+
+Vector4 GetBackgroundColor( Window window )
+{
+ return GetImplementation( window ).GetBackgroundColor();
+}
+
+Dali::Layer GetRootLayer( Window window )
+{
+ return GetImplementation( window ).GetRootLayer();
+}
+
+uint32_t GetLayerCount( Window window )
+{
+ return GetImplementation( window ).GetLayerCount();
+}
+
+Dali::Layer GetLayer( Window window, uint32_t depth )
+{
+ return GetImplementation( window ).GetLayer( depth );
+}
+
} // namespace DevelWindow
} // namespace Dali
#define DALI_WINDOW_DEVEL_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
*/
DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
+/**
+ * @brief Adds a child Actor to the Window.
+ *
+ * The child will be referenced.
+ * @param[in] window The window instance
+ * @param[in] actor The child
+ * @pre The actor has been initialized.
+ * @pre The actor does not have a parent.
+ */
+DALI_ADAPTOR_API void Add( Window window, Dali::Actor actor );
+
+/**
+ * @brief Removes a child Actor from the Window.
+ *
+ * The child will be unreferenced.
+ * @param[in] window The window instance
+ * @param[in] actor The child
+ * @pre The actor has been added to the stage.
+ */
+DALI_ADAPTOR_API void Remove( Window window, Dali::Actor actor );
+
+/**
+ * @brief Sets the background color of the window.
+ *
+ * @param[in] window The window instance
+ * @param[in] color The new background color
+ */
+DALI_ADAPTOR_API void SetBackgroundColor( Window window, Vector4 color );
+
+/**
+ * @brief Gets the background color of the surface.
+ *
+ * @param[in] window The window instance
+ * @return The background color
+ */
+DALI_ADAPTOR_API Vector4 GetBackgroundColor( Window window );
+
+/**
+ * @brief Returns the Scene's Root Layer.
+ *
+ * @param[in] window The window instance
+ * @return The root layer
+ */
+DALI_ADAPTOR_API Dali::Layer GetRootLayer( Window window );
+
+/**
+ * @brief Queries the number of on-stage layers.
+ *
+ * Note that a default layer is always provided (count >= 1).
+ * @param[in] window The window instance
+ * @return The number of layers
+ */
+DALI_ADAPTOR_API uint32_t GetLayerCount( Window window );
+
+/**
+ * @brief Retrieves the layer at a specified depth.
+ *
+ * @param[in] window The window instance
+ * @param[in] depth The depth
+ * @return The layer found at the given depth
+ * @pre Depth is less than layer count; see GetLayerCount().
+ */
+DALI_ADAPTOR_API Dali::Layer GetLayer( Window window, uint32_t depth );
+
+
} // namespace DevelWindow
} // namespace Dali
namespace Dali
{
-class RenderSurface;
+class RenderSurfaceInterface;
namespace Internal
{
* @param[in] surface The surface to draw onto
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface );
+ static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface );
/**
* @brief Create a new adaptor using render surface.
* @param[in] configuration The context loss configuration.
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
+ static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
/**
* @brief Virtual Destructor.
* @param[in] nativeWindow native window handle
* @param[in] surface to use
*/
- void ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface );
+ void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface );
/**
* @brief Get the render surface the adaptor is using to render to.
*
* @return reference to current render surface
*/
- RenderSurface& GetSurface();
+ Dali::RenderSurfaceInterface& GetSurface();
/**
* @brief Gets native window handle
*
*/
+// EXTERNAL INCLUDES
+#include <EGL/egl.h>
+
namespace Dali
{
/**
* Make the OpenGL context current
*/
- virtual void MakeContextCurrent() = 0;
+ virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) = 0;
/**
* Terminate GL
/**
* Performs an OpenGL swap buffers command
*/
- virtual void SwapBuffers() = 0;
+ virtual void SwapBuffers( EGLSurface& eglSurface ) = 0;
/**
* Performs an OpenGL copy buffers command
*/
- virtual void CopyBuffers() = 0;
+ virtual void CopyBuffers( EGLSurface& eglSurface ) = 0;
/**
* Performs an EGL wait GL command
$(adaptor_integration_api_dir)/log-factory-interface.h \
$(adaptor_integration_api_dir)/native-render-surface.h \
$(adaptor_integration_api_dir)/native-render-surface-factory.h \
- $(adaptor_integration_api_dir)/render-surface.h \
+ $(adaptor_integration_api_dir)/render-surface-interface.h \
$(adaptor_integration_api_dir)/thread-synchronization-interface.h \
$(adaptor_integration_api_dir)/trigger-event-interface.h \
$(adaptor_integration_api_dir)/trigger-event-factory-interface.h \
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
+
#ifdef DALI_ADAPTOR_COMPILATION
#include <dali/integration-api/egl-interface.h>
-#include <dali/integration-api/render-surface.h>
+#include <dali/integration-api/render-surface-interface.h>
#else
#include <dali/integration-api/adaptors/egl-interface.h>
-#include <dali/integration-api/adaptors/render-surface.h>
+#include <dali/integration-api/adaptors/render-surface-interface.h>
#endif
namespace Dali
/**
* Native interface of render surface.
*/
-class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurface
+class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurfaceInterface
{
public:
-#ifndef DALI_RENDER_SURFACE_H
-#define DALI_RENDER_SURFACE_H
+#ifndef DALI_RENDER_SURFACE_INTERFACE_H
+#define DALI_RENDER_SURFACE_INTERFACE_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/object/any.h>
-#include <dali/public-api/common/view-mode.h>
+#include <dali/integration-api/render-surface.h>
+#include <dali/integration-api/core-enumerations.h>
+#include <dali/public-api/math/vector4.h>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
-
namespace Dali
{
namespace Internal
{
-
namespace Adaptor
{
-
+class AdaptorInternalServices;
class GraphicsInterface;
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-namespace Integration
-{
-
-class GlAbstraction;
-
-} // namespace Integration
-
-/**
- * @brief The position and size of the render surface.
- */
-typedef Dali::Rect<int> PositionSize;
+}
+}
/**
* @brief Interface for a render surface onto which Dali draws.
* implementation of RenderSurface for the given platform
*/
-class RenderSurface
+class RenderSurfaceInterface : public Dali::Integration::RenderSurface
{
public:
- enum Type
- {
- WINDOW_RENDER_SURFACE,
- PIXMAP_RENDER_SURFACE,
- NATIVE_RENDER_SURFACE
- };
-
/**
* @brief Constructor
* Inlined as this is a pure abstract interface
*/
- RenderSurface() {}
+ RenderSurfaceInterface()
+ : mAdaptor( nullptr ),
+ mGraphics( nullptr ),
+ mDisplayConnection( nullptr ),
+ mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ),
+ mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE ),
+ mBackgroundColor()
+ {}
/**
* @brief Virtual Destructor.
* Inlined as this is a pure abstract interface
*/
- virtual ~RenderSurface() {}
+ virtual ~RenderSurfaceInterface() {}
/**
* @brief Return the size and position of the surface.
* @return The position and size
*/
- virtual PositionSize GetPositionSize() const = 0;
+ virtual Dali::PositionSize GetPositionSize() const = 0;
/**
* @brief Get DPI
/**
* @brief InitializeGraphics the platform specific graphics surface interfaces
- * @param[in] graphics The abstracted graphics interface
- * @param[in] displayConnection The display connection interface
*/
- virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) = 0;
+ virtual void InitializeGraphics() = 0;
/**
* @brief Creates the Surface
/**
* @brief Gets the surface type
*/
- virtual RenderSurface::Type GetSurfaceType() = 0;
+ virtual Dali::Integration::RenderSurface::Type GetSurfaceType() = 0;
+
+ /**
+ * @brief Makes the graphics context current
+ */
+ virtual void MakeContextCurrent() = 0;
+
+ /**
+ * @brief Get whether the depth buffer is required
+ * @return TRUE if the depth buffer is required
+ */
+ virtual Integration::DepthBufferAvailable GetDepthBufferRequired() = 0;
+
+ /**
+ * @brief Get whether the stencil buffer is required
+ * @return TRUE if the stencil buffer is required
+ */
+ virtual Integration::StencilBufferAvailable GetStencilBufferRequired() = 0;
+
+ /**
+ * @brief Sets the background color of the surface.
+ * @param[in] color The new background color
+ */
+ virtual void SetBackgroundColor( Vector4 color ) override
+ {
+ mBackgroundColor = color;
+ }
+
+ /**
+ * @brief Gets the background color of the surface.
+ * @return The background color
+ */
+ virtual Vector4 GetBackgroundColor() override
+ {
+ return mBackgroundColor;
+ }
+
+public:
+
+ void SetAdaptor( Dali::Internal::Adaptor::AdaptorInternalServices& adaptor )
+ {
+ mAdaptor = &adaptor;
+ }
+
+ void SetGraphicsInterface( Dali::Internal::Adaptor::GraphicsInterface& graphics )
+ {
+ mGraphics = &graphics;
+ }
+
+ void SetDisplayConnection( Dali::DisplayConnection& displayConnection )
+ {
+ mDisplayConnection = &displayConnection;
+ }
private:
/**
* @brief Undefined copy constructor. RenderSurface cannot be copied
*/
- RenderSurface( const RenderSurface& rhs );
+ RenderSurfaceInterface( const RenderSurfaceInterface& rhs );
/**
* @brief Undefined assignment operator. RenderSurface cannot be copied
*/
- RenderSurface& operator=( const RenderSurface& rhs );
+ RenderSurfaceInterface& operator=( const RenderSurfaceInterface& rhs );
+
+protected:
+
+ Dali::Internal::Adaptor::AdaptorInternalServices* mAdaptor;
+ Dali::Internal::Adaptor::GraphicsInterface* mGraphics;
+ Dali::DisplayConnection* mDisplayConnection;
+
+private:
+
+ Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required
+ Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required
+
+ Vector4 mBackgroundColor; ///< The background color of the surface
};
} // namespace Dali
-#endif // DALI_RENDER_SURFACE_H
+#endif // DALI_RENDER_SURFACE_INTERFACE_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
} // unnamed namespace
-Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Any nativeWindow, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
{
Dali::Adaptor* adaptor = new Dali::Adaptor;
Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions );
return adaptor;
}
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
{
Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor
Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions ); // Impl adaptor
PositionSize size = defaultWindow.surface->GetPositionSize();
+ defaultWindow.surface->SetAdaptor(*this);
+
mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions);
mGraphics = &( graphicsFactory.Create() );
auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
+ // This will only be created once
+ eglGraphics->Create();
+
GlImplementation& mGLES = eglGraphics->GetGlesInterface();
EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation();
{
Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
}
-
- SetupSystemInformation();
}
Adaptor::~Adaptor()
return;
}
+ mCore->Initialize();
+
+ SetupSystemInformation();
+
// Start the callback manager
mCallbackManager->Start();
defaultWindow.surface->GetDpi( dpiHor, dpiVer );
- // tell core about the DPI value
- mCore->SetDpi(dpiHor, dpiVer);
-
// set the DPI value for font rendering
FontClient fontClient = FontClient::Get();
fontClient.SetDpi( dpiHor, dpiVer );
// Tell the core the size of the surface just before we start the render-thread
- PositionSize size = defaultWindow.surface->GetPositionSize();
-
- mCore->SurfaceResized( size.width, size.height );
+ mCore->SurfaceResized( defaultWindow.surface );
// Initialize the thread controller
mThreadController->Initialize();
mEventHandler->FeedKeyEvent( keyEvent );
}
-void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface )
+void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& newSurface )
{
- PositionSize positionSize = newSurface.GetPositionSize();
-
// Let the core know the surface size has changed
- mCore->SurfaceResized( positionSize.width, positionSize.height );
+ mCore->SurfaceResized( &newSurface );
mResizedSignal.Emit( mAdaptor );
WindowPane newDefaultWindow;
newDefaultWindow.nativeWindow = nativeWindow;
newDefaultWindow.surface = &newSurface;
+ newDefaultWindow.surface->SetAdaptor(*this);
WindowPane oldDefaultWindow = mWindowFrame.front();
oldDefaultWindow.surface = nullptr;
}
-RenderSurface& Adaptor::GetSurface() const
+Dali::RenderSurfaceInterface& Adaptor::GetSurface() const
{
WindowPane defaultWindow = mWindowFrame.front();
return *(defaultWindow.surface);
bool Adaptor::AddWindow( Dali::Window* childWindow, const std::string& childWindowName, const std::string& childWindowClassName, const bool& childWindowMode )
{
+ Window& windowImpl = Dali::GetImplementation( *childWindow );
+ windowImpl.SetAdaptor( Get() );
+
// This is any Window that is not the main (default) one
WindowPane additionalWindow;
additionalWindow.instance = childWindow;
additionalWindow.window_name = childWindowName;
additionalWindow.class_name = childWindowClassName;
additionalWindow.window_mode = childWindowMode;
+ additionalWindow.surface = windowImpl.GetSurface();
+ additionalWindow.id = windowImpl.GetId();
// Add the new Window to the Frame - the order is not important
mWindowFrame.push_back( additionalWindow );
- Window& windowImpl = Dali::GetImplementation( *childWindow );
- windowImpl.SetAdaptor( Get() );
-
return true;
}
return false;
}
+bool Adaptor::RemoveWindow( Window* childWindow )
+{
+ for ( WindowFrames::iterator iter = mWindowFrame.begin(); iter != mWindowFrame.end(); ++iter )
+ {
+ if( iter->id == childWindow->GetId() )
+ {
+ mWindowFrame.erase( iter );
+ return true;
+ }
+ }
+
+ return false;
+}
+
Dali::Adaptor& Adaptor::Get()
{
DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
return mSocketFactory;
}
-RenderSurface* Adaptor::GetRenderSurfaceInterface()
+Dali::RenderSurfaceInterface* Adaptor::GetRenderSurfaceInterface()
{
if( !mWindowFrame.empty())
{
RequestUpdate( false );
}
-void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
{
// Let the core know the surface size has changed
- mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
+ mCore->SurfaceResized( surface );
mResizedSignal.Emit( mAdaptor );
}
-void Adaptor::SurfaceResizeComplete( SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
{
// Flush the event queue to give the update-render thread chance
// to start processing messages for new camera setup etc as soon as possible
}
}
-void Adaptor::IndicatorSizeChanged(int height)
-{
- // Let the core know the indicator height is changed
- mCore->SetTopMargin(height);
-}
-
bool Adaptor::ProcessCoreEventsFromIdle()
{
ProcessCoreEvents();
return false;
}
-Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions)
+Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions)
: mResizedSignal(),
mLanguageChangedSignal(),
mAdaptor( adaptor ),
WindowPane defaultWindow;
defaultWindow.nativeWindow = nativeWindow;
defaultWindow.surface = surface;
+ defaultWindow.id = 0;
std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
iter = mWindowFrame.insert( iter, defaultWindow );
namespace Dali
{
-class RenderSurface;
+class RenderSurfaceInterface;
class Window;
namespace Integration
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
static Dali::Adaptor* New( Any nativeWindow,
- RenderSurface* surface,
+ Dali::RenderSurfaceInterface* surface,
Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
*/
static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
Any nativeWindow,
- RenderSurface* surface,
+ Dali::RenderSurfaceInterface* surface,
Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
/**
* @copydoc AdaptorInterface::ReplaceSurface()
*/
- virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface );
+ virtual void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface );
/**
* @copydoc Dali::Adaptor::GetSurface()
*/
- virtual RenderSurface& GetSurface() const;
+ virtual Dali::RenderSurfaceInterface& GetSurface() const;
/**
* @copydoc Dali::Adaptor::ReleaseSurfaceLock()
*/
void SetPreRenderCallback( CallbackBase* callback );
+ /**
+ * Removes an existing Window instance from the Adaptor
+ * @param[in] childWindow The Window instance
+ */
+ bool RemoveWindow( Dali::Internal::Adaptor::Window* childWindow );
+
public:
/**
void RequestUpdateOnce();
/**
- * Request adaptor to update indicator's height
- */
- void IndicatorSizeChanged(int height);
-
- /**
* @copydoc Dali::Adaptor::NotifySceneCreated()
*/
void NotifySceneCreated();
/**
* Informs core the surface size has changed
*/
- void SurfaceResizePrepare( SurfaceSize surfaceSize );
+ void SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
/**
* Informs ThreadController the surface size has changed
*/
- void SurfaceResizeComplete( SurfaceSize surfaceSize );
+ void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
/**
* Sets layout direction of root by system language
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetRenderSurfaceInterface()
*/
- virtual RenderSurface* GetRenderSurfaceInterface();
+ virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface();
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetVSyncMonitorInterface()
* Assigns the render surface to the adaptor
*
*/
- void SetSurface(RenderSurface *surface);
+ void SetSurface(Dali::RenderSurfaceInterface *surface);
/**
* called after surface is created
* - Window, adaptor will use existing Window to draw on to
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
- Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions );
+ Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions );
private: // Types
std::string class_name; ///< Class name that the window belongs to
bool window_mode; ///< Display mode of the window
Any nativeWindow; ///< window identifier
- RenderSurface* surface; ///< The surface the Window is bound to
+ uint32_t id; ///< unique Window ID
+ Dali::RenderSurfaceInterface* surface; ///< The surface the Window is bound to
} WindowPane;
typedef std::vector<WindowPane> WindowFrames;
// INTERNAL INCLUDES
#include <dali/integration-api/trigger-event-interface.h>
#include <dali/integration-api/trigger-event-factory-interface.h>
+#include <dali/integration-api/render-surface-interface.h>
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/graphics/common/graphics-interface.h>
#include <dali/internal/graphics/gles/egl-factory-interface.h>
#include <dali/internal/network/common/trace-interface.h>
#include <dali/integration-api/render-surface.h>
-
namespace Dali
{
/**
* @return render surface
*/
- virtual RenderSurface* GetRenderSurfaceInterface() = 0;
+ virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() = 0;
/**
* @return vsync monitor interface
return *adaptor;
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface )
{
return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
{
- Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
+ Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
return *adaptor;
}
mImpl->RemoveIdle( callback );
}
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface )
{
mImpl->ReplaceSurface(nativeWindow, surface);
}
return mImpl->LanguageChangedSignal();
}
-RenderSurface& Adaptor::GetSurface()
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
{
return mImpl->GetSurface();
}
#include <dali/internal/adaptor/common/framework.h>
#include <dali/internal/system/common/singleton-service-impl.h>
#include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
+#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
+#undef Status
+
namespace Dali
{
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
#include <dali/internal/system/common/time-service.h>
#include <dali/internal/adaptor/common/adaptor-internal-services.h>
#include <dali/devel-api/adaptor-framework/thread-settings.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
namespace Dali
{
SetRenderRefreshRate( environmentOptions.GetRenderRefreshRate() );
// Set the thread-synchronization interface on the render-surface
- RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ Dali::RenderSurfaceInterface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->SetThreadSynchronization( *this );
sem_wait( &mEventThreadSemaphore );
}
- RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->StartRender();
LOG_EVENT_TRACE;
// Stop Rendering and the Update/Render Thread
- RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->StopRender();
}
}
-void CombinedUpdateRenderController::ReplaceSurface( RenderSurface* newSurface )
+void CombinedUpdateRenderController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
{
LOG_EVENT_TRACE;
LOG_UPDATE_RENDER( "THREAD CREATED" );
- RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ // Initialize EGL & OpenGL
+ Dali::DisplayConnection& displayConnection = mAdaptorInterfaces.GetDisplayConnectionInterface();
+ displayConnection.Initialize();
+
+ RenderSurfaceInterface* currentSurface = nullptr;
+
+#if DALI_GLES_VERSION >= 30
+
+ GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface();
+ EglGraphics* eglGraphics = static_cast<EglGraphics *>(&graphics);
+
+ // This will only be created once
+ EglInterface* eglInterface = &eglGraphics->GetEglInterface();
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( *eglInterface );
+ eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ); // Always use this for shared context???
+
+ // Create a surfaceless OpenGL context for shared resources
+ eglImpl.CreateContext();
+ eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() );
+
+#else // DALI_GLES_VERSION >= 30
+
+ currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
- currentSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
+ currentSurface->InitializeGraphics();
+ currentSurface->MakeContextCurrent();
}
+#endif
+
// Tell core it has a context
mCore.ContextCreated();
// REPLACE SURFACE
//////////////////////////////
- RenderSurface* newSurface = ShouldSurfaceBeReplaced();
+ Integration::RenderSurface* newSurface = ShouldSurfaceBeReplaced();
if( DALI_UNLIKELY( newSurface ) )
{
LOG_UPDATE_RENDER_TRACE_FMT( "Replacing Surface" );
// If the new surface has a different display connection, then the context will be lost
mAdaptorInterfaces.GetDisplayConnectionInterface().Initialize();
- newSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
+ newSurface->InitializeGraphics();
newSurface->ReplaceGraphicsSurface();
SurfaceReplaced();
}
}
// Check resize
- bool surfaceResized = false;
bool shouldSurfaceBeResized = ShouldSurfaceBeResized();
if( DALI_UNLIKELY( shouldSurfaceBeResized ) )
{
{
LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" );
SurfaceResized();
- surfaceResized = true;
}
}
}
}
- currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
- if( currentSurface )
- {
- currentSurface->PreRender( surfaceResized );
- }
+#if DALI_GLES_VERSION >= 30
+ // Make the shared surfaceless context as current before rendering
+ eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() );
+#endif
Integration::RenderStatus renderStatus;
mForceClear = false;
- if( renderStatus.NeedsPostRender() )
- {
- if( currentSurface )
- {
- currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), surfaceResized );
- }
- }
-
// Trigger event thread to request Update/Render thread to sleep if update not required
if( ( Integration::KeepUpdating::NOT_REQUESTED == keepUpdatingStatus ) && !renderStatus.NeedsUpdate() )
{
return ! mDestroyUpdateRenderThread;
}
-RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced()
+Integration::RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced()
{
ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
- RenderSurface* newSurface = mNewSurface;
+ Integration::RenderSurface* newSurface = mNewSurface;
mNewSurface = NULL;
return newSurface;
namespace Dali
{
-class RenderSurface;
+class RenderSurfaceInterface;
class TriggerEventInterface;
namespace Internal
/**
* @copydoc ThreadControllerInterface::ReplaceSurface()
*/
- virtual void ReplaceSurface( RenderSurface* surface );
+ virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
/**
* @copydoc ThreadControllerInterface::ResizeSurface()
*
* @return Pointer to the new surface, NULL otherwise
*/
- RenderSurface* ShouldSurfaceBeReplaced();
+ Integration::RenderSurface* ShouldSurfaceBeReplaced();
/**
* Called by the Update/Render thread after a surface has been replaced.
volatile unsigned int mUseElapsedTimeAfterWait; ///< Whether we should use the elapsed time after waiting (set by the event-thread, read by the update-render-thread).
- RenderSurface* volatile mNewSurface; ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
+ Integration::RenderSurface* volatile mNewSurface; ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
volatile unsigned int mPostRendering; ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
volatile unsigned int mSurfaceResized; ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread).
namespace Dali
{
-class RenderSurface;
+class RenderSurfaceInterface;
namespace Internal
{
* Replaces the surface.
* @param surface new surface
*/
- virtual void ReplaceSurface( RenderSurface* surface ) = 0;
+ virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) = 0;
/**
* Resize the surface.
mApplicationType = type;
mCallbackManager = CallbackManager::New();
- char* region;
- char* language;
+ char* region = nullptr;
+ char* language = nullptr;
system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ®ion );
system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language );
- mRegion = std::string( region );
- mLanguage = std::string( language );
+
+ if (region != nullptr)
+ {
+ mRegion = std::string( region );
+ }
+
+ if ( language != nullptr)
+ {
+ mLanguage = std::string( language );
+ }
}
~Impl()
{
}
-//Dali::Integration::GlAbstraction& EglGraphics::GetGlesInterface()
GlImplementation& EglGraphics::GetGlesInterface()
{
return *mGLES;
mColorDepth( COLOR_DEPTH_24 ),
mGlesInitialized( false ),
mIsOwnSurface( true ),
- mContextCurrent( false ),
mIsWindow( true ),
mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE )
return true;
}
-void EglImplementation::DestroyContext()
+bool EglImplementation::CreateWindowContext( EGLContext& eglContext )
+{
+ // make sure a context isn't created twice
+ DALI_ASSERT_ALWAYS( (eglContext == 0) && "EGL context recreated" );
+
+ eglContext = eglCreateContext(mEglDisplay, mEglConfig, mEglContext, &(mContextAttribs[0]));
+ TEST_EGL_ERROR("eglCreateContext render thread");
+
+ DALI_ASSERT_ALWAYS( EGL_NO_CONTEXT != eglContext && "EGL context not created" );
+
+ DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VENDOR : %s ***\n", glGetString(GL_VENDOR));
+ DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_RENDERER : %s ***\n", glGetString(GL_RENDERER));
+ DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VERSION : %s ***\n", glGetString(GL_VERSION));
+ DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_SHADING_LANGUAGE_VERSION : %s***\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
+ DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** Supported Extensions ***\n%s\n\n", glGetString(GL_EXTENSIONS));
+
+ mEglWindowContexts.push_back( eglContext );
+
+ return true;
+}
+
+void EglImplementation::DestroyContext( EGLContext& eglContext )
{
DALI_ASSERT_ALWAYS( mEglContext && "no EGL context" );
- eglDestroyContext( mEglDisplay, mEglContext );
- mEglContext = 0;
+ eglDestroyContext( mEglDisplay, eglContext );
+ eglContext = 0;
}
-void EglImplementation::DestroySurface()
+void EglImplementation::DestroySurface( EGLSurface& eglSurface )
{
- if(mIsOwnSurface && mCurrentEglSurface)
+ if(mIsOwnSurface && eglSurface)
{
// Make context null to prevent crash in driver side
MakeContextNull();
- eglDestroySurface( mEglDisplay, mCurrentEglSurface );
- mCurrentEglSurface = 0;
+ eglDestroySurface( mEglDisplay, eglSurface );
+ eglSurface = 0;
}
}
-void EglImplementation::MakeContextCurrent()
+void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext )
{
- mContextCurrent = true;
+ mCurrentEglSurface = eglSurface;
if(mIsOwnSurface)
{
- eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, mEglContext );
+ eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext );
}
EGLint error = eglGetError();
if(mIsOwnSurface)
{
- eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, mEglContext );
+ eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext );
}
EGLint error = eglGetError();
void EglImplementation::MakeContextNull()
{
- mContextCurrent = false;
// clear the current context
eglMakeCurrent( mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
}
// Make context null to prevent crash in driver side
MakeContextNull();
- if(mIsOwnSurface && mCurrentEglSurface)
+ for ( auto eglSurface : mEglWindowSurfaces )
{
- eglDestroySurface(mEglDisplay, mCurrentEglSurface);
+ if(mIsOwnSurface && eglSurface)
+ {
+ eglDestroySurface(mEglDisplay, eglSurface);
+ }
}
eglDestroyContext(mEglDisplay, mEglContext);
+ for ( auto eglContext : mEglWindowContexts )
+ {
+ eglDestroyContext(mEglDisplay, eglContext);
+ }
eglTerminate(mEglDisplay);
return mGlesInitialized;
}
-void EglImplementation::SwapBuffers()
+void EglImplementation::SwapBuffers( EGLSurface& eglSurface )
{
- eglSwapBuffers( mEglDisplay, mCurrentEglSurface );
+ if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
+ {
+ eglSwapBuffers( mEglDisplay, eglSurface );
+ }
}
-void EglImplementation::CopyBuffers()
+void EglImplementation::CopyBuffers( EGLSurface& eglSurface )
{
- eglCopyBuffers( mEglDisplay, mCurrentEglSurface, mCurrentEglNativePixmap );
+ eglCopyBuffers( mEglDisplay, eglSurface, mCurrentEglNativePixmap );
}
void EglImplementation::WaitGL()
return;
}
+ bool isTransparent = ( depth == COLOR_DEPTH_32 );
+
mIsWindow = isWindowType;
EGLint numConfigs;
configAttribs.PushBack( EGL_BLUE_SIZE );
configAttribs.PushBack( 8 );
- configAttribs.PushBack( EGL_ALPHA_SIZE );
+ if ( isTransparent )
+ {
+ configAttribs.PushBack( EGL_ALPHA_SIZE );
#ifdef _ARCH_ARM_
- // For underlay video playback, we also need to set the alpha value of the 24/32bit window.
- configAttribs.PushBack( 8 );
+ // For underlay video playback, we also need to set the alpha value of the 24/32bit window.
+ configAttribs.PushBack( 8 );
#else
- // There is a bug in the desktop emulator
- // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing
- configAttribs.PushBack( 0 );
+ // There is a bug in the desktop emulator
+ // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing
+ configAttribs.PushBack( 8 );
#endif // _ARCH_ARM_
+ }
configAttribs.PushBack( EGL_DEPTH_SIZE );
configAttribs.PushBack( mDepthBufferRequired ? 24 : 0 );
}
}
-void EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth )
+EGLSurface EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth )
{
- DALI_ASSERT_ALWAYS( ( mCurrentEglSurface == 0 ) && "EGL surface already exists" );
-
mEglNativeWindow = window;
mColorDepth = depth;
mIsWindow = true;
TEST_EGL_ERROR("eglCreateWindowSurface");
DALI_ASSERT_ALWAYS( mCurrentEglSurface && "Create window surface failed" );
+
+ return mCurrentEglSurface;
}
EGLSurface EglImplementation::CreateSurfacePixmap( EGLNativePixmapType pixmap, ColorDepth depth )
return mCurrentEglSurface;
}
-bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window )
+bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext )
{
bool contextLost = false;
MakeContextNull();
// destroy the surface
- DestroySurface();
+ DestroySurface( eglSurface );
// create the EGL surface
CreateSurfaceWindow( window, mColorDepth );
// set the context to be current with the new surface
- MakeContextCurrent();
+ MakeContextCurrent( eglSurface, eglContext );
return contextLost;
}
return mEglDisplay;
}
-EGLDisplay EglImplementation::GetContext() const
+EGLContext EglImplementation::GetContext() const
{
return mEglContext;
}
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/common/vector-wrapper.h>
#include <dali/integration-api/core-enumerations.h>
// INTERNAL INCLUDES
bool InitializeGles( EGLNativeDisplayType display, bool isOwnSurface = true );
/**
- * Create the OpenGL context.
+ * Create the OpenGL context for the shared resource.
* @return true if successful
*/
virtual bool CreateContext();
/**
+ * Create the OpenGL context for the window.
+ * @return true if successful
+ */
+ bool CreateWindowContext( EGLContext& mEglContext );
+
+ /**
* Destroy the OpenGL context.
*/
- void DestroyContext();
+ void DestroyContext( EGLContext& eglContext );
/**
* Destroy the OpenGL surface.
*/
- void DestroySurface();
+ void DestroySurface( EGLSurface& eglSurface );
/**
* Make the OpenGL context current
*/
- virtual void MakeContextCurrent();
+ virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext );
/**
* clear the OpenGL context
/**
* Performs an OpenGL swap buffers command
*/
- virtual void SwapBuffers();
+ virtual void SwapBuffers( EGLSurface& eglSurface );
/**
* Performs an OpenGL copy buffers command
*/
- virtual void CopyBuffers();
+ virtual void CopyBuffers( EGLSurface& eglSurface );
/**
* Performs an EGL wait GL command
* Create an OpenGL surface using a window
* @param window The window to create the surface on
* @param colorDepth Bit per pixel value (ex. 32 or 24)
- * @return true on success, false on failure
+ * @return Handle to an on-screen EGL window surface (the requester has an ownership of this egl surface)
*/
- void CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth );
+ EGLSurface CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth );
/**
* Create the OpenGL surface using a pixmap
* @return true if the context was lost due to a change in display
* between old surface and new surface
*/
- bool ReplaceSurfaceWindow( EGLNativeWindowType window );
+ bool ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext );
/**
* Replaces the render surface
EGLDisplay mEglDisplay;
EGLConfig mEglConfig;
- EGLContext mEglContext;
+ EGLContext mEglContext; ///< The resource context holding assets such as textures to be shared
+
+ typedef std::vector<EGLContext> EglWindowContextContainer;
+ EglWindowContextContainer mEglWindowContexts; ///< The EGL context for the window
+
EGLSurface mCurrentEglSurface;
+ typedef std::vector<EGLSurface> EglWindowSurfaceContainer;
+ EglWindowSurfaceContainer mEglWindowSurfaces; ///< The EGL surface for the window
+
int mMultiSamplingLevel;
ColorDepth mColorDepth;
bool mGlesInitialized;
bool mIsOwnSurface;
- bool mContextCurrent;
bool mIsWindow;
bool mDepthBufferRequired;
bool mStencilBufferRequired;
// If we fail to get window id, we can't use the InputMethodContext correctly.
// Thus you have to call "ecore_imf_context_client_window_set" somewhere.
// In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().
- RenderSurface& renderSurface = Dali::Adaptor::Get().GetSurface();
+ Dali::RenderSurfaceInterface& renderSurface = Dali::Adaptor::Get().GetSurface();
WindowRenderSurface& windowRenderSurface = static_cast< WindowRenderSurface& >( renderSurface );
int windowId = windowRenderSurface.GetNativeWindowId();
mThreadControllerInterface->RequestUpdateOnce();
}
-void ThreadController::ReplaceSurface( RenderSurface* newSurface )
+void ThreadController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
{
mThreadControllerInterface->ReplaceSurface( newSurface );
}
namespace Dali
{
-class RenderSurface;
+class RenderSurfaceInterface;
namespace Internal
{
*
* @param surface new surface
*/
- void ReplaceSurface( RenderSurface* surface );
+ void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
/**
* Resize the surface.
* Sets the render surface type
* @param[in] type The render surface type
*/
- virtual void SetSurfaceType( RenderSurface::Type type ) = 0;
+ virtual void SetSurfaceType( Integration::RenderSurface::Type type ) = 0;
/**
* Sets the graphics interface
return new DisplayConnection(internal);
}
-DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type )
+DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Integration::RenderSurface::Type type )
{
auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
auto displayConnection = factory->CreateDisplayConnection();
* @param[in] type Render surface type
* @return A handle to a newly allocated DisplayConnection resource.
*/
- static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type );
+ static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Integration::RenderSurface::Type type );
/**
* @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
} // unnamed namespace
-EventHandler::EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector )
+EventHandler::EventHandler( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector )
: mCoreEventInterface( coreEventInterface ),
mGestureManager( gestureManager ),
mStyleMonitor( StyleMonitor::Get() ),
namespace Dali
{
+namespace Integration
+{
+
class RenderSurface;
+}
+
namespace Internal
{
* @param[in] damageObserver The damage observer (to pass damage events to).
* @param[in] dndDetector The Drag & Drop listener (to pass DnD events to).
*/
- EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector );
+ EventHandler( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector );
/**
* Destructor.
// INTERNAL INCLUDES
#include <dali/integration-api/native-render-surface.h>
#include <dali/internal/window-system/common/render-surface-factory.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
namespace Dali
{
*/
// INTERNAL INCLUDES
-#include <dali/integration-api/render-surface.h>
+
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/render-surface-interface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
+#else
+#include <dali/integration-api/adaptors/render-surface-interface.h>
+#endif
+
namespace Dali
{
/**
* Pixmap interface of render surface.
*/
-class PixmapRenderSurface : public Dali::RenderSurface
+class PixmapRenderSurface : public Dali::RenderSurfaceInterface
{
public:
*/
virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) = 0;
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired()
+ */
+ Integration::DepthBufferAvailable GetDepthBufferRequired() override
+ {
+ return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE;
+ }
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired()
+ */
+ Integration::StencilBufferAvailable GetStencilBufferRequired() override
+ {
+ return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
+ }
+
private:
/**
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
// EXTERNAL HEADERS
#include <dali/integration-api/core.h>
#include <dali/integration-api/render-task-list-integ.h>
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/actors/layer.h>
#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/rendering/frame-buffer.h>
#include <dali/devel-api/adaptor-framework/orientation.h>
// INTERNAL HEADERS
namespace Adaptor
{
+uint32_t Window::mWindowCounter = 0;
+
namespace
{
}
Window::Window()
-: mSurface( NULL ),
+: mId( mWindowCounter++ ),
+ mSurface( nullptr ),
mWindowBase(),
mStarted( false ),
- mIsTransparent( false ),
mIsFocusAcceptable( true ),
mVisible( true ),
mIconified( false ),
{
mAdaptor->RemoveObserver( *this );
mAdaptor->SetDragAndDropDetector( NULL );
+ mAdaptor->RemoveWindow( this );
mAdaptor = NULL;
}
- delete mSurface;
+ mSurface.reset( nullptr );
}
void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
// Create a window render surface
Any surface;
auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
- auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
- mSurface = windowRenderSurface.release();
+ mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
// Get a window base
mWindowBase = mSurface->GetWindowBase();
DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
mStarted = true;
+ PositionSize positionSize = mSurface->GetPositionSize();
+ mScene = Dali::Integration::Scene::New( Vector2(positionSize.width, positionSize.height) );
+ mScene.SetSurface( *mSurface.get() );
+
+ unsigned int dpiHorizontal, dpiVertical;
+ dpiHorizontal = dpiVertical = 0;
+
+ mSurface->GetDpi( dpiHorizontal, dpiVertical );
+ mScene.SetDpi( Vector2( static_cast<float>( dpiHorizontal ), static_cast<float>( dpiVertical ) ) );
+
// Create one overlay for the main window only
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
mAdaptor = &adaptorImpl;
WindowRenderSurface* Window::GetSurface()
{
- return mSurface;
+ return mSurface.get();
}
void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
mWindowBase->Activate();
}
+void Window::Add( Dali::Actor actor )
+{
+ mScene.Add( actor );
+}
+
+void Window::Remove( Dali::Actor actor )
+{
+ mScene.Remove( actor );
+}
+
+Dali::Layer Window::GetRootLayer() const
+{
+ return mScene.GetRootLayer();
+}
+
+uint32_t Window::GetLayerCount() const
+{
+ return mScene.GetLayerCount();
+}
+
+Dali::Layer Window::GetLayer( uint32_t depth ) const
+{
+ return mScene.GetLayer( depth );
+}
+
+void Window::SetBackgroundColor( Vector4 color )
+{
+ if ( mSurface )
+ {
+ mSurface->SetBackgroundColor( color );
+ }
+}
+
+Vector4 Window::GetBackgroundColor() const
+{
+ return mSurface ? mSurface->GetBackgroundColor() : Vector4();
+}
+
void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
{
bool found = false;
{
Uint16Pair newSize( newRect.width, newRect.height );
- mAdaptor->SurfaceResizePrepare( newSize );
+ mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
mResizedSignal.Emit( newSize );
- mAdaptor->SurfaceResizeComplete( newSize );
+ mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
}
}
{
Uint16Pair newSize( newRect.width, newRect.height );
- mAdaptor->SurfaceResizePrepare( newSize );
+ mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
mResizedSignal.Emit( newSize );
- mAdaptor->SurfaceResizeComplete( newSize );
+ mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
}
}
{
mSurface->RequestRotation( orientation, width, height );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
// Emit signal
mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
- mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
}
void Window::OnIconifyChanged( bool iconified )
void Window::OnOutputTransformed()
{
PositionSize positionSize = mSurface->GetPositionSize();
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
- mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
}
void Window::OnDeleteRequest()
mAdaptor = NULL;
}
+uint32_t Window::GetId() const
+{
+ return mId;
+}
+
} // Adaptor
} // Internal
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
// EXTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/integration-api/scene.h>
// INTERNAL INCLUDES
#include <dali/internal/adaptor/common/lifecycle-observer.h>
namespace Dali
{
class Adaptor;
+class Actor;
namespace Internal
{
void Activate();
/**
+ * @copydoc Dali::Window::Add()
+ */
+ void Add( Dali::Actor actor );
+
+ /**
+ * @copydoc Dali::Window::Remove()
+ */
+ void Remove( Dali::Actor remove );
+
+ /**
+ * @copydoc Dali::Window::SetBackgroundColor()
+ */
+ void SetBackgroundColor(Vector4 color);
+
+ /**
+ * @copydoc Dali::Window::GetBackgroundColor()
+ */
+ Vector4 GetBackgroundColor() const;
+
+ /**
+ * @copydoc Dali::Window::GetRootLayer()
+ */
+ Dali::Layer GetRootLayer() const;
+
+ /**
+ * @copydoc Dali::Window::GetLayerCount()
+ */
+ uint32_t GetLayerCount() const;
+
+ /**
+ * @copydoc Dali::Window::GetLayer()
+ */
+ Dali::Layer GetLayer( uint32_t depth ) const;
+
+ /**
* @copydoc Dali::Window::AddAvailableOrientation()
*/
void AddAvailableOrientation(Dali::Window::WindowOrientation orientation);
*/
void RotationDone( int orientation, int width, int height );
+ /**
+ * @brief Retrieves the unique ID of the window.
+ * @return The ID
+ */
+ uint32_t GetId() const;
+
private:
/**
private:
- WindowRenderSurface* mSurface;
+ static uint32_t mWindowCounter; ///< A counter to track the window creation
+ uint32_t mId; ///< A unique ID to identify the window starting from 0
+ std::unique_ptr< WindowRenderSurface > mSurface;
+ Dali::Integration::Scene mScene;
WindowBase* mWindowBase;
bool mStarted:1;
bool mIsTransparent:1;
std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
Dali::Window::WindowOrientation mPreferredOrientation;
+ Vector4 mBackgroundColor;
+
// Signals
IndicatorSignalType mIndicatorVisibilityChangedSignal;
FocusSignalType mFocusChangedSignal;
#include <dali/integration-api/thread-synchronization-interface.h>
#include <dali/internal/graphics/gles/egl-implementation.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
#include <dali/internal/window-system/common/window-base.h>
#include <dali/internal/window-system/common/window-factory.h>
#include <dali/internal/window-system/common/window-system.h>
mRenderNotification( NULL ),
mRotationTrigger( NULL ),
mGraphics( nullptr ),
+ mEGLSurface( nullptr ),
+ mEGLContext( nullptr ),
mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
mOutputTransformedSignal(),
mRotationAngle( 0 ),
mWindowBase->GetDpi( dpiHorizontal, dpiVertical );
}
-void WindowRenderSurface::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
+void WindowRenderSurface::InitializeGraphics()
{
- mGraphics = &graphics;
- auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
-
- EglInterface* mEGL = eglGraphics->Create();
-
- // Initialize EGL & OpenGL
- displayConnection.Initialize();
+ mGraphics = &mAdaptor->GetGraphicsInterface();
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
- eglImpl.ChooseConfig(true, mColorDepth);
-
- // Create the OpenGL context
- mEGL->CreateContext();
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ mEGL = &eglGraphics->GetEglInterface();
- // Create the OpenGL surface
- CreateSurface();
+ if ( mEGLContext == NULL )
+ {
+ // Create the OpenGL context for this window
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+ eglImpl.ChooseConfig(true, mColorDepth);
+ eglImpl.CreateWindowContext( mEGLContext );
- // Make it current
- mEGL->MakeContextCurrent();
+ // Create the OpenGL surface
+ CreateSurface();
+ }
}
void WindowRenderSurface::CreateSurface()
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.CreateSurfaceWindow( window, mColorDepth );
+ mEGLSurface = eglImpl.CreateSurfaceWindow( window, mColorDepth );
// Check rotation capability
mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.DestroySurface();
+ eglImpl.DestroySurface( mEGLSurface );
mWindowBase->DestroyEglWindow();
}
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- return eglImpl.ReplaceSurfaceWindow( window );
+ return eglImpl.ReplaceSurfaceWindow( window, mEGLSurface, mEGLContext );
}
void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
bool WindowRenderSurface::PreRender( bool resizingSurface )
{
+ MakeContextCurrent();
+
if( resizingSurface )
{
#ifdef OVER_TIZEN_VERSION_4
}
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers();
+ eglImpl.SwapBuffers( mEGLSurface );
if( mRenderNotification )
{
// Nothing to do.
}
-RenderSurface::Type WindowRenderSurface::GetSurfaceType()
+Integration::RenderSurface::Type WindowRenderSurface::GetSurfaceType()
{
return RenderSurface::WINDOW_RENDER_SURFACE;
}
+void WindowRenderSurface::MakeContextCurrent()
+{
+ if ( mEGL != nullptr )
+ {
+ mEGL->MakeContextCurrent( mEGLSurface, mEGLContext );
+ }
+}
+
+Integration::DepthBufferAvailable WindowRenderSurface::GetDepthBufferRequired()
+{
+ return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE;
+}
+
+Integration::StencilBufferAvailable WindowRenderSurface::GetStencilBufferRequired()
+{
+ return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
+}
+
void WindowRenderSurface::OutputTransformed()
{
int screenRotationAngle = mWindowBase->GetScreenRotationAngle();
*/
// INTERNAL INCLUDES
-#include <dali/integration-api/render-surface.h>
-#include <dali/integration-api/egl-interface.h>
#include <dali/internal/graphics/common/graphics-interface.h>
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/egl-interface.h>
+#include <dali/integration-api/render-surface-interface.h>
+#else
+#include <dali/integration-api/adaptors/egl-interface.h>
+#include <dali/integration-api/adaptors/render-surface-interface.h>
+#endif
+
// EXTERNAL INCLUDES
#include <dali/public-api/signals/connection-tracker.h>
#include <dali/public-api/signals/dali-signal.h>
-
namespace Dali
{
{
class WindowBase;
+class AdaptorInternalServices;
/**
* Window interface of render surface.
*/
-class WindowRenderSurface : public Dali::RenderSurface, public ConnectionTracker
+class WindowRenderSurface : public Dali::RenderSurfaceInterface, public ConnectionTracker
{
public:
*/
OutputSignalType& OutputTransformedSignal();
-public: // from Dali::RenderSurface
+public: // from Dali::Integration::RenderSurface
/**
- * @copydoc Dali::RenderSurface::GetPositionSize()
+ * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const override;
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::RenderSurface::InitializeGraphics()
+ * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
+ virtual void InitializeGraphics() override;
/**
- * @copydoc Dali::RenderSurface::CreateSurface()
+ * @copydoc Dali::Integration::RenderSurface::CreateSurface()
*/
virtual void CreateSurface() override;
/**
- * @copydoc Dali::RenderSurface::DestroySurface()
+ * @copydoc Dali::Integration::RenderSurface::DestroySurface()
*/
virtual void DestroySurface() override;
/**
- * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
+ * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
*/
virtual bool ReplaceGraphicsSurface() override;
/**
- * @copydoc Dali::RenderSurface::MoveResize()
+ * @copydoc Dali::Integration::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize) override;
/**
- * @copydoc Dali::RenderSurface::StartRender()
+ * @copydoc Dali::Integration::RenderSurface::StartRender()
*/
virtual void StartRender() override;
/**
- * @copydoc Dali::RenderSurface::PreRender()
+ * @copydoc Dali::Integration::RenderSurface::PreRender()
*/
virtual bool PreRender( bool resizingSurface ) override;
/**
- * @copydoc Dali::RenderSurface::PostRender()
+ * @copydoc Dali::Integration::RenderSurface::PostRender()
*/
virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
/**
- * @copydoc Dali::RenderSurface::StopRender()
+ * @copydoc Dali::Integration::RenderSurface::StopRender()
*/
virtual void StopRender() override;
/**
- * @copydoc Dali::RenderSurface::SetThreadSynchronization
+ * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
/**
- * @copydoc Dali::RenderSurface::ReleaseLock()
+ * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
*/
virtual void ReleaseLock() override;
/**
- * @copydoc Dali::RenderSurface::GetSurfaceType()
+ * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
+ */
+ virtual Integration::RenderSurface::Type GetSurfaceType() override;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent()
+ */
+ virtual void MakeContextCurrent() override;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired()
+ */
+ virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired()
*/
- virtual RenderSurface::Type GetSurfaceType() override;
+ virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override;
private:
private: // Data
+ EglInterface* mEGL;
+ Dali::DisplayConnection* mDisplayConnection;
PositionSize mPositionSize; ///< Position
std::unique_ptr< WindowBase > mWindowBase;
ThreadSynchronizationInterface* mThreadSynchronization;
TriggerEventInterface* mRenderNotification; ///< Render notification trigger
TriggerEventInterface* mRotationTrigger;
GraphicsInterface* mGraphics; ///< Graphics interface
+ EGLSurface mEGLSurface;
+ EGLContext mEGLContext;
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
OutputSignalType mOutputTransformedSignal;
int mRotationAngle;
DisplayConnectionEcoreWl::DisplayConnectionEcoreWl()
: mDisplay( NULL ),
- mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE ),
+ mSurfaceType( Integration::RenderSurface::WINDOW_RENDER_SURFACE ),
mGraphics( nullptr )
{
}
DisplayConnectionEcoreWl::~DisplayConnectionEcoreWl()
{
- if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+ if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE )
{
ReleaseNativeDisplay();
}
return true;
}
-void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type )
+void DisplayConnectionEcoreWl::SetSurfaceType( Integration::RenderSurface::Type type )
{
mSurfaceType = type;
- if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+ if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE )
{
mDisplay = GetNativeDisplay();
}
* @brief Sets the surface type
* @param[in] type The surface type
*/
- void SetSurfaceType( RenderSurface::Type type );
+ void SetSurfaceType( Integration::RenderSurface::Type type );
/**
* @brief Sets the graphics interface
private:
EGLNativeDisplayType mDisplay; ///< Wayland-display for rendering
- RenderSurface::Type mSurfaceType; ///< The surface type
+ Integration::RenderSurface::Type mSurfaceType; ///< The surface type
GraphicsInterface* mGraphics; ///< The graphics interface
};
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/window-system/common/window-system.h>
#include <dali/integration-api/thread-synchronization-interface.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
namespace Dali
{
: mPosition( positionSize ),
mRenderNotification( NULL ),
mGraphics( NULL ),
+ mEGL( nullptr ),
+ mEGLSurface( nullptr ),
+ mEGLContext( nullptr ),
mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ),
mOwnSurface( false ),
dpiVertical = int( yres + 0.5f );
}
-void NativeRenderSurfaceEcoreWl::InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection )
+void NativeRenderSurfaceEcoreWl::InitializeGraphics()
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
unsetenv( "EGL_PLATFORM" );
- mGraphics = &graphics;
-
+ mGraphics = &mAdaptor->GetGraphicsInterface();
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
- EglInterface* mEGL = eglGraphics->Create();
-
- // Initialize EGL & OpenGL
- displayConnection.Initialize();
-
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
- eglImpl.ChooseConfig(true, mColorDepth);
+ mEGL = &eglGraphics->GetEglInterface();
- // Create the OpenGL context
- mEGL->CreateContext();
-
- // Create the OpenGL surface
- CreateSurface();
+ if ( mEGLContext == NULL )
+ {
+ // Create the OpenGL context for this window
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+ eglImpl.CreateWindowContext( mEGLContext );
- // Make it current
- mEGL->MakeContextCurrent();
+ // Create the OpenGL surface
+ CreateSurface();
+ }
}
void NativeRenderSurfaceEcoreWl::CreateSurface()
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth );
+ mEGLSurface = eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth );
}
void NativeRenderSurfaceEcoreWl::DestroySurface()
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.DestroySurface();
+ eglImpl.DestroySurface( mEGLSurface );
}
bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface()
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ) );
+ return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mEGLSurface, mEGLContext );
}
void NativeRenderSurfaceEcoreWl::MoveResize( Dali::PositionSize positionSize )
{
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers();
+ eglImpl.SwapBuffers( mEGLSurface );
}
if( mThreadSynchronization )
mThreadSynchronization = &threadSynchronization;
}
-RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType()
+Integration::RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType()
+{
+ return Integration::RenderSurface::NATIVE_RENDER_SURFACE;
+}
+
+void NativeRenderSurfaceEcoreWl::MakeContextCurrent()
+{
+ if ( mEGL != nullptr )
+ {
+ mEGL->MakeContextCurrent( mEGLSurface, mEGLContext );
+ }
+}
+
+Integration::DepthBufferAvailable NativeRenderSurfaceEcoreWl::GetDepthBufferRequired()
+{
+ return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE;
+}
+
+Integration::StencilBufferAvailable NativeRenderSurfaceEcoreWl::GetStencilBufferRequired()
{
- return RenderSurface::NATIVE_RENDER_SURFACE;
+ return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
}
void NativeRenderSurfaceEcoreWl::ReleaseLock()
{
class DisplayConnection;
+class EglInterface;
/**
* Ecore Wayland Native implementation of render surface.
*/
virtual void WaitUntilSurfaceReplaced() override;
-public: // from Dali::RenderSurface
+public: // from Dali::Integration::RenderSurface
/**
- * @copydoc Dali::RenderSurface::GetPositionSize()
+ * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const override;
/**
- * @copydoc Dali::RenderSurface::GetDpi()
+ * @copydoc Dali::Integration::RenderSurface::GetDpi()
*/
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::RenderSurface::InitializeGraphics()
+ * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) override;
+ virtual void InitializeGraphics() override;
/**
- * @copydoc Dali::RenderSurface::CreateSurface()
+ * @copydoc Dali::Integration::RenderSurface::CreateSurface()
*/
virtual void CreateSurface() override;
/**
- * @copydoc Dali::RenderSurface::DestroySurface()
+ * @copydoc Dali::Integration::RenderSurface::DestroySurface()
*/
virtual void DestroySurface() override;
/**
- * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
+ * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
*/
virtual bool ReplaceGraphicsSurface() override;
/**
- * @copydoc Dali::RenderSurface::MoveResize()
+ * @copydoc Dali::Integration::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize) override;
/**
- * @copydoc Dali::RenderSurface::StartRender()
+ * @copydoc Dali::Integration::RenderSurface::StartRender()
*/
virtual void StartRender() override;
/**
- * @copydoc Dali::RenderSurface::PreRender()
+ * @copydoc Dali::Integration::RenderSurface::PreRender()
*/
virtual bool PreRender( bool resizingSurface ) override;
/**
- * @copydoc Dali::RenderSurface::PostRender()
+ * @copydoc Dali::Integration::RenderSurface::PostRender()
*/
virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
/**
- * @copydoc Dali::RenderSurface::StopRender()
+ * @copydoc Dali::Integration::RenderSurface::StopRender()
*/
virtual void StopRender() override;
/**
- * @copydoc Dali::RenderSurface::SetThreadSynchronization
+ * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override;
/**
- * @copydoc Dali::RenderSurface::GetSurfaceType()
+ * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
*/
- virtual RenderSurface::Type GetSurfaceType() override;
+ virtual Integration::RenderSurface::Type GetSurfaceType() override;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent()
+ */
+ virtual void MakeContextCurrent() override;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired()
+ */
+ virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired()
+ */
+ virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override;
private:
/**
- * @copydoc Dali::RenderSurface::ReleaseLock()
+ * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
*/
virtual void ReleaseLock() override;
PositionSize mPosition;
TriggerEventInterface* mRenderNotification;
Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface
+ EglInterface* mEGL;
+ EGLSurface mEGLSurface;
+ EGLContext mEGLContext;
ColorDepth mColorDepth;
tbm_format mTbmFormat;
bool mOwnSurface;
return true;
}
-void DisplayConnectionX11::SetSurfaceType( RenderSurface::Type type )
+void DisplayConnectionX11::SetSurfaceType( Integration::RenderSurface::Type type )
{
- if( type == RenderSurface::WINDOW_RENDER_SURFACE )
+ if( type == Integration::RenderSurface::WINDOW_RENDER_SURFACE )
{
// Because of DDK issue, we need to use separated x display instead of ecore default display
mDisplay = XOpenDisplay(0);
/**
* @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
*/
- void SetSurfaceType( RenderSurface::Type type );
+ void SetSurfaceType( Integration::RenderSurface::Type type );
/**
* @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
#include <dali/internal/system/common/trigger-event.h>
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
namespace Dali
dpiVertical = int( yres + 0.5f );
}
-void PixmapRenderSurfaceEcoreX::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
+void PixmapRenderSurfaceEcoreX::InitializeGraphics()
{
- mGraphics = &graphics;
- mDisplayConnection = &displayConnection;
+ mGraphics = &mAdaptor->GetGraphicsInterface();
+ mDisplayConnection = &mAdaptor->GetDisplayConnectionInterface();
+
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
XPixmap pixmap = static_cast<XPixmap>( mX11Pixmaps[i] );
eglImpl.MakeCurrent( EGLNativePixmapType( pixmap ), mEglSurfaces[i] );
- eglImpl.DestroySurface();
+ eglImpl.DestroySurface( mEglSurfaces[i] );
}
}
}
}
-RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
+Integration::RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
+{
+ return Integration::RenderSurface::PIXMAP_RENDER_SURFACE;
+}
+
+void PixmapRenderSurfaceEcoreX::MakeContextCurrent()
{
- return RenderSurface::PIXMAP_RENDER_SURFACE;
}
void PixmapRenderSurfaceEcoreX::CreateRenderable()
*/
virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
-public: // from Dali::RenderSurface
+public: // from Dali::Integration::RenderSurface
/**
- * @copydoc Dali::RenderSurface::GetPositionSize()
+ * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const override;
/**
- * @copydoc Dali::RenderSurface::GetDpi()
+ * @copydoc Dali::Integration::RenderSurface::GetDpi()
*/
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::RenderSurface::InitializeGraphics()
+ * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
+ virtual void InitializeGraphics() override;
/**
- * @copydoc Dali::RenderSurface::CreateSurface()
+ * @copydoc Dali::Integration::RenderSurface::CreateSurface()
*/
virtual void CreateSurface() override;
/**
- * @copydoc Dali::RenderSurface::DestroySurface()
+ * @copydoc Dali::Integration::RenderSurface::DestroySurface()
*/
virtual void DestroySurface() override;
/**
- * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
+ * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
*/
virtual bool ReplaceGraphicsSurface() override;
/**
- * @copydoc Dali::RenderSurface::MoveResize()
+ * @copydoc Dali::Integration::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize) override {}
/**
- * @copydoc Dali::RenderSurface::StartRender()
+ * @copydoc Dali::Integration::RenderSurface::StartRender()
*/
virtual void StartRender() override;
/**
- * @copydoc Dali::RenderSurface::PreRender()
+ * @copydoc Dali::Integration::RenderSurface::PreRender()
*/
virtual bool PreRender( bool resizingSurface ) override;
/**
- * @copydoc Dali::RenderSurface::PostRender()
+ * @copydoc Dali::Integration::RenderSurface::PostRender()
*/
virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) override;
/**
- * @copydoc Dali::RenderSurface::StopRender()
+ * @copydoc Dali::Integration::RenderSurface::StopRender()
*/
virtual void StopRender() override;
/**
- * @copydoc Dali::RenderSurface::SetThreadSynchronization
+ * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
/**
- * @copydoc Dali::RenderSurface::GetSurfaceType()
+ * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
*/
- virtual RenderSurface::Type GetSurfaceType() override;
+ virtual Integration::RenderSurface::Type GetSurfaceType() override;
+
+ /**
+ * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent()
+ */
+ virtual void MakeContextCurrent() override;
private: // from PixmapRenderSurface
/**
- * @copydoc Dali::RenderSurface::ReleaseLock()
+ * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
*/
virtual void ReleaseLock() override;
#include <dali/public-api/adaptor-framework/window.h>
// INTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/orientation-impl.h>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/math/uint-16-pair.h>
#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/signals/dali-signal.h>
class DragAndDropDetector;
class Orientation;
+class Actor;
+class Layer;
/**
* @brief The window class is used internally for drawing.