#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/internal/imaging/common/native-image-source-impl.h>
+#include <cstdint>
namespace Dali
{
{
namespace Adaptor
{
+class EglGraphics;
class EglImageExtensions;
/**
* @param[in] nativeImageSource contains either: pixmap of type Win32 Pixmap , a WinPixmap or is empty
* @return A smart-pointer to a newly allocated image.
*/
- static NativeImageSourceWin* New(unsigned int width,
- unsigned int height,
+ static NativeImageSourceWin* New(uint32_t width,
+ uint32_t height,
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
/**
/**
* @copydoc Dali::NativeImageSource::GetPixels()
*/
- bool GetPixels(std::vector<unsigned char>& pixbuf, unsigned int& width, unsigned int& height, Pixel::Format& pixelFormat) const override;
+ bool GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
/**
* @copydoc Dali::NativeImageSource::SetSource( Any source )
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
*/
- unsigned int TargetTexture() override;
+ uint32_t TargetTexture() override;
/**
* @copydoc Dali::NativeImageSource::PrepareTexture()
/**
* @copydoc Dali::NativeImageSource::GetWidth()
*/
- unsigned int GetWidth() const override
+ uint32_t GetWidth() const override
{
return mWidth;
}
/**
* @copydoc Dali::NativeImageSource::GetHeight()
*/
- unsigned int GetHeight() const override
+ uint32_t GetHeight() const override
{
return mHeight;
}
bool SourceChanged() const override;
/**
+ * @copydoc Dali::NativeImageInterface::GetUpdatedArea()
+ */
+ Rect<uint32_t> GetUpdatedArea() override
+ {
+ return Rect<uint32_t>{0, 0, mWidth, mHeight};
+ }
+
+ /**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
/**
* @copydoc Dali::Internal::Adaptor::NativeImageSource::AcquireBuffer()
*/
- uint8_t* AcquireBuffer(uint16_t& width, uint16_t& height, uint16_t& stride) override;
+ uint8_t* AcquireBuffer(uint32_t& width, uint32_t& height, uint32_t& stride) override;
/**
* @copydoc Dali::Internal::Adaptor::NativeImageSource::ReleaseBuffer()
*/
- bool ReleaseBuffer() override;
+ bool ReleaseBuffer(const Rect<uint32_t>& updatedArea) override;
+
+ /**
+ * @copydoc Dali::NativeImageSource::SetResourceDestructionCallback()
+ */
+ void SetResourceDestructionCallback(EventThreadCallback* callback) override;
+
+ /**
+ * @copydoc Dali::DevelNativeImageSource::EnableBackBuffer()
+ */
+ void EnableBackBuffer(bool enable) override;
private:
/**
* @param[in] colour depth of the image.
* @param[in] nativeImageSource contains either: pixmap of type Win32 Pixmap , a WinPixmap or is empty
*/
- NativeImageSourceWin(unsigned int width,
- unsigned int height,
+ NativeImageSourceWin(uint32_t width,
+ uint32_t height,
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
void GetPixmapDetails();
private:
- unsigned int mWidth; ///< image width
- unsigned int mHeight; ///< image heights
- bool mOwnPixmap; ///< Whether we created pixmap or not
- unsigned int mPixmap; ///< From Windows
- bool mBlendingRequired; ///< Whether blending is required
- Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
- void* mEglImageKHR; ///< From EGL extension
- EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
+ uint32_t mWidth; ///< image width
+ uint32_t mHeight; ///< image heights
+ bool mOwnPixmap; ///< Whether we created pixmap or not
+ unsigned int mPixmap; ///< From Windows
+ bool mBlendingRequired; ///< Whether blending is required
+ Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
+ void* mEglImageKHR; ///< From EGL extension
+ EglGraphics* mEglGraphics; ///< EGL Graphics
+ EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
+ std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
};
} // namespace Adaptor