Make ImageVisual::Property::PIXEL_AREA animatable
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / image / image-visual.h
index 1bd414b..0770f03 100644 (file)
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/images/image-operations.h>
 #include <dali/public-api/object/weak-handle.h>
+#include <dali/public-api/rendering/visual-renderer.h>
 
 // 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/image-loader/fast-track-loading-task.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>
@@ -233,6 +235,11 @@ protected:
    */
   Shader GenerateShader() const override;
 
+  /**
+   * @copydoc Visual::Base::OnGetPropertyObject
+   */
+  Dali::Property OnGetPropertyObject(Dali::Property::Key key) override;
+
 public:
   /**
    * @copydoc AtlasUploadObserver::UploadCompleted
@@ -250,6 +257,13 @@ public:
    */
   void LoadComplete(bool success, TextureInformation textureInformation) override;
 
+  /**
+   * @brief Test callback for FastTrackLoadingTask
+   *
+   * @param[in] task The pointer of task who call this callback.
+   */
+  void FastLoadComplete(FastTrackLoadingTaskPtr task);
+
 private:
   /**
    * Allocate the mask data when a masking property is defined in the property map
@@ -333,8 +347,14 @@ private:
    */
   void ShowBrokenImage();
 
+  /**
+   * @brief Remove current added fast track upload task.
+   */
+  void ResetFastTrackLoadingTask();
+
 private:
   Vector4                            mPixelArea;
+  Property::Index                    mPixelAreaIndex;
   WeakHandle<Actor>                  mPlacementActor;
   VisualUrl                          mImageUrl;
   TextureManager::MaskingDataPointer mMaskingData;
@@ -345,6 +365,8 @@ private:
   Vector2                   mTextureSize;
   Vector2                   mPlacementActorSize;
 
+  FastTrackLoadingTaskPtr mFastTrackLoadingTask; ///< For fast track uploading.
+
   ImageVisualShaderFactory& mImageVisualShaderFactory;
 
   Dali::FittingMode::Type                         mFittingMode : 3;
@@ -355,11 +377,14 @@ private:
   Dali::Toolkit::ImageVisual::ReleasePolicy::Type mReleasePolicy;
   Vector4                                         mAtlasRect;
   Dali::ImageDimensions                           mAtlasRectSize;
-  TextureManager::LoadState                       mLoadState;             ///< The texture loading state
-  bool                                            mAttemptAtlasing;       ///< If true will attempt atlasing, otherwise create unique texture
-  bool                                            mOrientationCorrection; ///< true if the image will have it's orientation corrected.
-  bool                                            mNeedYuvToRgb{false};   ///< true if we need to convert yuv to rgb.
-  bool                                            mEnableBrokenImage;
+  TextureManager::LoadState                       mLoadState;                    ///< The texture loading state
+  bool                                            mAttemptAtlasing;              ///< If true will attempt atlasing, otherwise create unique texture
+  bool                                            mOrientationCorrection;        ///< true if the image will have it's orientation corrected.
+  bool                                            mNeedYuvToRgb{false};          ///< true if we need to convert yuv to rgb.
+  bool                                            mNeedUnifiedYuvAndRgb{false};  ///< true if we need to support both yuv and rgb.
+  bool                                            mEnableBrokenImage{true};      ///< true if enable broken image.
+  bool                                            mUseFastTrackUploading{false}; ///< True if we use fast tack feature.
+  bool                                            mRendererAdded{false};         ///< True if renderer added into actor.
 };
 
 } // namespace Internal