X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftexture-manager%2Ftexture-manager-impl.h;h=777c4dfb9b5dfeab2789f9b78cbcf6bc0514b635;hb=refs%2Fchanges%2F35%2F276135%2F18;hp=91f7778750de73ee6b493af2389b30e897a10439;hpb=ff6ce970724ccc8bee65f7c93411b274907c09d7;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/texture-manager/texture-manager-impl.h b/dali-toolkit/internal/texture-manager/texture-manager-impl.h index 91f7778..777c4df 100644 --- a/dali-toolkit/internal/texture-manager/texture-manager-impl.h +++ b/dali-toolkit/internal/texture-manager/texture-manager-impl.h @@ -80,6 +80,8 @@ public: TextureManager::TextureId mAlphaMaskId; float mContentScaleFactor; bool mCropToMask; + bool mPreappliedMasking; + bool mMaskImageLoadingFailed; }; using MaskingDataPointer = std::unique_ptr; @@ -118,11 +120,11 @@ public: * @param[out] textureId The textureId of the frame * @param[in, out] maskInfo Mask info structure * @param[in] samplingMode The SamplingMode to use - * @param[in] wrapModeU Horizontal Wrap mode - * @param[in] wrapModeV Vertical Wrap mode * @param[in] synchronousLoading true if the frame should be loaded synchronously * @param[in] textureObserver The client object should inherit from this and provide the "LoadCompleted" virtual. * This is called when an image load completes (or fails). + * @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the + * image has no alpha channel * * @return The texture set containing the frame of animated image, or empty if still loading. */ @@ -132,10 +134,9 @@ public: TextureManager::TextureId& textureId, MaskingDataPointer& maskInfo, const Dali::SamplingMode::Type& samplingMode, - const Dali::WrapMode::Type& wrapModeU, - const Dali::WrapMode::Type& wrapModeV, const bool& synchronousLoading, - TextureUploadObserver* textureObserver); + TextureUploadObserver* textureObserver, + TextureManager::MultiplyOnLoad& preMultiplyOnLoad); /** * @brief Requests an image load of the given URL to get PixelBuffer. @@ -189,8 +190,6 @@ public: * be loaded, and marked successful, but this will be set to false. * If atlasing succeeds, this will be set to true. * @param[out] loadingStatus The loading status of the texture - * @param[in] wrapModeU Horizontal Wrap mode - * @param[in] wrapModeV Vertical Wrap mode * @param[in] textureObserver The client object should inherit from this and provide the "LoadCompleted" virtual. * This is called when an image load completes (or fails). * @param[in] atlasObserver This is used if the texture is atlased, and will be called instead of @@ -215,8 +214,6 @@ public: Dali::ImageDimensions& textureRectSize, bool& atlasingStatus, bool& loadingStatus, - const Dali::WrapMode::Type& wrapModeU, - const Dali::WrapMode::Type& wrapModeV, TextureUploadObserver* textureObserver, AtlasUploadObserver* atlasObserver, ImageAtlasManagerPtr imageAtlasManager, @@ -257,6 +254,20 @@ public: */ Geometry GetRenderGeometry(const TextureManager::TextureId& textureId, std::uint32_t& frontElements, std::uint32_t& backElements); + /** + * @brief Returns the textureSet in texture manager. + * @param[in] textureId Id of the texture + * @return The textureSet in texture manager. These textures include YUV textures or images and masks. + */ + TextureSet GetTextureSet(const TextureManager::TextureId& textureId); + + /** + * @brief Returns the textureSet in texture manager. + * @param[in] textureInfo the information of the texture + * @return The textureSet in texture manager. These textures include YUV textures or images and masks. + */ + TextureSet GetTextureSet(const TextureManager::TextureInfo& textureInfo); + public: // API list that need to access TextureCacheManager. @@ -269,11 +280,11 @@ public: } /** - * @copydoc TextureCacheManager::GetTextureSet + * @copydoc TextureCacheManager::GetTexture */ - inline TextureSet GetTextureSet(const TextureManager::TextureId& textureId) + inline Texture GetTexture(const TextureManager::TextureId& textureId) { - return mTextureCacheManager.GetTextureSet(textureId); + return mTextureCacheManager.GetTexture(textureId); } /** @@ -413,12 +424,14 @@ public: // Load Request API * @brief Requests a masking image to be loaded. This mask is not uploaded to GL, * instead, it is stored in CPU memory, and can be used for CPU blending. * @param[in] maskUrl The URL of the mask image to load + * @param[in] storageType, Whether the pixel data is stored in the cache or uploaded to the GPU * @param[in] synchronousLoading True if the frame should be loaded synchronously. If you skip this parameter, * default is false. * @return A TextureId to use as a handle to reference this mask Texture */ TextureId RequestMaskLoad( const VisualUrl& maskUrl, + StorageType storageType, const bool& synchronousLoading = false); private: @@ -485,14 +498,18 @@ private: * @param[in] samplingMode The SamplingMode to use * @param[in] orientationCorrection Whether to use image metadata to rotate or flip the image, * e.g., from portrait to landscape + * @param[in] loadYuvPlanes True if the image should be loaded as yuv planes + * @param[out] pixelBuffers The image pixelBuffer * @return PixelBuffer of loaded image. */ - Devel::PixelBuffer LoadImageSynchronously( - const VisualUrl& url, - const Dali::ImageDimensions& desiredSize, - const Dali::FittingMode::Type& fittingMode, - const Dali::SamplingMode::Type& samplingMode, - const bool& orientationCorrection); + void LoadImageSynchronously( + const VisualUrl& url, + const Dali::ImageDimensions& desiredSize, + const Dali::FittingMode::Type& fittingMode, + const Dali::SamplingMode::Type& samplingMode, + const bool& orientationCorrection, + const bool& loadYuvPlanes, + std::vector& pixelBuffers); private: // Load and queue @@ -552,11 +569,11 @@ private: /** * @brief Performs Post-Load steps including atlasing. - * @param[in] textureInfo The struct associated with this Texture - * @param[in] pixelBuffer The image pixelBuffer + * @param[in] textureInfo The struct associated with this Texture + * @param[in] pixelBuffers The image pixelBuffer * @return True if successful */ - void PostLoad(TextureManager::TextureInfo& textureInfo, Devel::PixelBuffer& pixelBuffer); + void PostLoad(TextureManager::TextureInfo& textureInfo, std::vector& pixelBuffers); /** * Check if there is a texture waiting to be masked. If there @@ -574,11 +591,10 @@ private: /** * Upload the texture specified in pixelBuffer to the appropriate location - * @param[in] pixelBuffer The image data to upload - * @param[in] textureInfo The texture info containing the location to - * store the data to. + * @param[in] pixelBuffers The image data to upload + * @param[in] textureInfo The texture info containing the location to store the data to. */ - void UploadTexture(Devel::PixelBuffer& pixelBuffer, TextureManager::TextureInfo& textureInfo); + void UploadTextures(std::vector& pixelBuffers, TextureManager::TextureInfo& textureInfo); /** * Notify the current observers that the texture upload is complete, @@ -600,10 +616,10 @@ public: /** * @brief Common method to handle loading completion. * TextureAsyncLoadingHelper will call this API After async loading finished. - * @param[in] textureId The ID of the texture load complete. - * @param[in] pixelBuffer The loaded image data + * @param[in] textureId The ID of the texture load complete. + * @param[in] pixelBuffers The loaded image data */ - void AsyncLoadComplete(const TextureManager::TextureId& textureId, Devel::PixelBuffer pixelBuffer); + void AsyncLoadComplete(const TextureManager::TextureId& textureId, std::vector& pixelBuffers); private: /** @@ -633,6 +649,7 @@ private: // Member Variables: Dali::Vector mLoadQueue; ///< Queue of textures to load after NotifyObservers Dali::Vector mRemoveQueue; ///< Queue of textures to remove after NotifyObservers bool mQueueLoadFlag; ///< Flag that causes Load Textures to be queued. + bool mLoadYuvPlanes; ///< A global flag to specify if the image should be loaded as yuv planes }; } // namespace Internal