#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_TIZEN_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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 <tbm_surface.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
#include <dali/devel-api/threading/mutex.h>
#include <dali/public-api/common/dali-vector.h>
/**
* Dali internal NativeImageSource.
*/
-class NativeImageSourceTizen: public Internal::Adaptor::NativeImageSource, public NativeImageInterface::Extension
+class NativeImageSourceTizen: public Internal::Adaptor::NativeImageSource
{
public:
/**
* @copydoc Dali::NativeImageSource::GetPixels()
*/
- bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
-
- /**
- * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
- */
- bool EncodeToFile(const std::string& filename) const override;
+ bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
/**
* @copydoc Dali::NativeImageSource::SetSource( Any source )
~NativeImageSourceTizen() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::CreateResource()
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
}
/**
- * @copydoc Dali::NativeImageInterface::GetExtension()
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
*/
- NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
- {
- return this;
- }
+ const char* GetCustomFragmentPrefix() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
*/
- const char* GetCustomFragmentPreFix() override;
+ const char* GetCustomSamplerTypename() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
*/
- const char* GetCustomSamplerTypename() override;
+ int GetTextureTarget() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
*/
- int GetEglImageTextureTarget() override;
+ Any GetNativeImageHandle() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ bool SourceChanged() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetExtension()
+ */
+ NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
+ {
+ return nullptr;
+ }
/**
* @copydoc Dali::Internal::Adaptor::NativeImageSource::AcquireBuffer()
*/
bool ReleaseBuffer() override;
+ /**
+ * @copydoc Dali::NativeImageSource::SetResourceDestructionCallback()
+ */
+ void SetResourceDestructionCallback(EventThreadCallback* callback) override;
+
private:
/**
void DestroySurface();
private:
-
uint32_t mWidth; ///< image width
uint32_t mHeight; ///< image height
bool mOwnTbmSurface; ///< Whether we created pixmap or not
bool mSetSource;
mutable Dali::Mutex mMutex;
bool mIsBufferAcquired; ///< Whether AcquireBuffer is called
+ std::unique_ptr<EventThreadCallback> mResourceDestructionCallback;
};
} // namespace Adaptor