X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fimaging%2Fubuntu-x11%2Fnative-image-source-impl-x.h;h=6f4995323ebff328885be0015096e9838d87c914;hb=2eb17a0add04d011b5cac0d6513ee41c7fc89005;hp=9b74b2ace2d06ecb309378c49ac7639833b4942d;hpb=1ed9b0b5036583fcd39f387783ac1a6281715c6f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h old mode 100755 new mode 100644 index 9b74b2a..6f49953 --- a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h +++ b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ -#define __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ +#ifndef DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H +#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H /* - * Copyright (c) 2014 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. @@ -19,21 +19,17 @@ */ // EXTERNAL INCLUDES -#include +#include +#include // INTERNAL INCLUDES -#include - #include - #include namespace Dali { - namespace Internal { - namespace Adaptor { class EglImageExtensions; @@ -44,7 +40,6 @@ class EglImageExtensions; class NativeImageSourceX : public Internal::Adaptor::NativeImageSource { public: - /** * Create a new NativeImageSource internally. * Depending on hardware the width and height may have to be a power of two. @@ -54,10 +49,10 @@ public: * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty * @return A smart-pointer to a newly allocated image. */ - static NativeImageSourceX* New(unsigned int width, - unsigned int height, - Dali::NativeImageSource::ColorDepth depth, - Any nativeImageSource); + static NativeImageSourceX* New(uint32_t width, + uint32_t height, + Dali::NativeImageSource::ColorDepth depth, + Any nativeImageSource); /** * @copydoc Dali::NativeImageSource::GetNativeImageSource() */ @@ -66,22 +61,17 @@ public: /** * @copydoc Dali::NativeImageSource::GetPixels() */ - bool GetPixels(std::vector &pixbuf, unsigned int &width, unsigned int &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& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override; /** * @copydoc Dali::NativeImageSource::SetSource( Any source ) */ - void SetSource( Any source ) override; + void SetSource(Any source) override; /** * @copydoc Dali::NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth ) */ - bool IsColorDepthSupported( Dali::NativeImageSource::ColorDepth colorDepth ) override; + bool IsColorDepthSupported(Dali::NativeImageSource::ColorDepth colorDepth) override; /** * destructor @@ -89,19 +79,19 @@ public: ~NativeImageSourceX() 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() */ - unsigned int TargetTexture() override; + uint32_t TargetTexture() override; /** * @copydoc Dali::NativeImageSource::PrepareTexture() @@ -111,7 +101,7 @@ public: /** * @copydoc Dali::NativeImageSource::GetWidth() */ - unsigned int GetWidth() const override + uint32_t GetWidth() const override { return mWidth; } @@ -119,7 +109,7 @@ public: /** * @copydoc Dali::NativeImageSource::GetHeight() */ - unsigned int GetHeight() const override + uint32_t GetHeight() const override { return mHeight; } @@ -133,6 +123,31 @@ public: } /** + * @copydoc Dali::NativeImageSource::GetTextureTarget() + */ + int GetTextureTarget() const override; + + /** + * @copydoc Dali::NativeImageSource::ApplyNativeFragmentShader() + */ + bool ApplyNativeFragmentShader(std::string& shader) override; + + /** + * @copydoc Dali::NativeImageSource::GetCustomSamplerTypename() + */ + const char* GetCustomSamplerTypename() const override; + + /** + * @copydoc Dali::NativeImageSource::GetNativeImageHandle() + */ + Any GetNativeImageHandle() const override; + + /** + * @copydoc Dali::NativeImageSource::SourceChanged() + */ + bool SourceChanged() const override; + + /** * @copydoc Dali::NativeImageInterface::GetExtension() */ NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override @@ -140,19 +155,33 @@ public: return nullptr; } -private: + /** + * @copydoc Dali::Internal::Adaptor::NativeImageSource::AcquireBuffer() + */ + uint8_t* AcquireBuffer(uint16_t& width, uint16_t& height, uint16_t& stride) override; /** + * @copydoc Dali::Internal::Adaptor::NativeImageSource::ReleaseBuffer() + */ + bool ReleaseBuffer() override; + + /** + * @copydoc Dali::NativeImageSource::SetResourceDestructionCallback() + */ + void SetResourceDestructionCallback(EventThreadCallback* callback) override; + +private: + /** * Private constructor; @see NativeImageSource::New() * @param[in] width The width of the image. * @param[in] height The height of the image. * @param[in] colour depth of the image. * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty */ - NativeImageSourceX(unsigned int width, - unsigned int height, - Dali::NativeImageSource::ColorDepth depth, - Any nativeImageSource); + NativeImageSourceX(uint32_t width, + uint32_t height, + Dali::NativeImageSource::ColorDepth depth, + Any nativeImageSource); /** * 2nd phase construction. @@ -180,15 +209,15 @@ private: void GetPixmapDetails(); private: - - unsigned int mWidth; ///< image width - unsigned int mHeight; ///< image heights - bool mOwnPixmap; ///< Whether we created pixmap or not - Ecore_X_Pixmap mPixmap; ///< From Xlib - 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 + Ecore_X_Pixmap mPixmap; ///< From Xlib + 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 + std::unique_ptr mResourceDestructionCallback; ///< The Resource Destruction Callback }; } // namespace Adaptor @@ -197,4 +226,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ +#endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H