#define DALI_TOOLKIT_INTERNAL_IMAGE_VISUAL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/image-loader/atlas-upload-observer.h>
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/internal/visuals/texture-upload-observer.h>
+#include <dali-toolkit/internal/texture-manager/texture-upload-observer.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
void OnSetTransform() override;
/**
- * @copydoc Visual::Base::IsResourceReady
- */
- bool IsResourceReady() const override;
-
- /**
* @copydoc Visual::Base::UpdateShader
*/
void UpdateShader() override;
void RemoveTexture();
/**
+ * @brief Compute texture size
+ */
+ void ComputeTextureSize();
+
+ /**
+ * @brief Compute mask texture ratio
+ * @return The Mask Texture Ratio
+ */
+ Vector2 ComputeMaskTextureRatio();
+
+ /**
* Helper method to set individual values by index key.
* @param[in] index The index key of the value
* @param[in] value The value
*/
void DoSetProperty(Property::Index index, const Property::Value& value);
+ /**
+ * @brief Check whether the mask texture is loaded or not.
+ * If MaskingType is MASKING_ON_LOADING and mask texture is failed to load, update shader.
+ */
+ void CheckMaskTexture();
+
private:
Vector4 mPixelArea;
WeakHandle<Actor> mPlacementActor;
Dali::ImageDimensions mDesiredSize;
TextureManager::TextureId mTextureId;
TextureSet mTextures;
+ Vector2 mTextureSize;
ImageVisualShaderFactory& mImageVisualShaderFactory;