From bee313488d768224627e0d57310a7de07e2c55b0 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 17:17:32 +0900 Subject: [PATCH] Revert "[Tizen] Modify parameters of CreateNativeSurface()" This reverts commit 6bfe6fff3bb1b55f7db3454a2b16c1b8e11bf506. --- .../native-render-surface-factory.h | 8 +++---- .../adaptor-framework/render-surface-interface.h | 2 -- .../android/render-surface-factory-android.cpp | 4 ++-- .../android/render-surface-factory-android.h | 4 ++-- .../common/native-render-surface-factory.cpp | 6 ++--- .../window-system/common/render-surface-factory.h | 2 +- .../ecore-wl/render-surface-factory-ecore-wl.cpp | 6 ++--- .../ecore-wl/render-surface-factory-ecore-wl.h | 4 ++-- .../ecore-wl2/render-surface-factory-ecore-wl2.cpp | 6 ++--- .../ecore-wl2/render-surface-factory-ecore-wl2.h | 4 ++-- .../native-render-surface-ecore-wl.cpp | 28 ++++++---------------- .../tizen-wayland/native-render-surface-ecore-wl.h | 7 +++--- .../ubuntu-x11/render-surface-factory-ecore-x.cpp | 4 ++-- .../ubuntu-x11/render-surface-factory-ecore-x.h | 4 ++-- .../windows/render-surface-factory-win.cpp | 4 ++-- .../windows/render-surface-factory-win.h | 4 ++-- 16 files changed, 39 insertions(+), 58 deletions(-) diff --git a/dali/integration-api/adaptor-framework/native-render-surface-factory.h b/dali/integration-api/adaptor-framework/native-render-surface-factory.h index 0345a5f..17990e4 100755 --- a/dali/integration-api/adaptor-framework/native-render-surface-factory.h +++ b/dali/integration-api/adaptor-framework/native-render-surface-factory.h @@ -2,7 +2,7 @@ #define DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,12 +33,10 @@ class NativeRenderSurface; * Factory function for native surface * A native surface is created. * - * @param [in] surfaceSize the size of the surface to create - * @param [in] surface the native surface handle of your platform. - * If you don't pass this, a native surface will be created. + * @param [in] positionSize the position and size of the surface to create * @param [in] isTransparent Whether the surface has an alpha channel */ -NativeRenderSurface* CreateNativeSurface( SurfaceSize surfaceSize, Any surface, +NativeRenderSurface* CreateNativeSurface( PositionSize positionSize, bool isTransparent ); } // namespace Dali diff --git a/dali/integration-api/adaptor-framework/render-surface-interface.h b/dali/integration-api/adaptor-framework/render-surface-interface.h index fb9ff42..940ea98 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -24,7 +24,6 @@ #include #include #include -#include namespace Dali { @@ -45,7 +44,6 @@ class GraphicsInterface; * @brief The position and size of the render surface. */ typedef Dali::Rect PositionSize; -typedef Uint16Pair SurfaceSize; /** * @brief Interface for a render surface onto which Dali draws. diff --git a/dali/internal/window-system/android/render-surface-factory-android.cpp b/dali/internal/window-system/android/render-surface-factory-android.cpp index 6dc3f79..27b3725 100644 --- a/dali/internal/window-system/android/render-surface-factory-android.cpp +++ b/dali/internal/window-system/android/render-surface-factory-android.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 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. @@ -44,7 +44,7 @@ std::unique_ptr< PixmapRenderSurface > RenderSurfaceFactoryAndroid::CreatePixmap return std::unique_ptr< PixmapRenderSurface >( nullptr ); } -std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryAndroid::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent ) +std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryAndroid::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent ) { return std::unique_ptr< NativeRenderSurface >( nullptr ); } diff --git a/dali/internal/window-system/android/render-surface-factory-android.h b/dali/internal/window-system/android/render-surface-factory-android.h index 4ade01e..fb820de 100644 --- a/dali/internal/window-system/android/render-surface-factory-android.h +++ b/dali/internal/window-system/android/render-surface-factory-android.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_ANDROID_RENDER_SURFACE_FACTORY_ANDROID_H /* - * Copyright (c) 2020 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. @@ -34,7 +34,7 @@ public: std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override; - std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override; + std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override; }; } // namespace Adaptor diff --git a/dali/internal/window-system/common/native-render-surface-factory.cpp b/dali/internal/window-system/common/native-render-surface-factory.cpp index 9263c40..3b07c24 100644 --- a/dali/internal/window-system/common/native-render-surface-factory.cpp +++ b/dali/internal/window-system/common/native-render-surface-factory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,10 +23,10 @@ namespace Dali { -DALI_ADAPTOR_API NativeRenderSurface* CreateNativeSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent ) +DALI_ADAPTOR_API NativeRenderSurface* CreateNativeSurface( PositionSize positionSize, bool isTransparent ) { auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory(); - auto nativeRenderSurface = renderSurfaceFactory->CreateNativeRenderSurface( surfaceSize, surface, isTransparent ); + auto nativeRenderSurface = renderSurfaceFactory->CreateNativeRenderSurface( positionSize, isTransparent ); return nativeRenderSurface.release(); } diff --git a/dali/internal/window-system/common/render-surface-factory.h b/dali/internal/window-system/common/render-surface-factory.h index a5d8d72..408ae14 100644 --- a/dali/internal/window-system/common/render-surface-factory.h +++ b/dali/internal/window-system/common/render-surface-factory.h @@ -49,7 +49,7 @@ public: virtual std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) = 0; - virtual std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) = 0; + virtual std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) = 0; }; extern std::unique_ptr< RenderSurfaceFactory > GetRenderSurfaceFactory(); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.cpp index bd23041..ef2f93b 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 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. @@ -44,9 +44,9 @@ std::unique_ptr< PixmapRenderSurface > RenderSurfaceFactoryEcoreWl::CreatePixmap return std::unique_ptr< PixmapRenderSurface >( nullptr ); } -std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent ) +std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent ) { - return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( surfaceSize, surface, isTransparent ); + return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( positionSize, isTransparent ); } // this should be created from somewhere diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.h index a20bc74..8db3813 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/render-surface-factory-ecore-wl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_RENDER_SURFACE_FACTORY_ECORE_WL_H /* - * Copyright (c) 2020 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. @@ -34,7 +34,7 @@ public: std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override; - std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override; + std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override; }; } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.cpp index 1b1f816..e0069a7 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 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. @@ -44,9 +44,9 @@ std::unique_ptr< PixmapRenderSurface > RenderSurfaceFactoryEcoreWl2::CreatePixma return std::unique_ptr< PixmapRenderSurface >( nullptr ); } -std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl2::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent ) +std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl2::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent ) { - return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( surfaceSize, surface, isTransparent ); + return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( positionSize, isTransparent ); } // this should be created from somewhere diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.h index eca7f5d..fbb4eff 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_RENDER_SURFACE_FACTORY_ECORE_WL2_H /* - * Copyright (c) 2020 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. @@ -34,7 +34,7 @@ public: std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override; - std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override; + std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override; }; } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp index 5b955d3..066fac6 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp @@ -53,8 +53,8 @@ Debug::Filter* gNativeSurfaceLogFilter = Debug::Filter::New(Debug::Verbose, fals } // unnamed namespace -NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( SurfaceSize surfaceSize, Any surface, bool isTransparent ) -: mSurfaceSize( surfaceSize ), +NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize, bool isTransparent ) +: mPosition( positionSize ), mRenderNotification( NULL ), mGraphics( NULL ), mEGL( nullptr ), @@ -70,17 +70,7 @@ NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( SurfaceSize surfaceSize, { Dali::Internal::Adaptor::WindowSystem::Initialize(); - if( surface.Empty() ) - { - CreateNativeRenderable(); - } - else - { - // check we have a valid type - DALI_ASSERT_ALWAYS( ( surface.GetType() == typeid (tbm_surface_queue_h) ) && "Surface type is invalid" ); - mTbmQueue = AnyCast< tbm_surface_queue_h >( surface ); - } - + CreateNativeRenderable(); setenv( "EGL_PLATFORM", "tbm", 1 ); } @@ -130,7 +120,7 @@ void NativeRenderSurfaceEcoreWl::WaitUntilSurfaceReplaced() PositionSize NativeRenderSurfaceEcoreWl::GetPositionSize() const { - return PositionSize( 0, 0, static_cast( mSurfaceSize.GetWidth() ), static_cast( mSurfaceSize.GetHeight() ) ); + return mPosition; } void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) @@ -223,8 +213,7 @@ void NativeRenderSurfaceEcoreWl::MoveResize( Dali::PositionSize positionSize ) DALI_LOG_ERROR( "Failed to resize tbm_surface_queue" ); } - mSurfaceSize.SetWidth( static_cast( positionSize.width ) ); - mSurfaceSize.SetHeight( static_cast( positionSize.height ) ); + mPosition = positionSize; } void NativeRenderSurfaceEcoreWl::StartRender() @@ -341,13 +330,10 @@ void NativeRenderSurfaceEcoreWl::ReleaseLock() void NativeRenderSurfaceEcoreWl::CreateNativeRenderable() { - int width = static_cast( mSurfaceSize.GetWidth() ); - int height = static_cast( mSurfaceSize.GetHeight() ); - // check we're creating one with a valid size - DALI_ASSERT_ALWAYS( width > 0 && height > 0 && "tbm_surface size is invalid" ); + DALI_ASSERT_ALWAYS( mPosition.width > 0 && mPosition.height > 0 && "tbm_surface size is invalid" ); - mTbmQueue = tbm_surface_queue_create( 3, width, height, mTbmFormat, TBM_BO_DEFAULT ); + mTbmQueue = tbm_surface_queue_create( 3, mPosition.width, mPosition.height, mTbmFormat, TBM_BO_DEFAULT ); if( mTbmQueue ) { diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h index 3f2020b..f4a6626 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h @@ -44,11 +44,10 @@ public: /** * Uses an Wayland surface to render to. - * @param [in] surfaceSize the size of the surface - * @param [in] surface the native surface handle + * @param [in] positionSize the position and size of the surface * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit */ - NativeRenderSurfaceEcoreWl( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ); + NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize, bool isTransparent = false ); /** * @brief Destructor @@ -179,7 +178,7 @@ private: private: // Data - SurfaceSize mSurfaceSize; + PositionSize mPosition; TriggerEventInterface* mRenderNotification; Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface EglInterface* mEGL; diff --git a/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.cpp index c5ba610..b8b1f7e 100644 --- a/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ std::unique_ptr< PixmapRenderSurface > RenderSurfaceFactoryEcoreX::CreatePixmapR return Utils::MakeUnique< PixmapRenderSurfaceEcoreX >( positionSize, surface, isTransparent ); } -std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreX::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent ) +std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreX::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent ) { return std::unique_ptr< NativeRenderSurface >( nullptr ); } diff --git a/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.h b/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.h index 6fd5981..47086a6 100644 --- a/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/render-surface-factory-ecore-x.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_RENDER_SURFACE_FACTORY_ECORE_X_H /* - * Copyright (c) 2020 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. @@ -34,7 +34,7 @@ public: std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override; - std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override; + std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override; }; } // namespace Adaptor diff --git a/dali/internal/window-system/windows/render-surface-factory-win.cpp b/dali/internal/window-system/windows/render-surface-factory-win.cpp index 1864367..efb6714 100755 --- a/dali/internal/window-system/windows/render-surface-factory-win.cpp +++ b/dali/internal/window-system/windows/render-surface-factory-win.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ std::unique_ptr< PixmapRenderSurface > RenderSurfaceFactoryWin::CreatePixmapRend return nullptr; } -std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryWin::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent ) +std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryWin::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent ) { return std::unique_ptr< NativeRenderSurface >( nullptr ); } diff --git a/dali/internal/window-system/windows/render-surface-factory-win.h b/dali/internal/window-system/windows/render-surface-factory-win.h index 436ad70..fd05c74 100755 --- a/dali/internal/window-system/windows/render-surface-factory-win.h +++ b/dali/internal/window-system/windows/render-surface-factory-win.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_WIN_RENDER_SURFACE_FACTORY_WIN_H /* - * Copyright (c) 2020 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. @@ -34,7 +34,7 @@ public: std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override; - std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, bool isTransparent = false ) override; + std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override; }; } // namespace Adaptor -- 2.7.4