END_TEST;
}
-int UtcDaliApplicationSetViewModeN(void)
-{
- Application application;
-
- try
- {
- application.SetViewMode( STEREO_VERTICAL );
- DALI_TEST_CHECK( false ); // Should not get here
- }
- catch( ... )
- {
- DALI_TEST_CHECK( true );
- }
-
- END_TEST;
-}
-
-int UtcDaliApplicationGetViewModeN(void)
-{
- Application application;
-
- try
- {
- (void) application.GetViewMode();
- DALI_TEST_CHECK( false ); // Should not get here
- }
- catch( ... )
- {
- DALI_TEST_CHECK( true );
- }
-
- END_TEST;
-}
-
-int UtcDaliApplicationSetStereoBaseN(void)
-{
- Application application;
-
- try
- {
- application.SetStereoBase( 1.0f );
- DALI_TEST_CHECK( false ); // Should not get here
- }
- catch( ... )
- {
- DALI_TEST_CHECK( true );
- }
-
- END_TEST;
-}
-
-int UtcDaliApplicationGetStereoBaseN(void)
-{
- Application application;
-
- try
- {
- (void) application.GetStereoBase();
- DALI_TEST_CHECK( false ); // Should not get here
- }
- catch( ... )
- {
- DALI_TEST_CHECK( true );
- }
-
- END_TEST;
-}
-
int UtcDaliApplicationInitSignalP(void)
{
Application application = Application::New();
$(adaptor_text_common_src_files) \
$(adaptor_text_ubuntu_src_files) \
$(adaptor_resampler_src_files) \
+ $(adaptor_vector_animation_common_src_files) \
$(adaptor_video_common_src_files) \
$(adaptor_web_engine_common_src_files) \
$(adaptor_window_system_common_src_files) \
$(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
+ $(adaptor_vector_animation_common_src_files) \
$(adaptor_video_common_src_files) \
$(adaptor_web_engine_common_src_files) \
$(adaptor_window_system_common_src_files) \
$(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
+ $(adaptor_vector_animation_common_src_files) \
$(adaptor_video_common_src_files) \
$(adaptor_web_engine_common_src_files) \
$(adaptor_window_system_common_src_files) \
$(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
+ $(adaptor_vector_animation_common_src_files) \
$(adaptor_video_common_src_files) \
$(adaptor_web_engine_common_src_files) \
$(adaptor_window_system_common_src_files) \
$(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
+ $(adaptor_vector_animation_common_src_files) \
$(adaptor_video_common_src_files) \
$(adaptor_web_engine_common_src_files) \
$(adaptor_window_system_common_src_files) \
$(adaptor_system_tizen_wearable_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
+ $(adaptor_vector_animation_common_src_files) \
$(adaptor_video_common_src_files) \
$(adaptor_web_engine_common_src_files) \
$(adaptor_window_system_common_src_files) \
if test "x$enable_wayland" = "xyes"; then
if test "x$enable_ecore_wayland2" = "xyes"; then
-PKG_CHECK_MODULES(WAYLAND, [ecore-wl2 egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm])
+PKG_CHECK_MODULES(WAYLAND, [ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client >= 1.2.0 xkbcommon libtbm])
else
PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm])
fi
adaptor_thread_dir = ../../../dali/internal/thread
include ../../../dali/internal/thread/file.list
+# Module: vector-animation
+adaptor_vector_animation_dir = ../../../dali/internal/vector-animation
+include ../../../dali/internal/vector-animation/file.list
+
# Module: public-api
adaptor_public_api_dir = ../../../dali/public-api
include ../../../dali/public-api/file.list
--- /dev/null
+#ifndef DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
+#define DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/rendering/renderer.h>
+#include <string>
+
+namespace Dali
+{
+
+/**
+ * VectorAnimationRendererPlugin is an abstract interface, used by dali-adaptor to render a vector animation.
+ * A concrete implementation must be created for each platform and provided as a dynamic library which
+ * will be loaded at run time by the adaptor.
+ */
+class VectorAnimationRendererPlugin
+{
+public:
+
+ /**
+ * @brief Constructor
+ */
+ VectorAnimationRendererPlugin() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~VectorAnimationRendererPlugin() {}
+
+ /**
+ * @brief Creates a renderer to render an vector animation file.
+ *
+ * @param[in] url The url of an animation file
+ * @param[in] renderer The renderer used to render the image
+ * @param[in] width The target image width
+ * @param[in] height The target image height
+ * @return True if the renderer is successfully created, false otherwise
+ */
+ virtual bool CreateRenderer( const std::string& url, Renderer renderer, uint32_t width, uint32_t height ) = 0;
+
+ /**
+ * @brief Starts the rendering.
+ *
+ * @return True if the renderer is successfully started, false otherwise
+ */
+ virtual bool StartRender() = 0;
+
+ /**
+ * @brief Stops the rendering.
+ */
+ virtual void StopRender() = 0;
+
+ /**
+ * @brief Renders the content to the target buffer synchronously.
+ *
+ * @param[in] frameNumber The frame number to be rendered
+ */
+ virtual void Render( uint32_t frameNumber ) = 0;
+
+ /**
+ * @brief Gets the total number of frames of the file
+ *
+ * @return The total number of frames
+ */
+ virtual uint32_t GetTotalFrameNumber() = 0;
+
+ /**
+ * @brief Function pointer called in adaptor to create a plugin instance.
+ */
+ using CreateVectorAnimationRendererFunction = VectorAnimationRendererPlugin* (*)();
+};
+
+} // namespace Dali
+
+#endif // DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/vector-animation/common/vector-animation-renderer-impl.h>
+
+namespace Dali
+{
+
+VectorAnimationRenderer VectorAnimationRenderer::New( const std::string& url, Renderer renderer, uint32_t width, uint32_t height )
+{
+ Internal::Adaptor::VectorAnimationRendererPtr animationRenderer = Internal::Adaptor::VectorAnimationRenderer::New();
+ if( animationRenderer )
+ {
+ animationRenderer->Initialize( url, renderer, width, height );
+ }
+
+ return VectorAnimationRenderer( animationRenderer.Get() );
+}
+
+VectorAnimationRenderer::VectorAnimationRenderer()
+{
+}
+
+VectorAnimationRenderer::~VectorAnimationRenderer()
+{
+}
+
+VectorAnimationRenderer::VectorAnimationRenderer( Internal::Adaptor::VectorAnimationRenderer* internal )
+: BaseHandle( internal )
+{
+}
+
+VectorAnimationRenderer::VectorAnimationRenderer( const VectorAnimationRenderer& handle )
+: BaseHandle( handle )
+{
+}
+
+VectorAnimationRenderer& VectorAnimationRenderer::operator=( const VectorAnimationRenderer& rhs )
+{
+ BaseHandle::operator=( rhs );
+ return *this;
+}
+
+bool VectorAnimationRenderer::StartRender()
+{
+ return GetImplementation( *this ).StartRender();
+}
+
+void VectorAnimationRenderer::StopRender()
+{
+ GetImplementation( *this ).StopRender();
+}
+
+void VectorAnimationRenderer::Render( uint32_t frameNumber )
+{
+ GetImplementation( *this ).Render( frameNumber );
+}
+
+uint32_t VectorAnimationRenderer::GetTotalFrameNumber()
+{
+ return GetImplementation( *this ).GetTotalFrameNumber();
+}
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_VECTOR_ANIMATION_RENDERER_H
+#define DALI_VECTOR_ANIMATION_RENDERER_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/rendering/renderer.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_adaptor_framework
+ * @{
+ */
+
+namespace Internal DALI_INTERNAL
+{
+namespace Adaptor
+{
+class VectorAnimationRenderer;
+}
+}
+
+/**
+ * @brief Used for rendering a vector animation file
+ */
+class DALI_ADAPTOR_API VectorAnimationRenderer : public BaseHandle
+{
+public:
+
+ /**
+ * @brief Creates an initialized handle to a new VectorAnimationRenderer.
+ *
+ * @param[in] url The url of the vector animation file
+ * @param[in] renderer The renderer used to render the image
+ * @param[in] width The width of the content
+ * @param[in] height The height of the content
+ * @return A handle to a newly allocated VectorAnimationRenderer
+ */
+ static VectorAnimationRenderer New( const std::string& url, Renderer renderer, uint32_t width, uint32_t height );
+
+ /**
+ * @brief Creates an empty handle.
+ * Use VectorAnimationRenderer::New() to create an initialized object.
+ */
+ VectorAnimationRenderer();
+
+ /**
+ * @brief Destructor.
+ */
+ ~VectorAnimationRenderer();
+
+ /**
+ * @brief This copy constructor is required for (smart) pointer semantics.
+ *
+ * @param[in] handle A reference to the copied handle
+ */
+ VectorAnimationRenderer( const VectorAnimationRenderer& handle );
+
+ /**
+ * @brief This assignment operator is required for (smart) pointer semantics.
+ *
+ * @param[in] rhs A reference to the copied handle
+ * @return A reference to this
+ */
+ VectorAnimationRenderer& operator=( const VectorAnimationRenderer& rhs );
+
+ /**
+ * @brief Starts the rendering.
+ *
+ * @return True if the renderer is successfully started, false otherwise.
+ */
+ bool StartRender();
+
+ /**
+ * @brief Stops the rendering.
+ */
+ void StopRender();
+
+ /**
+ * @brief Renders the content to the target buffer synchronously.
+ *
+ * @param[in] frameNumber The frame number to be rendered
+ */
+ void Render( uint32_t frameNumber );
+
+ /**
+ * @brief Gets the total number of frames of the file
+ *
+ * @return The total number of frames
+ */
+ uint32_t GetTotalFrameNumber();
+
+public: // Signals
+
+public: // Not intended for application developers
+
+ /// @cond internal
+ /**
+ * @brief The constructor.
+ * @note Not intended for application developers.
+ *
+ * @param[in] pointer A pointer to a newly allocated VectorAnimationRenderer
+ */
+ explicit DALI_INTERNAL VectorAnimationRenderer( Internal::Adaptor::VectorAnimationRenderer* internal );
+ /// @endcond
+
+};
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // DALI_VECTOR_ANIMATION_RENDERER_H
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/internal/window-system/common/window-impl.h>
+
+namespace Dali
+{
+
+namespace DevelWindow
+{
+
+void SetPositionSize( Window window, PositionSize positionSize )
+{
+ GetImplementation( window ).SetPositionSize( positionSize );
+}
+
+} // namespace DevelWindow
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_WINDOW_DEVEL_H
+#define DALI_WINDOW_DEVEL_H
+
+/*
+ * 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.
+ * 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/adaptor-framework/window.h>
+
+namespace Dali
+{
+
+namespace DevelWindow
+{
+
+/**
+ * @brief Sets position and size of the window. This API guarantees that both moving and resizing of window will appear on the screen at once.
+ *
+ * @param[in] window The window instance
+ * @param[in] positionSize The new window position and size
+ */
+DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
+
+} // namespace DevelWindow
+
+} // namespace Dali
+
+#endif // DALI_WINDOW_DEVEL_H
$(adaptor_devel_api_dir)/adaptor-framework/style-monitor.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/tilt-sensor.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/lifecycle-controller.cpp \
+ $(adaptor_devel_api_dir)/adaptor-framework/vector-animation-renderer.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/video-player.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/thread-settings.cpp \
- $(adaptor_devel_api_dir)/adaptor-framework/web-engine.cpp
+ $(adaptor_devel_api_dir)/adaptor-framework/web-engine.cpp \
+ $(adaptor_devel_api_dir)/adaptor-framework/window-devel.cpp
$(adaptor_devel_api_dir)/adaptor-framework/sound-player.h \
$(adaptor_devel_api_dir)/adaptor-framework/style-monitor.h \
$(adaptor_devel_api_dir)/adaptor-framework/tilt-sensor.h \
+ $(adaptor_devel_api_dir)/adaptor-framework/vector-animation-renderer.h \
+ $(adaptor_devel_api_dir)/adaptor-framework/vector-animation-renderer-plugin.h \
$(adaptor_devel_api_dir)/adaptor-framework/video-player.h \
$(adaptor_devel_api_dir)/adaptor-framework/video-player-plugin.h \
$(adaptor_devel_api_dir)/adaptor-framework/web-engine.h \
$(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.h \
$(adaptor_devel_api_dir)/adaptor-framework/physical-keyboard.h \
$(adaptor_devel_api_dir)/adaptor-framework/key-devel.h \
- $(adaptor_devel_api_dir)/adaptor-framework/thread-settings.h
+ $(adaptor_devel_api_dir)/adaptor-framework/thread-settings.h \
+ $(adaptor_devel_api_dir)/adaptor-framework/window-devel.h
devel_api_text_abstraction_src_files = \
$(adaptor_devel_api_dir)/text-abstraction/bidirectional-support.cpp \
void SceneCreated();
/**
- * @copydoc Dali::Application::SetViewMode();
- */
- void SetViewMode( ViewMode viewMode );
-
- /**
- * @copydoc Dali::Application::SetStereoBase();
- */
- void SetStereoBase( float stereoBase );
-
- /**
* @brief Renders once more even if we're paused
* @note Will not work if the window is hidden.
*/
virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
/**
- * @brief Set the stereoscopic 3D view mode
- * @param[in] viewMode The new view mode
- */
- virtual void SetViewMode( ViewMode viewMode ) = 0;
-
- /**
* @brief Called when Render thread has started
*/
virtual void StartRender() = 0;
mCallbackManager = CallbackManager::New();
WindowPane defaultWindow = mWindowFrame.front();
+
+ DALI_ASSERT_DEBUG( defaultWindow.surface && "Surface not initialized" );
+
PositionSize size = defaultWindow.surface->GetPositionSize();
mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions);
mVSyncMonitor = new VSyncMonitor;
- if( defaultWindow.surface )
- {
- mDisplayConnection = Dali::DisplayConnection::New( *mGraphics, defaultWindow.surface->GetSurfaceType() );
- }
- else
- {
- mDisplayConnection = Dali::DisplayConnection::New( *mGraphics );
- }
+ mDisplayConnection = Dali::DisplayConnection::New( *mGraphics, defaultWindow.surface->GetSurfaceType() );
mThreadController = new ThreadController( *this, *mEnvironmentOptions );
newDefaultWindow.nativeWindow = nativeWindow;
newDefaultWindow.surface = &newSurface;
- // Must delete the old Window first before replacing it with the new one
WindowPane oldDefaultWindow = mWindowFrame.front();
- oldDefaultWindow.surface->DestroySurface();
// Update WindowFrame
std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
// This method blocks until the render thread has completed the replace.
mThreadController->ReplaceSurface( newDefaultWindow.surface );
+
+ // Must delete the old Window only after the render thread has completed the replace
+ oldDefaultWindow.surface->DestroySurface();
+ oldDefaultWindow.surface = nullptr;
}
RenderSurface& Adaptor::GetSurface() const
mCore( nullptr ),
mThreadController( nullptr ),
mVSyncMonitor( nullptr ),
+ mGraphics( nullptr ),
mDisplayConnection( nullptr ),
+ mWindowFrame(),
mPlatformAbstraction( nullptr ),
mEventHandler( nullptr ),
mCallbackManager( nullptr ),
gThreadLocalAdaptor = this;
}
-// Stereoscopy
-
-void Adaptor::SetViewMode( ViewMode viewMode )
-{
- WindowPane defaultWindow = mWindowFrame.front();
- defaultWindow.surface->SetViewMode( viewMode );
-
- mCore->SetViewMode( viewMode );
-}
-
-ViewMode Adaptor::GetViewMode() const
-{
- return mCore->GetViewMode();
-}
-
-void Adaptor::SetStereoBase( float stereoBase )
-{
- mCore->SetStereoBase( stereoBase );
-}
-
-float Adaptor::GetStereoBase() const
-{
- return mCore->GetStereoBase();
-}
-
void Adaptor::SetRootLayoutDirection( std::string locale )
{
Dali::Stage stage = Dali::Stage::GetCurrent();
*/
virtual TraceInterface& GetSystemTraceInterface();
-public: // Stereoscopy
-
- /**
- * @copydoc Dali::Integration::Core::SetViewMode()
- */
- void SetViewMode( ViewMode viewMode );
-
- /**
- * @copydoc Dali::Integration::Core::GetViewMode()
- */
- ViewMode GetViewMode() const;
-
- /**
- * @copydoc Dali::Integration::Core::SetStereoBase()
- */
- void SetStereoBase( float stereoBase );
-
- /**
- * @copydoc Dali::Integration::Core::GetStereoBase()
- */
- float GetStereoBase() const;
-
public: // Signals
/**
mImpl->SceneCreated();
}
-void Adaptor::SetViewMode( ViewMode mode )
-{
- mImpl->SetViewMode( mode );
-}
-
-void Adaptor::SetStereoBase( float stereoBase )
-{
- mImpl->SetStereoBase( stereoBase );
-}
-
void Adaptor::RenderOnce()
{
mImpl->RenderOnce();
mAdaptor->SetUseHardwareVSync(false);
}
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetStereoBase( mCommandLineOptions->stereoBase );
- if( mCommandLineOptions->viewMode != 0 )
- {
- ViewMode viewMode = MONO;
- if( mCommandLineOptions->viewMode <= STEREO_INTERLACED )
- {
- viewMode = static_cast<ViewMode>( mCommandLineOptions->viewMode );
- }
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetViewMode( viewMode );
- }
-
if( ! mStylesheet.empty() )
{
Dali::StyleMonitor::Get().SetTheme( mStylesheet );
return mMainWindow;
}
-// Stereoscopy
-
-void Application::SetViewMode( ViewMode viewMode )
-{
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetViewMode( viewMode );
-}
-
-ViewMode Application::GetViewMode() const
-{
- return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetViewMode();
-}
-
-void Application::SetStereoBase( float stereoBase )
-{
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetStereoBase( stereoBase );
-}
-
-float Application::GetStereoBase() const
-{
- return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetStereoBase();
-}
-
void Application::ReplaceWindow( const PositionSize& positionSize, const std::string& name )
{
Dali::Window newWindow = Dali::Window::New( positionSize, name, mMainWindowMode == Dali::Application::TRANSPARENT );
*/
static ApplicationPtr GetPreInitializedApplication();
-public: // Stereoscopy
-
- /**
- * @copydoc Dali::Application::SetViewMode()
- */
- void SetViewMode( ViewMode viewMode );
-
- /**
- * @copydoc Dali::Application::GetViewMode()
- */
- ViewMode GetViewMode() const;
-
- /**
- * @copydoc Dali::Application::SetStereoBase()
- */
- void SetStereoBase( float stereoBase );
-
- /**
- * @copydoc Dali::Application::GetStereoBase()
- */
- float GetStereoBase() const;
-
public: // Lifecycle functionality
/**
// 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->ReplaceGraphicsSurface();
SurfaceReplaced();
}
}
}
- RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->PreRender( surfaceResized );
// Inform core of context destruction & shutdown EGL
mCore.ContextDestroyed();
+ currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
{
currentSurface->DestroySurface();
/*
- * Copyright (c) 2014 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.
{ "width", "Stage Width" },
{ "height", "Stage Height" },
{ "dpi", "Emulated DPI" },
- { "view", "Stereocopic 3D view mode ([0]=MONO, 1=STEREO_HORIZONTAL, 2=STEREO_VERTICAL, 3=STEREO_INTERLACED)" },
- { "stereo-base", "Distance in millimeters between left/right cameras [65.0]" },
{ "help", "Help" },
{ NULL, NULL }
};
OPTION_STAGE_WIDTH,
OPTION_STAGE_HEIGHT,
OPTION_DPI,
- OPTION_STEREO_MODE,
- OPTION_STEREO_BASE,
OPTION_HELP
};
-typedef Dali::Vector< int > UnhandledContainer;
+typedef Dali::Vector< int32_t > UnhandledContainer;
void ShowHelp()
{
} // unnamed namespace
-CommandLineOptions::CommandLineOptions(int *argc, char **argv[])
+CommandLineOptions::CommandLineOptions(int32_t *argc, char **argv[])
: noVSyncOnRender(0),
- stageWidth(0), stageHeight(0),
- viewMode(0),
- stereoBase(65)
+ stageWidth(0), stageHeight(0)
{
// Exit gracefully if no arguments provided
if ( !argc || !argv )
if ( *argc > 1 )
{
// We do not want to print out errors.
- int origOptErrValue( opterr );
+ int32_t origOptErrValue( opterr );
opterr = 0;
- int help( 0 );
+ int32_t help( 0 );
const struct option options[]=
{
{ EXPECTED_ARGS[OPTION_STAGE_WIDTH].opt, required_argument, NULL, 'w' }, // "--width"
{ EXPECTED_ARGS[OPTION_STAGE_HEIGHT].opt, required_argument, NULL, 'h' }, // "--height"
{ EXPECTED_ARGS[OPTION_DPI].opt, required_argument, NULL, 'd' }, // "--dpi"
- { EXPECTED_ARGS[OPTION_STEREO_MODE].opt, required_argument, NULL, 'v' }, // "--view"
- { EXPECTED_ARGS[OPTION_STEREO_BASE].opt, required_argument, NULL, 's' }, // "--stereo-base"
{ EXPECTED_ARGS[OPTION_HELP].opt, no_argument, &help, '?' }, // "--help"
{ 0, 0, 0, 0 } // end of options
};
- int shortOption( 0 );
- int optionIndex( 0 );
+ int32_t shortOption( 0 );
+ int32_t optionIndex( 0 );
- const char* optString = "-w:h:d:v:s:"; // The '-' ensures that argv is NOT permuted
+ const char* optString = "-w:h:d:"; // The '-' ensures that argv is NOT permuted
bool optionProcessed( false );
UnhandledContainer unhandledOptions; // We store indices of options we do not handle here
break;
}
- case 'v':
- {
- if ( optarg )
- {
- viewMode = atoi(optarg);
- optionProcessed = true;
- }
- break;
- }
-
- case 's':
- {
- if ( optarg )
- {
- stereoBase = atoi(optarg);
- optionProcessed = true;
- }
- break;
- }
-
case -1:
{
// All command-line options have been parsed.
{
if ( unhandledOptions.Count() > 0 )
{
- int index( 1 );
+ int32_t index( 1 );
// Overwrite the argv with the values from the unhandled indices
const UnhandledContainer::ConstIterator endIter = unhandledOptions.End();
#define __DALI_INTERNAL_COMMAND_LINE_OPTIONS_H__
/*
- * Copyright (c) 2014 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 <string>
+#include <cstdint> // int32_t
namespace Dali
{
* -w|--width Stage Width
* -h|--height Stage Height
* -d|--dpi Emulated DPI
- * -v|--view Viewing mode
- * -s|--stereo-base Eye separation for stereoscopic rendering (in mm)
* --help Help
* @endcode
*
* @param[in,out] argv The argument list
* @note Supported options are stripped from argv, and argc is updated appropriately.
*/
- CommandLineOptions(int *argc, char **argv[]);
+ CommandLineOptions( int32_t *argc, char **argv[] );
/**
* Destructor
public: // Command line parsed values
- int noVSyncOnRender; ///< If 1, then the user does not want VSync on Render
- int stageWidth; ///< The width of the stage required. 0 if not set.
- int stageHeight; ///< The height of the stage required. 0 if not set.
- int viewMode; ///< Stereocopic 3D view mode (0=MONO, 1=STEREO_HORIZONTAL, 2=STEREO_VERTICAL, 3=STEREO_INTERLACED)
- int stereoBase; ///< The distance in millimeters between left/right cameras
- std::string stageDPI; ///< DPI stored as hxv, where h is horizontal DPI and v is vertical DPI
+ int32_t noVSyncOnRender; ///< If 1, then the user does not want VSync on Render
+ int32_t stageWidth; ///< The width of the stage required. 0 if not set.
+ int32_t stageHeight; ///< The height of the stage required. 0 if not set.
+ std::string stageDPI; ///< DPI stored as hxv, where h is horizontal DPI and v is vertical DPI
};
} // namespace Adaptor
{ "bo", "Tibetan", Locale::LeftToRight },
{ "bs", "Bosnian", Locale::LeftToRight },
{ "ca", "Catalan", Locale::LeftToRight },
+ { "ck", "Iraq", Locale::RightToLeft },
{ "cs", "Czech", Locale::LeftToRight },
{ "cy", "Welsh", Locale::LeftToRight },
{ "da", "Danish", Locale::LeftToRight },
{ "it", "Italian", Locale::LeftToRight },
{ "ja", "Japanese", Locale::LeftToRight },
{ "ka", "Georgian", Locale::LeftToRight },
- { "kk", "Kazakh", Locale::RightToLeft },
+ { "kk", "Kazakh", Locale::LeftToRight },
{ "km", "Khmer", Locale::LeftToRight },
{ "kn", "Kannada", Locale::LeftToRight },
{ "ko", "Korean", Locale::LeftToRight },
CallbackBase::Execute( *data->mRemoveFromContainerFunction, data );
ecore_idler_del( data->mIdler );
+
+ // delete our data
+ delete data;
+
+ return;
}
}
}
CallbackBase::Execute( *data->mRemoveFromContainerFunction, data );
ecore_idle_enterer_del( data->mIdleEnterer );
+
+ // delete our data
+ delete data;
+
+ return;
}
}
}
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/vector-animation/common/vector-animation-renderer-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/type-registry.h>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace // unnamed namespace
+{
+
+// Type Registration
+Dali::BaseHandle Create()
+{
+ return Dali::BaseHandle();
+}
+
+Dali::TypeRegistration type( typeid( Dali::VectorAnimationRenderer ), typeid( Dali::BaseHandle ), Create );
+
+} // unnamed namespace
+
+VectorAnimationRendererPtr VectorAnimationRenderer::New()
+{
+ VectorAnimationRendererPtr renderer = new VectorAnimationRenderer();
+ return renderer;
+}
+
+VectorAnimationRenderer::VectorAnimationRenderer()
+: mPlugin( std::string() )
+{
+}
+
+VectorAnimationRenderer::~VectorAnimationRenderer()
+{
+}
+
+void VectorAnimationRenderer::Initialize( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height )
+{
+ mPlugin.CreateRenderer( url, renderer, width, height );
+}
+
+bool VectorAnimationRenderer::StartRender()
+{
+ return mPlugin.StartRender();
+}
+
+void VectorAnimationRenderer::StopRender()
+{
+ mPlugin.StopRender();
+}
+
+void VectorAnimationRenderer::Render( uint32_t frameNumber )
+{
+ mPlugin.Render( frameNumber );
+}
+
+uint32_t VectorAnimationRenderer::GetTotalFrameNumber()
+{
+ return mPlugin.GetTotalFrameNumber();
+}
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_H
+#define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-object.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
+#include <dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class VectorAnimationRenderer;
+using VectorAnimationRendererPtr = IntrusivePtr< VectorAnimationRenderer >;
+
+/**
+ * Dali internal VectorAnimationRenderer.
+ */
+class VectorAnimationRenderer : public BaseObject
+{
+public:
+
+ /**
+ * @brief Creates a VectorAnimationRenderer object.
+ *
+ * @param[in] url The url of the vector animation file
+ */
+ static VectorAnimationRendererPtr New();
+
+ /**
+ * @brief Initializes member data.
+ */
+ void Initialize( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height );
+
+ /**
+ * @copydoc Dali::VectorAnimationRenderer::StartRender()
+ */
+ bool StartRender();
+
+ /**
+ * @copydoc Dali::VectorAnimationRenderer::StopRender()
+ */
+ void StopRender();
+
+ /**
+ * @copydoc Dali::VectorAnimationRenderer::Render()
+ */
+ void Render( uint32_t frameNumber );
+
+ /**
+ * @copydoc Dali::VectorAnimationRenderer::GetTotalFrameNumber()
+ */
+ uint32_t GetTotalFrameNumber();
+
+private:
+
+ /**
+ * @brief Constructor
+ */
+ VectorAnimationRenderer();
+
+ /**
+ * @brief Destructor.
+ */
+ ~VectorAnimationRenderer();
+
+private:
+
+ VectorAnimationRenderer( const VectorAnimationRenderer& ) = delete;
+ VectorAnimationRenderer& operator=( VectorAnimationRenderer& ) = delete;
+
+private:
+
+ VectorAnimationRendererPluginProxy mPlugin;
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+inline static Internal::Adaptor::VectorAnimationRenderer& GetImplementation( Dali::VectorAnimationRenderer& renderer )
+{
+ DALI_ASSERT_ALWAYS( renderer && "VectorAnimationRenderer handle is empty." );
+
+ BaseObject& handle = renderer.GetBaseObject();
+
+ return static_cast< Internal::Adaptor::VectorAnimationRenderer& >( handle );
+}
+
+inline static const Internal::Adaptor::VectorAnimationRenderer& GetImplementation( const Dali::VectorAnimationRenderer& renderer )
+{
+ DALI_ASSERT_ALWAYS( renderer && "VectorAnimationRenderer handle is empty." );
+
+ const BaseObject& handle = renderer.GetBaseObject();
+
+ return static_cast< const Internal::Adaptor::VectorAnimationRenderer& >( handle );
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_H
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h>
+
+// EXTERNAL INCLUDES
+#include <dlfcn.h>
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace
+{
+
+// The default plugin name
+const char* DEFAULT_OBJECT_NAME( "libdali-vector-animation-renderer-plugin.so" );
+
+}
+
+VectorAnimationRendererPluginProxy::VectorAnimationRendererPluginProxy( const std::string& sharedObjectName )
+: mSharedObjectName(),
+ mLibHandle( NULL ),
+ mPlugin( NULL ),
+ mCreateVectorAnimationRendererPtr( NULL )
+{
+ if( !sharedObjectName.empty() )
+ {
+ mSharedObjectName = sharedObjectName;
+ }
+ else
+ {
+ mSharedObjectName = DEFAULT_OBJECT_NAME;
+ }
+
+ Initialize();
+}
+
+VectorAnimationRendererPluginProxy::~VectorAnimationRendererPluginProxy()
+{
+ if( mPlugin )
+ {
+ delete mPlugin;
+ mPlugin = NULL;
+
+ if( mLibHandle && dlclose( mLibHandle ) )
+ {
+ DALI_LOG_ERROR( "Error closing vector animation renderer plugin library: %s\n", dlerror() );
+ }
+ }
+}
+
+void VectorAnimationRendererPluginProxy::Initialize()
+{
+ mLibHandle = dlopen( mSharedObjectName.c_str(), RTLD_LAZY );
+
+ char* error = dlerror();
+ if( mLibHandle == NULL || error != NULL )
+ {
+ DALI_LOG_ERROR( "VectorAnimationRendererPluginProxy::Initialize: dlopen error [%s]\n", error );
+ return;
+ }
+
+ // load plugin
+ mCreateVectorAnimationRendererPtr = reinterpret_cast< CreateVectorAnimationRendererFunction >( dlsym( mLibHandle, "CreateVectorAnimationRendererPlugin" ) );
+
+ error = dlerror();
+ if( mCreateVectorAnimationRendererPtr == NULL || error != NULL )
+ {
+ DALI_LOG_ERROR( "VectorAnimationRendererPluginProxy::Initialize: Cannot load symbol: %s\n", error );
+ return;
+ }
+
+ mPlugin = mCreateVectorAnimationRendererPtr();
+ if( !mPlugin )
+ {
+ DALI_LOG_ERROR("VectorAnimationRendererPluginProxy::Initialize: Plugin creation failed\n");
+ return;
+ }
+}
+
+bool VectorAnimationRendererPluginProxy::CreateRenderer( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height )
+{
+ if( mPlugin )
+ {
+ return mPlugin->CreateRenderer( url, renderer, width, height );
+ }
+ return false;
+}
+
+bool VectorAnimationRendererPluginProxy::StartRender()
+{
+ if( mPlugin )
+ {
+ return mPlugin->StartRender();
+ }
+ return false;
+}
+
+void VectorAnimationRendererPluginProxy::StopRender()
+{
+ if( mPlugin )
+ {
+ mPlugin->StopRender();
+ }
+}
+
+void VectorAnimationRendererPluginProxy::Render( uint32_t frameNumber )
+{
+ if( mPlugin )
+ {
+ mPlugin->Render( frameNumber );
+ }
+}
+
+uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber()
+{
+ if( mPlugin )
+ {
+ return mPlugin->GetTotalFrameNumber();
+ }
+ return 0;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_H
+#define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Proxy class to dynamically load, use and unload vector animation renderer plugin.
+ */
+class VectorAnimationRendererPluginProxy
+{
+public:
+
+ /**
+ * @brief Constructor
+ */
+ VectorAnimationRendererPluginProxy( const std::string& sharedObjectName );
+
+ /**
+ * @brief Destructor
+ */
+ ~VectorAnimationRendererPluginProxy();
+
+ /**
+ * @copydoc Dali::VectorAnimationRendererPlugin::CreateRenderer()
+ */
+ bool CreateRenderer( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height );
+
+ /**
+ * @copydoc Dali::VectorAnimationRendererPlugin::StartRender()
+ */
+ bool StartRender();
+
+ /**
+ * @copydoc Dali::VectorAnimationRendererPlugin::StopRender()
+ */
+ void StopRender();
+
+ /**
+ * @copydoc Dali::VectorAnimationRendererPlugin::Render()
+ */
+ void Render( uint32_t frameNumber );
+
+ /**
+ * @copydoc Dali::VectorAnimationRendererPlugin::GetTotalFrameNumber()
+ */
+ uint32_t GetTotalFrameNumber();
+
+private:
+
+ /**
+ * Dynamically loads the plugin.
+ */
+ void Initialize();
+
+private:
+
+ using CreateVectorAnimationRendererFunction = Dali::VectorAnimationRendererPlugin* (*)();
+
+ std::string mSharedObjectName; ///< Shared object name
+ void* mLibHandle; ///< Handle for the loaded library
+ Dali::VectorAnimationRendererPlugin* mPlugin; ///< Plugin handle
+
+ CreateVectorAnimationRendererFunction mCreateVectorAnimationRendererPtr; ///< Function pointer called in adaptor to create a plugin instance
+
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_H
--- /dev/null
+
+
+# module: vector-animation, backend: common
+adaptor_vector_animation_common_src_files=\
+ ${adaptor_vector_animation_dir}/common/vector-animation-renderer-impl.cpp \
+ ${adaptor_vector_animation_dir}/common/vector-animation-renderer-plugin-proxy.cpp
+
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
/**
- * @brief Set the stereoscopic 3D view mode
- * @param[in] viewMode The new view mode
- */
- virtual void SetViewMode( ViewMode viewMode ) = 0;
-
- /**
* @brief Get the screen rotation angle of the window
*/
virtual int GetScreenRotationAngle() = 0;
mResizeEnabled = true;
}
- PositionSize positionSize = mSurface->GetPositionSize();
+ PositionSize oldRect = mSurface->GetPositionSize();
- if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() )
- {
- positionSize.width = size.GetWidth();
- positionSize.height = size.GetHeight();
+ mSurface->MoveResize( PositionSize( oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight() ) );
- mSurface->MoveResize( positionSize );
+ PositionSize newRect = mSurface->GetPositionSize();
+
+ // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
+ if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
+ {
+ Uint16Pair newSize( newRect.width, newRect.height );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( newSize );
- // Emit signal
- mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
+ mResizedSignal.Emit( newSize );
- mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( newSize );
}
}
mResizeEnabled = true;
}
- PositionSize positionSize = mSurface->GetPositionSize();
-
- if( positionSize.x != position.GetX() || positionSize.y != position.GetY() )
- {
- positionSize.x = position.GetX();
- positionSize.y = position.GetY();
+ PositionSize oldRect = mSurface->GetPositionSize();
- mSurface->MoveResize( positionSize );
- }
+ mSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
}
Dali::Window::WindowPosition Window::GetPosition() const
return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
}
+void Window::SetPositionSize( PositionSize positionSize )
+{
+ if( !mResizeEnabled )
+ {
+ AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
+ mResizeEnabled = true;
+ }
+
+ PositionSize oldRect = mSurface->GetPositionSize();
+
+ mSurface->MoveResize( positionSize );
+
+ PositionSize newRect = mSurface->GetPositionSize();
+
+ // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
+ if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
+ {
+ Uint16Pair newSize( newRect.width, newRect.height );
+
+ mAdaptor->SurfaceResizePrepare( newSize );
+
+ mResizedSignal.Emit( newSize );
+
+ mAdaptor->SurfaceResizeComplete( newSize );
+ }
+}
+
void Window::SetTransparency( bool transparent )
{
mSurface->SetTransparency( transparent );
Dali::Window::WindowPosition GetPosition() const;
/**
+ * @copydoc Dali::DevelWindow::SetPositionSize()
+ */
+ void SetPositionSize( PositionSize positionSize );
+
+ /**
* @copydoc Dali::Window::SetTransparency()
*/
void SetTransparency( bool transparent );
mThreadSynchronization( NULL ),
mRenderNotification( NULL ),
mRotationTrigger( NULL ),
+ mGraphics( nullptr ),
mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
mOutputTransformedSignal(),
mRotationAngle( 0 ),
DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height );
}
-void WindowRenderSurface::SetViewMode( ViewMode viewMode )
-{
- mWindowBase->SetViewMode( viewMode );
-}
-
void WindowRenderSurface::StartRender()
{
}
}
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
- auto mGLES = eglGraphics->GetGlesInterface();
- mGLES.PreRender();
+ if ( eglGraphics )
+ {
+ GlImplementation& mGLES = eglGraphics->GetGlesInterface();
+ mGLES.PreRender();
+ }
return true;
}
{
// Inform the gl implementation that rendering has finished before informing the surface
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
- auto mGLES = eglGraphics->GetGlesInterface();
- mGLES.PostRender();
-
- if( renderToFbo )
+ if ( eglGraphics )
{
- mGLES.Flush();
- mGLES.Finish();
- }
- else
- {
- if( resizingSurface )
+ GlImplementation& mGLES = eglGraphics->GetGlesInterface();
+ mGLES.PostRender();
+
+ if( renderToFbo )
{
- if( !mRotationFinished )
+ mGLES.Flush();
+ mGLES.Finish();
+ }
+ else
+ {
+ if( resizingSurface )
{
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
+ if( !mRotationFinished )
+ {
+ DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
- mRotationTrigger->Trigger();
+ mRotationTrigger->Trigger();
- if( mThreadSynchronization )
- {
- // Wait until the event-thread complete the rotation event processing
- mThreadSynchronization->PostRenderWaitForCompletion();
+ if( mThreadSynchronization )
+ {
+ // Wait until the event-thread complete the rotation event processing
+ mThreadSynchronization->PostRenderWaitForCompletion();
+ }
}
}
}
- }
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers();
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ eglImpl.SwapBuffers();
- if( mRenderNotification )
- {
- mRenderNotification->Trigger();
+ if( mRenderNotification )
+ {
+ mRenderNotification->Trigger();
+ }
}
}
virtual void MoveResize( Dali::PositionSize positionSize) override;
/**
- * @copydoc Dali::RenderSurface::SetViewMode()
- */
- virtual void SetViewMode( ViewMode viewMode ) override;
-
- /**
* @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender() override;
dpiVertical = int( yres + 0.5f );
}
-void WindowBaseEcoreWl::SetViewMode( ViewMode viewMode )
-{
-}
-
int WindowBaseEcoreWl::GetScreenRotationAngle()
{
int transform = 0;
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetViewMode()
- */
- virtual void SetViewMode( ViewMode viewMode ) override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
virtual int GetScreenRotationAngle() override;
#include <Ecore_Input.h>
#include <vconf.h>
#include <vconf-keys.h>
+#include <wayland-egl-tizen.h>
namespace Dali
{
mBrightness( 0 ),
mBrightnessChangeState( 0 ),
mBrightnessChangeDone( true ),
- mOwnSurface( false )
+ mOwnSurface( false ),
+ mMoveResizeSerial( 0 ),
+ mLastSubmittedMoveResizeSerial( 0 )
#ifdef DALI_ELDBUS_AVAILABLE
, mSystemConnection( NULL )
#endif
void WindowBaseEcoreWl2::ResizeEglWindow( PositionSize positionSize )
{
wl_egl_window_resize( mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y );
+
+ // Note: Both "Resize" and "MoveResize" cases can reach here, but only "MoveResize" needs to submit serial number
+ if( mMoveResizeSerial != mLastSubmittedMoveResizeSerial )
+ {
+ wl_egl_window_tizen_set_window_serial( mEglWindow, mMoveResizeSerial );
+ mLastSubmittedMoveResizeSerial = mMoveResizeSerial;
+ }
}
bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
void WindowBaseEcoreWl2::MoveResize( PositionSize positionSize )
{
- ecore_wl2_window_position_set( mEcoreWindow, positionSize.x, positionSize.y );
- ecore_wl2_window_geometry_set( mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
+ ecore_wl2_window_sync_geometry_set( mEcoreWindow, ++mMoveResizeSerial, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
}
void WindowBaseEcoreWl2::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode )
dpiVertical = int( yres + 0.5f );
}
-void WindowBaseEcoreWl2::SetViewMode( ViewMode viewMode )
-{
-}
-
int WindowBaseEcoreWl2::GetScreenRotationAngle()
{
int transform = 0;
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetViewMode()
- */
- virtual void SetViewMode( ViewMode viewMode ) override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
virtual int GetScreenRotationAngle() override;
bool mOwnSurface;
+ volatile uint32_t mMoveResizeSerial;
+ uint32_t mLastSubmittedMoveResizeSerial;
+
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize, bool isTransparent )
: mPosition( positionSize ),
mRenderNotification( NULL ),
+ mGraphics( NULL ),
mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ),
mOwnSurface( false ),
{
}
-void NativeRenderSurfaceEcoreWl::SetViewMode( ViewMode viewMode )
-{
-}
-
void NativeRenderSurfaceEcoreWl::StartRender()
{
}
void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
{
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ if ( eglGraphics )
+ {
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers();
+ eglImpl.SwapBuffers();
+ }
if( mThreadSynchronization )
{
virtual void MoveResize( Dali::PositionSize positionSize) override;
/**
- * @copydoc Dali::RenderSurface::SetViewMode()
- */
- virtual void SetViewMode( ViewMode viewMode ) override;
-
- /**
* @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender() override;
/*
- * Copyright (c) 2017 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.
}
PixmapRenderSurfaceEcoreX::PixmapRenderSurfaceEcoreX( Dali::PositionSize positionSize, Any surface, bool isTransparent )
-: mPosition( positionSize ),
+: mGraphics( nullptr ),
+ mDisplayConnection( nullptr ),
+ mPosition( positionSize ),
mRenderNotification( NULL ),
mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
mOwnSurface( false ),
mProduceBufferIndex( INITIAL_PRODUCE_BUFFER_INDEX ),
mConsumeBufferIndex( INITIAL_CONSUME_BUFFER_INDEX ),
- mThreadSynchronization(NULL)
+ mX11Pixmaps(),
+ mEglSurfaces(),
+ mThreadSynchronization( nullptr ),
+ mPixmapCondition()
{
for( int i = 0; i != BUFFER_COUNT; ++i )
{
virtual void MoveResize( Dali::PositionSize positionSize) override {}
/**
- * @copydoc Dali::RenderSurface::SetViewMode()
- */
- void SetViewMode( ViewMode viewMode ) override {}
-
- /**
* @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender() override;
dpiVertical = int( yres + 0.5f );
}
-void WindowBaseEcoreX::SetViewMode( ViewMode viewMode )
-{
- Ecore_X_Atom viewModeAtom( ecore_x_atom_get( "_E_COMP_3D_APP_WIN" ) );
-
- if( viewModeAtom != None )
- {
- unsigned int value( static_cast< unsigned int >( viewMode ) );
- ecore_x_window_prop_card32_set( mEcoreWindow, viewModeAtom, &value, 1 );
- }
-}
-
int WindowBaseEcoreX::GetScreenRotationAngle()
{
return 0;
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetViewMode()
- */
- virtual void SetViewMode( ViewMode viewMode ) override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
virtual int GetScreenRotationAngle() override;
return Internal::Adaptor::GetImplementation(*this).GetLanguage();
}
-void Application::SetViewMode( ViewMode viewMode )
+void Application::SetViewMode( ViewMode /*viewMode*/ )
{
- Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
}
ViewMode Application::GetViewMode() const
{
- return Internal::Adaptor::GetImplementation(*this).GetViewMode();
+ return ViewMode::MONO;
}
-void Application::SetStereoBase( float stereoBase )
+void Application::SetStereoBase( float /*stereoBase*/ )
{
- Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
}
float Application::GetStereoBase() const
{
- return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
+ return 0.f;
}
Application::AppSignalType& Application::InitSignal()
* @brief Sets the viewing mode for the application.
* @SINCE_1_0.0
* @param[in] viewMode The new viewing mode
+ * @DEPRECATED_1_3.39
*/
void SetViewMode( ViewMode viewMode );
* @brief Gets the current viewing mode.
* @SINCE_1_0.0
* @return The current viewing mode
+ * @DEPRECATED_1_3.39
*/
ViewMode GetViewMode() const;
* between 50mm and 70mm. The default value is 65mm.
* @SINCE_1_0.0
* @param[in] stereoBase The stereo base (eye separation) for Stereoscopic 3D
+ * @DEPRECATED_1_3.39
*/
void SetStereoBase( float stereoBase );
*
* @SINCE_1_0.0
* @return The stereo base (eye separation) for Stereoscopic 3D
+ * @DEPRECATED_1_3.39
*/
float GetStereoBase() const;
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 3;
-const unsigned int ADAPTOR_MICRO_VERSION = 50;
+const unsigned int ADAPTOR_MICRO_VERSION = 51;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.3.50
+Version: 1.3.51
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
# dali-adaptor uses ecore mainloop
%if 0%{?tizen_version_major} >= 5
BuildRequires: pkgconfig(ecore-wl2)
+BuildRequires: pkgconfig(wayland-egl-tizen)
%else
BuildRequires: pkgconfig(ecore-wayland)
%endif