(GCC 6.2) Remove unused functions from automated tests
[platform/core/uifw/dali-core.git] / dali / internal / event / images / image-factory.h
index 1b09f50..4f235ed 100644 (file)
@@ -19,8 +19,9 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/resources/resource-type-path-id-map.h>
+#include <dali/public-api/common/dali-vector.h>
 #include <dali/internal/event/resources/resource-ticket.h>
+#include <dali/internal/event/images/context-recovery-interface.h>
 #include <dali/internal/event/images/image-factory-cache.h>
 
 namespace Dali
@@ -67,10 +68,10 @@ public:
   /**
    * Issue a request which has already been registered with ImageFactory.
    * If the associated Ticket is no longer alive ImageFactory issues a resource load request.
-   * @param [in] req pointer to request
+   * @param [in] request Request to be loaded.
    * @return     intrusive pointer to image ticket. If Load fails, returned pointer is invalid. (!ret)
    */
-  ResourceTicketPtr Load( ImageFactoryCache::Request* req );
+  ResourceTicketPtr Load( ImageFactoryCache::Request& request );
 
   /**
    * Tells ResourceManager to reload image from filesystem.
@@ -78,10 +79,10 @@ public:
    * This operation uses the originally requested attributes when reloading the image.
    * @pre req must be registered with ImageFactory
    * @note if image is still loading, no new load request will be issued
-   * @param[in]  requestPtr Request pointer
+   * @param[in]  request Request to be reloaded.
    * @return the ResourceTicket mapped to the request
    */
-  ResourceTicketPtr Reload( ImageFactoryCache::Request* requestPtr );
+  ResourceTicketPtr Reload( ImageFactoryCache::Request& request );
 
   /**
    * Ensures all filesystem images are reloaded into textures.
@@ -99,6 +100,19 @@ public:
   void RecoverFromContextLoss();
 
   /**
+   * Register an object into the context recovery list of  the image factory.
+   * Thus its RecoverFromContextLoss() function would be called when the Stage regaining context.
+   * @param[in] object The object whose RecoverFromContextLoss() function needs to be called to regain the context.
+   */
+  void RegisterForContextRecovery( ContextRecoveryInterface* object  );
+
+  /**
+   * Unregister an object from the context recovery list of the image factory
+   * @param[in] object The object whose RecoverFromContextLoss() function needs to be called to regain the context.
+   */
+  void UnregisterFromContextRecovery( ContextRecoveryInterface* object  );
+
+  /**
    * Get resource path used in request.
    * @param [in] request of the image
    * @return     resource path
@@ -166,8 +180,8 @@ private:
    * @param [in] actual    The actual attributes
    * @return True if the attributes are compatible
    */
-  bool CompareAttributes( const Dali::ImageAttributes& requested,
-                          const Dali::ImageAttributes& actual ) const;
+  bool CompareAttributes( const ImageAttributes& requested,
+                          const ImageAttributes& actual ) const;
 
   /**
    * Inserts a new request to the request cache and url cache.
@@ -206,13 +220,22 @@ private:
    */
   ResourceTicketPtr IssueLoadRequest( const std::string& filename, const ImageAttributes* attributes );
 
+  /**
+   * Looks-up the hash of the string locator of the already-registered Request
+   * passed in.
+   * @param[in] request The image load request to return a locator string hash for.
+   * @return The hash of the locator string used in the request.
+   */
+  std::size_t GetHashForCachedRequest( const ImageFactoryCache::Request& request );
+
 private:
-  ResourceClient&                        mResourceClient;
-  ImageFactoryCache::RequestPathHashMap  mUrlCache;         ///< A multimap of url hashes and request IDs
-  ImageFactoryCache::RequestIdMap        mRequestCache;     ///< A map of request IDs and request information.
-  ResourceTicketContainer                mTicketsToRelease; ///< List of ticket handles
-  float                                  mMaxScale;         ///< Defines maximum size difference between compatible resources
-  ImageFactoryCache::RequestId           mReqIdCurrent;     ///< Internal counter for Request IDs
+  ResourceClient&                          mResourceClient;
+  ImageFactoryCache::RequestPathHashMap    mUrlCache;         ///< A multimap of url hashes and request IDs
+  ImageFactoryCache::RequestIdMap          mRequestCache;     ///< A map of request IDs and request information.
+  ResourceTicketContainer                  mTicketsToRelease; ///< List of ticket handles
+  Vector<ContextRecoveryInterface*>        mContextRecoveryList; ///< List of the objects who needs context recovery
+  float                                    mMaxScale;         ///< Defines maximum size difference between compatible resources
+  ImageFactoryCache::RequestId             mReqIdCurrent;     ///< Internal counter for Request IDs
 };
 
 } // namespace Internal