../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) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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 RenderSurfaceInterface;
+class RenderSurface;
namespace Internal
{
* @param[in] surface The surface to draw onto
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface );
+ static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& 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::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
+ static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& 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::RenderSurfaceInterface& surface );
+ void ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface );
/**
* @brief Get the render surface the adaptor is using to render to.
*
* @return reference to current render surface
*/
- Dali::RenderSurfaceInterface& GetSurface();
+ RenderSurface& GetSurface();
/**
* @brief Gets native window handle
*
*/
-// EXTERNAL INCLUDES
-#include <EGL/egl.h>
-
namespace Dali
{
/**
* Make the OpenGL context current
*/
- virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) = 0;
+ virtual void MakeContextCurrent() = 0;
/**
* Terminate GL
/**
* Performs an OpenGL swap buffers command
*/
- virtual void SwapBuffers( EGLSurface& eglSurface ) = 0;
+ virtual void SwapBuffers() = 0;
/**
* Performs an OpenGL copy buffers command
*/
- virtual void CopyBuffers( EGLSurface& eglSurface ) = 0;
+ virtual void CopyBuffers() = 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-interface.h \
+ $(adaptor_integration_api_dir)/render-surface.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-interface.h>
+#include <dali/integration-api/render-surface.h>
#else
#include <dali/integration-api/adaptors/egl-interface.h>
-#include <dali/integration-api/adaptors/render-surface-interface.h>
+#include <dali/integration-api/adaptors/render-surface.h>
#endif
namespace Dali
/**
* Native interface of render surface.
*/
-class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurfaceInterface
+class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurface
{
public:
-#ifndef DALI_RENDER_SURFACE_INTERFACE_H
-#define DALI_RENDER_SURFACE_INTERFACE_H
+#ifndef DALI_RENDER_SURFACE_H
+#define DALI_RENDER_SURFACE_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <dali/integration-api/render-surface.h>
-#include <dali/integration-api/core-enumerations.h>
-#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/math/rect.h>
+#include <dali/public-api/object/any.h>
+#include <dali/public-api/common/view-mode.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 RenderSurfaceInterface : public Dali::Integration::RenderSurface
+class RenderSurface
{
public:
+ enum Type
+ {
+ WINDOW_RENDER_SURFACE,
+ PIXMAP_RENDER_SURFACE,
+ NATIVE_RENDER_SURFACE
+ };
+
/**
* @brief Constructor
* Inlined as this is a pure abstract interface
*/
- RenderSurfaceInterface()
- : mAdaptor( nullptr ),
- mGraphics( nullptr ),
- mDisplayConnection( nullptr ),
- mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ),
- mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE ),
- mBackgroundColor()
- {}
+ RenderSurface() {}
/**
* @brief Virtual Destructor.
* Inlined as this is a pure abstract interface
*/
- virtual ~RenderSurfaceInterface() {}
+ virtual ~RenderSurface() {}
/**
* @brief Return the size and position of the surface.
* @return The position and size
*/
- virtual Dali::PositionSize GetPositionSize() const = 0;
+ virtual 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() = 0;
+ virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) = 0;
/**
* @brief Creates the Surface
/**
* @brief Gets the surface type
*/
- 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;
- }
+ virtual RenderSurface::Type GetSurfaceType() = 0;
private:
/**
* @brief Undefined copy constructor. RenderSurface cannot be copied
*/
- RenderSurfaceInterface( const RenderSurfaceInterface& rhs );
+ RenderSurface( const RenderSurface& rhs );
/**
* @brief Undefined assignment operator. RenderSurface cannot be copied
*/
- 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
+ RenderSurface& operator=( const RenderSurface& rhs );
};
} // namespace Dali
-#endif // DALI_RENDER_SURFACE_INTERFACE_H
+#endif // DALI_RENDER_SURFACE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *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, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, RenderSurface *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
- mCore->SurfaceResized( defaultWindow.surface );
+ PositionSize size = defaultWindow.surface->GetPositionSize();
+
+ mCore->SurfaceResized( size.width, size.height );
// Initialize the thread controller
mThreadController->Initialize();
mEventHandler->FeedKeyEvent( keyEvent );
}
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& newSurface )
+void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface )
{
+ PositionSize positionSize = newSurface.GetPositionSize();
+
// Let the core know the surface size has changed
- mCore->SurfaceResized( &newSurface );
+ mCore->SurfaceResized( positionSize.width, positionSize.height );
mResizedSignal.Emit( mAdaptor );
WindowPane newDefaultWindow;
newDefaultWindow.nativeWindow = nativeWindow;
newDefaultWindow.surface = &newSurface;
- newDefaultWindow.surface->SetAdaptor(*this);
WindowPane oldDefaultWindow = mWindowFrame.front();
oldDefaultWindow.surface = nullptr;
}
-Dali::RenderSurfaceInterface& Adaptor::GetSurface() const
+RenderSurface& 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;
}
-Dali::RenderSurfaceInterface* Adaptor::GetRenderSurfaceInterface()
+RenderSurface* Adaptor::GetRenderSurfaceInterface()
{
if( !mWindowFrame.empty())
{
RequestUpdate( false );
}
-void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
{
// Let the core know the surface size has changed
- mCore->SurfaceResized( surface );
+ mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
mResizedSignal.Emit( mAdaptor );
}
-void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizeComplete( 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, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions)
+Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* 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 RenderSurfaceInterface;
+class RenderSurface;
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,
- Dali::RenderSurfaceInterface* surface,
+ RenderSurface* surface,
Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
*/
static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
Any nativeWindow,
- Dali::RenderSurfaceInterface* surface,
+ RenderSurface* surface,
Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
/**
* @copydoc AdaptorInterface::ReplaceSurface()
*/
- virtual void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface );
+ virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface );
/**
* @copydoc Dali::Adaptor::GetSurface()
*/
- virtual Dali::RenderSurfaceInterface& GetSurface() const;
+ virtual RenderSurface& 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( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
+ void SurfaceResizePrepare( SurfaceSize surfaceSize );
/**
* Informs ThreadController the surface size has changed
*/
- void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
+ void SurfaceResizeComplete( SurfaceSize surfaceSize );
/**
* Sets layout direction of root by system language
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetRenderSurfaceInterface()
*/
- virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface();
+ virtual RenderSurface* GetRenderSurfaceInterface();
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetVSyncMonitorInterface()
* Assigns the render surface to the adaptor
*
*/
- void SetSurface(Dali::RenderSurfaceInterface *surface);
+ void SetSurface(RenderSurface *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, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions );
+ Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* 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
- uint32_t id; ///< unique Window ID
- Dali::RenderSurfaceInterface* surface; ///< The surface the Window is bound to
+ RenderSurface* 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 Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() = 0;
+ virtual RenderSurface* GetRenderSurfaceInterface() = 0;
/**
* @return vsync monitor interface
return *adaptor;
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface )
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
{
return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
{
- Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
+ Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
return *adaptor;
}
mImpl->RemoveIdle( callback );
}
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface )
+void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
{
mImpl->ReplaceSurface(nativeWindow, surface);
}
return mImpl->LanguageChangedSignal();
}
-Dali::RenderSurfaceInterface& Adaptor::GetSurface()
+RenderSurface& 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
{
GetImplementation( newWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
}
- Internal::Adaptor::WindowRenderSurface* renderSurface = windowImpl.GetSurface();
+ Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
Any nativeWindow = newWindow.GetNativeHandle();
Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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
- Dali::RenderSurfaceInterface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->SetThreadSynchronization( *this );
sem_wait( &mEventThreadSemaphore );
}
- Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->StartRender();
LOG_EVENT_TRACE;
// Stop Rendering and the Update/Render Thread
- Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->StopRender();
}
}
-void CombinedUpdateRenderController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
+void CombinedUpdateRenderController::ReplaceSurface( RenderSurface* newSurface )
{
LOG_EVENT_TRACE;
LOG_UPDATE_RENDER( "THREAD CREATED" );
- // 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();
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
- currentSurface->InitializeGraphics();
- currentSurface->MakeContextCurrent();
+ currentSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
}
-#endif
-
// Tell core it has a context
mCore.ContextCreated();
// REPLACE SURFACE
//////////////////////////////
- Integration::RenderSurface* newSurface = ShouldSurfaceBeReplaced();
+ 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();
+ newSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
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;
}
}
}
}
-#if DALI_GLES_VERSION >= 30
- // Make the shared surfaceless context as current before rendering
- eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() );
-#endif
+ currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ if( currentSurface )
+ {
+ currentSurface->PreRender( surfaceResized );
+ }
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;
}
-Integration::RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced()
+RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced()
{
ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
- Integration::RenderSurface* newSurface = mNewSurface;
+ RenderSurface* newSurface = mNewSurface;
mNewSurface = NULL;
return newSurface;
namespace Dali
{
-class RenderSurfaceInterface;
+class RenderSurface;
class TriggerEventInterface;
namespace Internal
/**
* @copydoc ThreadControllerInterface::ReplaceSurface()
*/
- virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
+ virtual void ReplaceSurface( RenderSurface* surface );
/**
* @copydoc ThreadControllerInterface::ResizeSurface()
*
* @return Pointer to the new surface, NULL otherwise
*/
- Integration::RenderSurface* ShouldSurfaceBeReplaced();
+ 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).
- 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).
+ 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 RenderSurfaceInterface;
+class RenderSurface;
namespace Internal
{
* Replaces the surface.
* @param surface new surface
*/
- virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) = 0;
+ virtual void ReplaceSurface( RenderSurface* surface ) = 0;
/**
* Resize the surface.
mApplicationType = type;
mCallbackManager = CallbackManager::New();
- char* region = nullptr;
- char* language = nullptr;
+ char* region;
+ char* language;
system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ®ion );
system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language );
-
- if (region != nullptr)
- {
- mRegion = std::string( region );
- }
-
- if ( language != nullptr)
- {
- mLanguage = std::string( language );
- }
+ mRegion = std::string( region );
+ 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;
}
-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 )
+void EglImplementation::DestroyContext()
{
DALI_ASSERT_ALWAYS( mEglContext && "no EGL context" );
- eglDestroyContext( mEglDisplay, eglContext );
- eglContext = 0;
+ eglDestroyContext( mEglDisplay, mEglContext );
+ mEglContext = 0;
}
-void EglImplementation::DestroySurface( EGLSurface& eglSurface )
+void EglImplementation::DestroySurface()
{
- if(mIsOwnSurface && eglSurface)
+ if(mIsOwnSurface && mCurrentEglSurface)
{
// Make context null to prevent crash in driver side
MakeContextNull();
- eglDestroySurface( mEglDisplay, eglSurface );
- eglSurface = 0;
+ eglDestroySurface( mEglDisplay, mCurrentEglSurface );
+ mCurrentEglSurface = 0;
}
}
-void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext )
+void EglImplementation::MakeContextCurrent()
{
- mCurrentEglSurface = eglSurface;
+ mContextCurrent = true;
if(mIsOwnSurface)
{
- eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext );
+ eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, mEglContext );
}
EGLint error = eglGetError();
if(mIsOwnSurface)
{
- eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext );
+ eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, 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();
- for ( auto eglSurface : mEglWindowSurfaces )
+ if(mIsOwnSurface && mCurrentEglSurface)
{
- if(mIsOwnSurface && eglSurface)
- {
- eglDestroySurface(mEglDisplay, eglSurface);
- }
+ eglDestroySurface(mEglDisplay, mCurrentEglSurface);
}
eglDestroyContext(mEglDisplay, mEglContext);
- for ( auto eglContext : mEglWindowContexts )
- {
- eglDestroyContext(mEglDisplay, eglContext);
- }
eglTerminate(mEglDisplay);
return mGlesInitialized;
}
-void EglImplementation::SwapBuffers( EGLSurface& eglSurface )
+void EglImplementation::SwapBuffers()
{
- if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
- {
- eglSwapBuffers( mEglDisplay, eglSurface );
- }
+ eglSwapBuffers( mEglDisplay, mCurrentEglSurface );
}
-void EglImplementation::CopyBuffers( EGLSurface& eglSurface )
+void EglImplementation::CopyBuffers()
{
- eglCopyBuffers( mEglDisplay, eglSurface, mCurrentEglNativePixmap );
+ eglCopyBuffers( mEglDisplay, mCurrentEglSurface, mCurrentEglNativePixmap );
}
void EglImplementation::WaitGL()
return;
}
- bool isTransparent = ( depth == COLOR_DEPTH_32 );
-
mIsWindow = isWindowType;
EGLint numConfigs;
configAttribs.PushBack( EGL_BLUE_SIZE );
configAttribs.PushBack( 8 );
- if ( isTransparent )
- {
- configAttribs.PushBack( EGL_ALPHA_SIZE );
+ 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( 8 );
+ // There is a bug in the desktop emulator
+ // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing
+ configAttribs.PushBack( 0 );
#endif // _ARCH_ARM_
- }
configAttribs.PushBack( EGL_DEPTH_SIZE );
configAttribs.PushBack( mDepthBufferRequired ? 24 : 0 );
}
}
-EGLSurface EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth )
+void 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, EGLSurface& eglSurface, EGLContext& eglContext )
+bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window )
{
bool contextLost = false;
MakeContextNull();
// destroy the surface
- DestroySurface( eglSurface );
+ DestroySurface();
// create the EGL surface
CreateSurfaceWindow( window, mColorDepth );
// set the context to be current with the new surface
- MakeContextCurrent( eglSurface, eglContext );
+ MakeContextCurrent();
return contextLost;
}
return mEglDisplay;
}
-EGLContext EglImplementation::GetContext() const
+EGLDisplay 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 for the shared resource.
+ * Create the OpenGL context.
* @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( EGLContext& eglContext );
+ void DestroyContext();
/**
* Destroy the OpenGL surface.
*/
- void DestroySurface( EGLSurface& eglSurface );
+ void DestroySurface();
/**
* Make the OpenGL context current
*/
- virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext );
+ virtual void MakeContextCurrent();
/**
* clear the OpenGL context
/**
* Performs an OpenGL swap buffers command
*/
- virtual void SwapBuffers( EGLSurface& eglSurface );
+ virtual void SwapBuffers();
/**
* Performs an OpenGL copy buffers command
*/
- virtual void CopyBuffers( EGLSurface& eglSurface );
+ virtual void CopyBuffers();
/**
* 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 Handle to an on-screen EGL window surface (the requester has an ownership of this egl surface)
+ * @return true on success, false on failure
*/
- EGLSurface CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth );
+ void 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, EGLSurface& eglSurface, EGLContext& eglContext );
+ bool ReplaceSurfaceWindow( EGLNativeWindowType window );
/**
* Replaces the render surface
EGLDisplay mEglDisplay;
EGLConfig mEglConfig;
- 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
-
+ EGLContext mEglContext;
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().
- Dali::RenderSurfaceInterface& renderSurface = Dali::Adaptor::Get().GetSurface();
+ RenderSurface& renderSurface = Dali::Adaptor::Get().GetSurface();
WindowRenderSurface& windowRenderSurface = static_cast< WindowRenderSurface& >( renderSurface );
int windowId = windowRenderSurface.GetNativeWindowId();
mThreadControllerInterface->RequestUpdateOnce();
}
-void ThreadController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
+void ThreadController::ReplaceSurface( RenderSurface* newSurface )
{
mThreadControllerInterface->ReplaceSurface( newSurface );
}
namespace Dali
{
-class RenderSurfaceInterface;
+class RenderSurface;
namespace Internal
{
*
* @param surface new surface
*/
- void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
+ void ReplaceSurface( RenderSurface* surface );
/**
* Resize the surface.
* Sets the render surface type
* @param[in] type The render surface type
*/
- virtual void SetSurfaceType( Integration::RenderSurface::Type type ) = 0;
+ virtual void SetSurfaceType( RenderSurface::Type type ) = 0;
/**
* Sets the graphics interface
return new DisplayConnection(internal);
}
-DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Integration::RenderSurface::Type type )
+DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, 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, Integration::RenderSurface::Type type );
+ static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type );
/**
* @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
} // unnamed namespace
-EventHandler::EventHandler( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector )
+EventHandler::EventHandler( 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( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector );
+ EventHandler( 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
-
-#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
-
+#include <dali/integration-api/render-surface.h>
namespace Dali
{
/**
* Pixmap interface of render surface.
*/
-class PixmapRenderSurface : public Dali::RenderSurfaceInterface
+class PixmapRenderSurface : public Dali::RenderSurface
{
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) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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()
-: mId( mWindowCounter++ ),
- mSurface( nullptr ),
+: mSurface( NULL ),
mWindowBase(),
mIndicatorVisible( Dali::Window::INVISIBLE ), // TODO: Enable this after indicator implementation based on tizen 5.
mIndicatorIsShown( false ),
mShowRotatedIndicatorOnClose( false ),
mStarted( false ),
+ mIsTransparent( false ),
mIsFocusAcceptable( true ),
mVisible( true ),
mIconified( false ),
{
mAdaptor->RemoveObserver( *this );
mAdaptor->SetDragAndDropDetector( NULL );
- mAdaptor->RemoveWindow( this );
mAdaptor = NULL;
}
- mSurface.reset( nullptr );
+ delete mSurface;
}
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();
- mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
+ auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
+ mSurface = windowRenderSurface.release();
// 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;
{
mIndicator->SetAdaptor(mAdaptor);
}
-
- mSurface->SetAdaptor( *mAdaptor );
}
WindowRenderSurface* Window::GetSurface()
{
- return mSurface.get();
+ return mSurface;
}
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( mSurface.get(), newSize );
+ mAdaptor->SurfaceResizePrepare( newSize );
mResizedSignal.Emit( newSize );
- mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
+ mAdaptor->SurfaceResizeComplete( newSize );
}
}
{
Uint16Pair newSize( newRect.width, newRect.height );
- mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
+ mAdaptor->SurfaceResizePrepare( newSize );
mResizedSignal.Emit( newSize );
- mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
+ mAdaptor->SurfaceResizeComplete( newSize );
}
}
{
mSurface->RequestRotation( orientation, width, height );
- mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
// Emit signal
mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
- mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
}
void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
void Window::OnOutputTransformed()
{
PositionSize positionSize = mSurface->GetPositionSize();
- mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
- mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( 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) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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:
- 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;
+ WindowRenderSurface* mSurface;
WindowBase* mWindowBase;
Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state
bool mIndicatorIsShown:1; ///< private state
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()
+void WindowRenderSurface::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
{
-
- mGraphics = &mAdaptor->GetGraphicsInterface();
+ mGraphics = &graphics;
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
- mEGL = &eglGraphics->GetEglInterface();
- 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 );
+ EglInterface* mEGL = eglGraphics->Create();
- // Create the OpenGL surface
- CreateSurface();
- }
+ // Initialize EGL & OpenGL
+ displayConnection.Initialize();
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+ eglImpl.ChooseConfig(true, mColorDepth);
+
+ // Create the OpenGL context
+ mEGL->CreateContext();
+
+ // Create the OpenGL surface
+ CreateSurface();
+
+ // Make it current
+ mEGL->MakeContextCurrent();
}
void WindowRenderSurface::CreateSurface()
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- mEGLSurface = eglImpl.CreateSurfaceWindow( window, mColorDepth );
+ eglImpl.CreateSurfaceWindow( window, mColorDepth );
// Check rotation capability
mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.DestroySurface( mEGLSurface );
+ eglImpl.DestroySurface();
mWindowBase->DestroyEglWindow();
}
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- return eglImpl.ReplaceSurfaceWindow( window, mEGLSurface, mEGLContext );
+ return eglImpl.ReplaceSurfaceWindow( window );
}
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( mEGLSurface );
+ eglImpl.SwapBuffers();
if( mRenderNotification )
{
// Nothing to do.
}
-Integration::RenderSurface::Type WindowRenderSurface::GetSurfaceType()
+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/internal/graphics/common/graphics-interface.h>
-
-#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/render-surface.h>
#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
+#include <dali/internal/graphics/common/graphics-interface.h>
// 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::RenderSurfaceInterface, public ConnectionTracker
+class WindowRenderSurface : public Dali::RenderSurface, public ConnectionTracker
{
public:
*/
OutputSignalType& OutputTransformedSignal();
-public: // from Dali::Integration::RenderSurface
+public: // from Dali::RenderSurface
/**
- * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
+ * @copydoc Dali::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const override;
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
+ * @copydoc Dali::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeGraphics() override;
+ virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::CreateSurface()
+ * @copydoc Dali::RenderSurface::CreateSurface()
*/
virtual void CreateSurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::DestroySurface()
+ * @copydoc Dali::RenderSurface::DestroySurface()
*/
virtual void DestroySurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
+ * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
*/
virtual bool ReplaceGraphicsSurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize) override;
/**
- * @copydoc Dali::Integration::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender() override;
/**
- * @copydoc Dali::Integration::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
virtual bool PreRender( bool resizingSurface ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
/**
- * @copydoc Dali::Integration::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurface::StopRender()
*/
virtual void StopRender() override;
/**
- * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
+ * @copydoc Dali::RenderSurface::SetThreadSynchronization
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
+ * @copydoc Dali::RenderSurface::ReleaseLock()
*/
virtual void ReleaseLock() override;
/**
- * @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()
+ * @copydoc Dali::RenderSurface::GetSurfaceType()
*/
- virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override;
+ virtual RenderSurface::Type GetSurfaceType() 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( Integration::RenderSurface::WINDOW_RENDER_SURFACE ),
+ mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE ),
mGraphics( nullptr )
{
}
DisplayConnectionEcoreWl::~DisplayConnectionEcoreWl()
{
- if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE )
+ if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
{
ReleaseNativeDisplay();
}
return true;
}
-void DisplayConnectionEcoreWl::SetSurfaceType( Integration::RenderSurface::Type type )
+void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type )
{
mSurfaceType = type;
- if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE )
+ if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
{
mDisplay = GetNativeDisplay();
}
* @brief Sets the surface type
* @param[in] type The surface type
*/
- void SetSurfaceType( Integration::RenderSurface::Type type );
+ void SetSurfaceType( RenderSurface::Type type );
/**
* @brief Sets the graphics interface
private:
EGLNativeDisplayType mDisplay; ///< Wayland-display for rendering
- Integration::RenderSurface::Type mSurfaceType; ///< The surface type
+ RenderSurface::Type mSurfaceType; ///< The surface type
GraphicsInterface* mGraphics; ///< The graphics interface
};
mIsShowing( true ),
mIsAnimationPlaying( false ),
mCurrentSharedFile( 0 ),
- mBackgroundVisible( false )
+ mBackgroundVisible( false ),
+ mTopMargin( 0 )
{
mIndicatorContentActor = Dali::Actor::New();
mIndicatorContentActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer );
mBackgroundVisible = false;
}
+ UpdateTopMargin();
}
void IndicatorEcoreWl::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate )
}
mVisible = visibleMode;
+ UpdateTopMargin();
if( mForegroundRenderer && mForegroundRenderer.GetTextures().GetTexture( 0u ) )
{
mIndicatorContentActor.SetSize( mImageWidth, mImageHeight );
mIndicatorActor.SetSize( mImageWidth, mImageHeight );
mEventActor.SetSize(mImageWidth, mImageHeight);
+ UpdateTopMargin();
}
}
}
}
+void IndicatorEcoreWl::UpdateTopMargin()
+{
+ int newMargin = (mVisible == Dali::Window::VISIBLE && mOpacityMode == Dali::Window::OPAQUE) ? mImageHeight : 0;
+ if (mTopMargin != newMargin)
+ {
+ mTopMargin = newMargin;
+ mAdaptor->IndicatorSizeChanged( mTopMargin );
+ }
+}
+
void IndicatorEcoreWl::UpdateVisibility()
{
if( CheckVisibleState() )
void LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent );
/**
+ * Update top margin of the stage as much as indicator height
+ */
+ void UpdateTopMargin();
+
+ /**
* Update the visibility and position of the actors
*/
void UpdateVisibility();
SharedFileInfo mSharedFileInfo[SHARED_FILE_NUMBER]; ///< Table to store shared file info
bool mBackgroundVisible; ///< Indicate whether background is visible
+ int mTopMargin; ///< Top margin of the stage for indicator
};
} // Adaptor
#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()
+void NativeRenderSurfaceEcoreWl::InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection )
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
unsetenv( "EGL_PLATFORM" );
- mGraphics = &mAdaptor->GetGraphicsInterface();
+ mGraphics = &graphics;
+
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
- mEGL = &eglGraphics->GetEglInterface();
+ EglInterface* mEGL = eglGraphics->Create();
- if ( mEGLContext == NULL )
- {
- // Create the OpenGL context for this window
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
- eglImpl.CreateWindowContext( mEGLContext );
+ // Initialize EGL & OpenGL
+ displayConnection.Initialize();
- // Create the OpenGL surface
- CreateSurface();
- }
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+ eglImpl.ChooseConfig(true, mColorDepth);
+
+ // Create the OpenGL context
+ mEGL->CreateContext();
+
+ // Create the OpenGL surface
+ CreateSurface();
+
+ // Make it current
+ mEGL->MakeContextCurrent();
}
void NativeRenderSurfaceEcoreWl::CreateSurface()
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- mEGLSurface = eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth );
+ 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( mEGLSurface );
+ eglImpl.DestroySurface();
}
bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface()
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mEGLSurface, mEGLContext );
+ return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ) );
}
void NativeRenderSurfaceEcoreWl::MoveResize( Dali::PositionSize positionSize )
{
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers( mEGLSurface );
+ eglImpl.SwapBuffers();
}
if( mThreadSynchronization )
mThreadSynchronization = &threadSynchronization;
}
-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()
+RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType()
{
- return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
+ return RenderSurface::NATIVE_RENDER_SURFACE;
}
void NativeRenderSurfaceEcoreWl::ReleaseLock()
{
class DisplayConnection;
-class EglInterface;
/**
* Ecore Wayland Native implementation of render surface.
*/
virtual void WaitUntilSurfaceReplaced() override;
-public: // from Dali::Integration::RenderSurface
+public: // from Dali::RenderSurface
/**
- * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
+ * @copydoc Dali::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const override;
/**
- * @copydoc Dali::Integration::RenderSurface::GetDpi()
+ * @copydoc Dali::RenderSurface::GetDpi()
*/
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
+ * @copydoc Dali::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeGraphics() override;
+ virtual void InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::CreateSurface()
+ * @copydoc Dali::RenderSurface::CreateSurface()
*/
virtual void CreateSurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::DestroySurface()
+ * @copydoc Dali::RenderSurface::DestroySurface()
*/
virtual void DestroySurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
+ * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
*/
virtual bool ReplaceGraphicsSurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize) override;
/**
- * @copydoc Dali::Integration::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender() override;
/**
- * @copydoc Dali::Integration::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
virtual bool PreRender( bool resizingSurface ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
/**
- * @copydoc Dali::Integration::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurface::StopRender()
*/
virtual void StopRender() override;
/**
- * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
+ * @copydoc Dali::RenderSurface::SetThreadSynchronization
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override;
/**
- * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
+ * @copydoc Dali::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 Integration::StencilBufferAvailable GetStencilBufferRequired() override;
+ virtual RenderSurface::Type GetSurfaceType() override;
private:
/**
- * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
+ * @copydoc Dali::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( Integration::RenderSurface::Type type )
+void DisplayConnectionX11::SetSurfaceType( RenderSurface::Type type )
{
- if( type == Integration::RenderSurface::WINDOW_RENDER_SURFACE )
+ if( type == 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( Integration::RenderSurface::Type type );
+ void SetSurfaceType( 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()
+void PixmapRenderSurfaceEcoreX::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
{
- mGraphics = &mAdaptor->GetGraphicsInterface();
- mDisplayConnection = &mAdaptor->GetDisplayConnectionInterface();
-
+ mGraphics = &graphics;
+ mDisplayConnection = &displayConnection;
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( mEglSurfaces[i] );
+ eglImpl.DestroySurface();
}
}
}
}
-Integration::RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
-{
- return Integration::RenderSurface::PIXMAP_RENDER_SURFACE;
-}
-
-void PixmapRenderSurfaceEcoreX::MakeContextCurrent()
+RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
{
+ return RenderSurface::PIXMAP_RENDER_SURFACE;
}
void PixmapRenderSurfaceEcoreX::CreateRenderable()
*/
virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
-public: // from Dali::Integration::RenderSurface
+public: // from Dali::RenderSurface
/**
- * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
+ * @copydoc Dali::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const override;
/**
- * @copydoc Dali::Integration::RenderSurface::GetDpi()
+ * @copydoc Dali::RenderSurface::GetDpi()
*/
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
+ * @copydoc Dali::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeGraphics() override;
+ virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::CreateSurface()
+ * @copydoc Dali::RenderSurface::CreateSurface()
*/
virtual void CreateSurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::DestroySurface()
+ * @copydoc Dali::RenderSurface::DestroySurface()
*/
virtual void DestroySurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
+ * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
*/
virtual bool ReplaceGraphicsSurface() override;
/**
- * @copydoc Dali::Integration::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize) override {}
/**
- * @copydoc Dali::Integration::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender() override;
/**
- * @copydoc Dali::Integration::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
virtual bool PreRender( bool resizingSurface ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurface::StopRender()
*/
virtual void StopRender() override;
/**
- * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
+ * @copydoc Dali::RenderSurface::SetThreadSynchronization
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
/**
- * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
+ * @copydoc Dali::RenderSurface::GetSurfaceType()
*/
- virtual Integration::RenderSurface::Type GetSurfaceType() override;
-
- /**
- * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent()
- */
- virtual void MakeContextCurrent() override;
+ virtual RenderSurface::Type GetSurfaceType() override;
private: // from PixmapRenderSurface
/**
- * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
+ * @copydoc Dali::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.