#define DALI_NATIVE_BITMAP_BUFFER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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 HEADERS
-#include <dali/public-api/images/native-image-interface.h>
-#include <dali/public-api/images/pixel.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/lockless-buffer.h>
#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/images/native-image-interface.h>
+#include <dali/public-api/images/pixel.h>
// INTERNAL HEADERS
#include <dali/internal/adaptor/common/adaptor-impl.h>
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
class NativeBitmapBuffer;
typedef IntrusivePtr<NativeBitmapBuffer> NativeBitmapBufferPtr;
*/
class NativeBitmapBuffer : public NativeImageInterface
{
-
public:
/**
* Constructor.
* @param height height of image
* @param pixelFormat pixel format for image
*/
- NativeBitmapBuffer( Adaptor* adaptor, unsigned int width, unsigned int height, Pixel::Format pixelFormat );
+ NativeBitmapBuffer(Adaptor* adaptor, unsigned int width, unsigned int height, Pixel::Format pixelFormat);
/**
* virtual destructor
* @param[in] size size of data in bytes
* @return true if successful, false if currently reading from buffer in render thread
*/
- void Write( const unsigned char* src, size_t size );
+ void Write(const unsigned char* src, size_t size);
public:
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource()
*/
- virtual bool GlExtensionCreate();
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- virtual void GlExtensionDestroy();
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- virtual unsigned int TargetTexture();
+ unsigned int TargetTexture() override;
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
*/
- virtual void PrepareTexture();
+ void PrepareTexture() override;
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- virtual unsigned int GetWidth() const;
+ unsigned int GetWidth() const override;
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- virtual unsigned int GetHeight() const;
+ unsigned int GetHeight() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::RequiresBlending()
+ */
+ bool RequiresBlending() const override;
/**
* @copydoc Dali::NativeImageInterface::RequiresBlending()
*/
- virtual bool RequiresBlending() const;
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+ */
+ bool ApplyNativeFragmentShader(std::string& shader) override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
+ */
+ Any GetNativeImageHandle() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ bool SourceChanged() const override;
private:
- NativeBitmapBuffer( const NativeBitmapBuffer& ); ///< not defined
- NativeBitmapBuffer& operator =( const NativeBitmapBuffer& ); ///< not defined
- NativeBitmapBuffer(); ///< not defined
+ NativeBitmapBuffer(const NativeBitmapBuffer&); ///< not defined
+ NativeBitmapBuffer& operator=(const NativeBitmapBuffer&); ///< not defined
+ NativeBitmapBuffer(); ///< not defined
private:
- Integration::GlAbstraction* mGlAbstraction; ///< GlAbstraction used
+ Integration::GlAbstraction* mGlAbstraction; ///< GlAbstraction used
- Integration::LocklessBuffer* mBuffer; ///< bitmap data double buffered
- unsigned int mWidth; ///< Image width
- unsigned int mHeight; ///< Image height
- Pixel::Format mPixelFormat; ///< Image pixelformat
+ Integration::LocklessBuffer* mBuffer; ///< bitmap data double buffered
+ unsigned int mWidth; ///< Image width
+ unsigned int mHeight; ///< Image height
+ Pixel::Format mPixelFormat; ///< Image pixelformat
const unsigned char* mLastReadBuffer; ///< last buffer that was read
};