X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fimaging%2Fmacos%2Fnative-image-source-impl-mac.h;h=5bb1db5aa171e105a2ee2d93143964411183b475;hb=d36025775e8a5dc1c06ca357b55ef1cf11dc51c9;hp=84ef5549ba3e128758c1cc3e3e42154aa59d4c26;hpb=1d2f3c8815642aa28ab6c5de43493c3ab7c35e6f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/imaging/macos/native-image-source-impl-mac.h b/dali/internal/imaging/macos/native-image-source-impl-mac.h index 84ef554..5bb1db5 100644 --- a/dali/internal/imaging/macos/native-image-source-impl-mac.h +++ b/dali/internal/imaging/macos/native-image-source-impl-mac.h @@ -1,7 +1,7 @@ #pragma once /* - * Copyright (c) 2020 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. @@ -20,13 +20,12 @@ // INTERNAL INCLUDES #include +#include #include #include -#include namespace Dali::Internal::Adaptor { - class EglImageExtensions; /** @@ -35,7 +34,6 @@ class EglImageExtensions; class NativeImageSourceCocoa : 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. @@ -46,11 +44,10 @@ public: * @return A smart-pointer to a newly allocated image. */ static NativeImageSourceCocoa* New( - unsigned int width, - unsigned int height, + unsigned int width, + unsigned int height, Dali::NativeImageSource::ColorDepth depth, - Any nativeImageSource - ); + Any nativeImageSource); /** * @copydoc Dali::NativeImageSource::GetNativeImageSource() @@ -61,21 +58,20 @@ public: * @copydoc Dali::NativeImageSource::GetPixels() */ bool GetPixels( - std::vector &pixbuf, - unsigned int &width, - unsigned int &height, - Pixel::Format& pixelFormat - ) const override; + std::vector& pixbuf, + unsigned int& width, + unsigned int& 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 @@ -118,9 +114,9 @@ public: bool RequiresBlending() const override; /** - * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix() + * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader() */ - const char* GetCustomFragmentPrefix() const override; + bool ApplyNativeFragmentShader(std::string& shader) override; /** * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename() @@ -153,15 +149,19 @@ public: /** * @copydoc Dali::Internal::Adaptor::NativeImageSource::AcquireBuffer() */ - uint8_t* AcquireBuffer( uint16_t& width, uint16_t& height, uint16_t& stride ) override; + uint8_t* AcquireBuffer(uint16_t& width, uint16_t& height, uint16_t& stride) override; /** * @copydoc Dali::Internal::Adaptor::NativeImageSource::ReleaseBuffer() */ bool ReleaseBuffer() override; -private: + /** + * @copydoc Dali::NativeImageSource::SetResourceDestructionCallback() + */ + void SetResourceDestructionCallback(EventThreadCallback* callback) override; +private: /** * Private constructor; @see NativeImageSource::New() * @param[in] width The width of the image. @@ -170,14 +170,14 @@ private: * @param[in] nativeImageSource contains either: pixmap of type Win32 Pixmap , a WinPixmap or is empty */ NativeImageSourceCocoa( - unsigned int width, - unsigned int height, + unsigned int width, + unsigned int height, Dali::NativeImageSource::ColorDepth depth, - Any nativeImageSource - ); + Any nativeImageSource); private: CFRef mImage; + std::unique_ptr mResourceDestructionCallback; ///< The Resource Destruction Callback }; } // namespace Dali::Internal::Adaptor