#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.
* 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
#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/math/uint-16-pair.h>
namespace Dali
{
* @brief The position and size of the render surface.
*/
typedef Dali::Rect<int> PositionSize;
-typedef Uint16Pair SurfaceSize;
/**
* @brief Interface for a render surface onto which Dali draws.
/*
- * 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.
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 );
}
#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.
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
/*
- * 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.
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();
}
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();
/*
- * 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.
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
#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.
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
/*
- * 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.
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
#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.
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
} // 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 ),
{
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 );
}
PositionSize NativeRenderSurfaceEcoreWl::GetPositionSize() const
{
- return PositionSize( 0, 0, static_cast<int>( mSurfaceSize.GetWidth() ), static_cast<int>( mSurfaceSize.GetHeight() ) );
+ return mPosition;
}
void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
DALI_LOG_ERROR( "Failed to resize tbm_surface_queue" );
}
- mSurfaceSize.SetWidth( static_cast<uint16_t>( positionSize.width ) );
- mSurfaceSize.SetHeight( static_cast<uint16_t>( positionSize.height ) );
+ mPosition = positionSize;
}
void NativeRenderSurfaceEcoreWl::StartRender()
void NativeRenderSurfaceEcoreWl::CreateNativeRenderable()
{
- int width = static_cast<int>( mSurfaceSize.GetWidth() );
- int height = static_cast<int>( 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 )
{
/**
* 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
private: // Data
- SurfaceSize mSurfaceSize;
+ PositionSize mPosition;
TriggerEventInterface* mRenderNotification;
Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface
EglInterface* mEGL;
/*
- * 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.
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 );
}
#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.
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
/*
- * 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.
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 );
}
#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.
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