mCallstack.PushCall("Resume()", "");
}
+ void Resize(Integration::RenderSurfaceInterface* surface, Uint16Pair size) override
+ {
+ mCallstack.PushCall("Resize()", "");
+ }
+
/**
* Get the buffer age of the surface. 0 means that the back buffer
* is invalid and needs a full swap.
mPositionSize = positionSize;
}
+void TestRenderSurface::Resize(Dali::Uint16Pair size)
+{
+ mPositionSize.width = size.GetWidth();
+ mPositionSize.height = size.GetHeight();
+}
+
void TestRenderSurface::StartRender()
{
}
*/
void MoveResize(Dali::PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Integration::RenderSurface::Resize
+ */
+ void Resize(Dali::Uint16Pair size) override;
+
/**
* @copydoc Dali::Integration::RenderSurface::StartRender
*/
/**
* @brief Resizes the underlying surface.
- * @param[in] The dimensions of the new position
+ * @param[in] positionSize The dimensions of the new position
*/
virtual void MoveResize(Dali::PositionSize positionSize) = 0;
+ /**
+ * @brief Sets the size of the surface.
+ * @param[in] size The new size of the surface
+ */
+ virtual void Resize(Uint16Pair size) = 0;
+
/**
* @brief Called when Render thread has started
*/
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/graphics-api/graphics-controller.h>
#include <dali/integration-api/core-enumerations.h>
+#include <dali/public-api/math/uint-16-pair.h>
+#include <limits>
+
+// INTERNAL INCLUDES
#include <dali/internal/system/common/environment-options.h>
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/window-system/common/window-base.h>
-#include <limits>
namespace Dali
{
*
* @param[in] surface The surface whose context to be switched to.
*/
- virtual void ActivateSurfaceContext(Dali::Integration::RenderSurfaceInterface* surface) = 0;
+ virtual void ActivateSurfaceContext(Integration::RenderSurfaceInterface* surface) = 0;
+ /**
+ * Makes the context for the given surface ID the current context.
+ *
+ * @param surfaceId The ID of the surface whose context we want to make current.
+ */
virtual void MakeContextCurrent(Graphics::SurfaceId surfaceId) = 0;
/**
*/
virtual void Resume() = 0;
+ /**
+ * Sets the size of the surface.
+ *
+ * @param[in] surface The surface whose context to resize
+ * @param[in] size The new size of the surface
+ */
+ virtual void Resize(Integration::RenderSurfaceInterface* surface, Uint16Pair size) = 0;
+
/**
* Get the buffer age of the surface. 0 means that the back buffer
* is invalid and needs a full swap.
}
}
+void EglGraphics::Resize(Integration::RenderSurfaceInterface* surface, Uint16Pair size)
+{
+ if(surface)
+ {
+ surface->Resize(size);
+ }
+}
+
int EglGraphics::GetBufferAge(Graphics::SurfaceId surfaceId)
{
auto search = mSurfaceMap.find(surfaceId);
*/
void Resume() override;
+ /**
+ * @copydoc Graphics::GraphicsInterface::Resize()
+ */
+ void Resize(Integration::RenderSurfaceInterface* surface, Uint16Pair positionSize) override;
+
/**
* @copydoc Graphics::GraphicsInterface::GetBufferAge()
*/
mGraphicsController.Resume();
}
+void VulkanGraphics::Resize(Integration::RenderSurfaceInterface* surface, Uint16Pair size)
+{
+ // TODO: Need to consider how to resize the surface for vulkan
+}
+
int VulkanGraphics::GetBufferAge(Graphics::SurfaceId surfaceId)
{
return 0;
*/
void Resume() override;
+ /**
+ * @copydoc Graphics::GraphicsInterface::Resize()
+ */
+ void Resize(Integration::RenderSurfaceInterface* surface, Uint16Pair positionSize) override;
+
/**
* @copydoc Graphics::GraphicsInterface::GetBufferAge()
*/
mWindowBase->MoveResize(positionSize);
}
+void WindowRenderSurface::Resize(Uint16Pair size)
+{
+ Dali::PositionSize positionSize;
+
+ // Some native resize API (e.g. wl_egl_window_resize) have the input parameters of x, y, width and height.
+ // So, position data should be set as well.
+ positionSize.x = mPositionSize.x;
+ positionSize.y = mPositionSize.y;
+ positionSize.width = size.GetWidth();
+ positionSize.height = size.GetHeight();
+
+ mWindowBase->ResizeWindow(positionSize);
+}
+
void WindowRenderSurface::StartRender()
{
}
}
// Resize case
- Dali::PositionSize positionSize;
+ Uint16Pair size;
- // Some native resize API(wl_egl_window_resize) has the input parameters of x, y, width and height.
- // So, position data should be set.
- positionSize.x = mPositionSize.x;
- positionSize.y = mPositionSize.y;
if(totalAngle == 0 || totalAngle == 180)
{
- positionSize.width = mPositionSize.width;
- positionSize.height = mPositionSize.height;
+ size.SetWidth(mPositionSize.width);
+ size.SetHeight(mPositionSize.height);
}
else
{
- positionSize.width = mPositionSize.height;
- positionSize.height = mPositionSize.width;
+ size.SetWidth(mPositionSize.height);
+ size.SetHeight(mPositionSize.width);
}
- mWindowBase->ResizeWindow(positionSize);
+ mGraphics->Resize(this, size);
SetFullSwapNextFrame();
}
*/
void MoveResize(Dali::PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Integration::RenderSurfaceInterface::Resize()
+ */
+ void Resize(Uint16Pair size) override;
+
/**
* @copydoc Dali::Integration::RenderSurfaceInterface::StartRender()
*/
mSurfaceSize.SetHeight(static_cast<uint16_t>(positionSize.height));
}
+void NativeRenderSurfaceEcoreWl::Resize(Dali::Uint16Pair size)
+{
+ MoveResize(PositionSize(0, 0, size.GetWidth(), size.GetHeight()));
+}
+
void NativeRenderSurfaceEcoreWl::StartRender()
{
}
*/
void MoveResize(Dali::PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Integration::RenderSurfaceInterface::Resize()
+ */
+ void Resize(Uint16Pair size) override;
+
/**
* @copydoc Dali::Integration::RenderSurfaceInterface::StartRender()
*/
void DestroyContext();
private: // Data
- SurfaceSize mSurfaceSize;
- TriggerEventInterface* mRenderNotification;
- Graphics::GraphicsInterface* mGraphics; ///< The graphics interface
- EglInterface* mEGL;
- EGLSurface mEGLSurface;
- EGLContext mEGLContext;
- ColorDepth mColorDepth;
- tbm_format mTbmFormat;
- bool mOwnSurface;
+ SurfaceSize mSurfaceSize;
+ TriggerEventInterface* mRenderNotification;
+ Graphics::GraphicsInterface* mGraphics; ///< The graphics interface
+ EglInterface* mEGL;
+ EGLSurface mEGLSurface;
+ EGLContext mEGLContext;
+ ColorDepth mColorDepth;
+ tbm_format mTbmFormat;
+ bool mOwnSurface;
tbm_surface_queue_h mTbmQueue;
ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
/**
* @copydoc Dali::Integration::RenderSurfaceInterface::MoveResize()
*/
- virtual void MoveResize(Dali::PositionSize positionSize) override
+ void MoveResize(Dali::PositionSize positionSize) override
+ {
+ }
+
+ /**
+ * @copydoc Dali::Integration::RenderSurfaceInterface::Resize()
+ */
+ void Resize(Dali::Uint16Pair size) override
{
}
/**
* @copydoc Dali::Integration::RenderSurfaceInterface::MoveResize()
*/
- virtual void MoveResize(Dali::PositionSize positionSize) override
+ void MoveResize(Dali::PositionSize positionSize) override
+ {
+ }
+
+ /**
+ * @copydoc Dali::Integration::RenderSurfaceInterface::Resize()
+ */
+ void Resize(Dali::Uint16Pair size) override
{
}