New parameter for FrameBufferImage creation
[platform/core/uifw/dali-core.git] / dali / internal / update / resources / resource-manager.h
index e0aea0b..131c45c 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/images/image.h>
+#include <dali/public-api/images/frame-buffer-image.h>
 #include <dali/public-api/images/native-image-interface.h>
 #include <dali/public-api/images/buffer-image.h>
-#include <dali/public-api/common/ref-counted-dali-vector.h>
+#include <dali/devel-api/common/ref-counted-dali-vector.h>
 
 #include <dali/integration-api/bitmap.h>
 #include <dali/integration-api/platform-abstraction.h>
@@ -37,8 +38,6 @@
 #include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/event/resources/resource-client-declarations.h>
 #include <dali/internal/event/effects/shader-factory.h>
-#include <dali/internal/update/modeling/internal-mesh-data.h>
-#include <dali/internal/update/modeling/scene-graph-mesh-declarations.h>
 #include <dali/internal/update/resources/resource-manager-declarations.h>
 #include <dali/internal/update/resources/bitmap-metadata.h>
 
@@ -62,6 +61,8 @@ template <> struct ParameterType< Integration::LoadResourcePriority >
 : public BasicType< Integration::LoadResourcePriority > {};
 template <> struct ParameterType< Pixel::Format >
 : public BasicType< Pixel::Format > {};
+template <> struct ParameterType< RenderBuffer::Format >
+: public BasicType< RenderBuffer::Format > {};
 template <> struct ParameterType< Integration::ResourceTypeId >
 : public BasicType< Integration::ResourceTypeId > {};
 
@@ -220,7 +221,7 @@ public: // Used by ResourceClient
    * @param[in] height      height in pixels
    * @param[in] pixelFormat Pixel format
    */
-  void HandleAddFrameBufferImageRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat );
+  void HandleAddFrameBufferImageRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat );
 
   /**
    * Add an existing resource to the resource manager.
@@ -238,12 +239,6 @@ public: // Used by ResourceClient
    */
   void HandleAllocateTextureRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat );
 
-  /**
-   * Requests allocation of a mesh resource
-   * @param[in] id The resource id
-   * @param[in] meshData The mesh data
-   */
-  void HandleAllocateMeshRequest (ResourceId id, MeshData* meshData);
 
   /**
    * Load a shader program from a file
@@ -278,14 +273,6 @@ public: // Used by ResourceClient
   void HandleUploadBitmapRequest( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset );
 
   /**
-   * Upload mesh buffer changes.
-   * @param[in] updateBufferIndex The current update buffer index.
-   * @param[in] id The ID of a Mesh resource.
-   * @param[in] meshData Newly allocated mesh data; ownership is taken.
-   */
-  void HandleUpdateMeshRequest( BufferIndex updateBufferIndex, ResourceId id, MeshData* meshData );
-
-  /**
    * Request reloading a resource from the native filesystem.
    * @param[in] id The resource id
    * @param[in] typePath The type & path of the resource
@@ -337,14 +324,6 @@ public: // Used by ResourceClient
   BitmapMetadata GetBitmapMetadata(ResourceId id);
 
   /**
-   * Get the mesh data.
-   * @note Used by update thread objects (SceneGraph::Mesh) only
-   * @param[in] id - the id of a MeshData resource.
-   * @return the mesh data or NULL if this resource isn't valid
-   */
-  Internal::SceneGraph::Mesh* GetMesh(ResourceId id);
-
-  /**
    * Returns the shader resource corresponding to the Id
    * @param[in] id - the id of a shader binary resource.
    * @return the shader binary resource data or NULL if it has not been loaded.
@@ -481,15 +460,17 @@ inline void RequestAddFrameBufferImageMessage( EventThreadServices& eventThreadS
                                                ResourceId id,
                                                unsigned int width,
                                                unsigned int height,
-                                               Pixel::Format pixelFormat )
+                                               Pixel::Format pixelFormat,
+                                               RenderBuffer::Format bufferFormat
+                                               )
 {
-  typedef MessageValue4< ResourceManager, ResourceId, unsigned int, unsigned int, Pixel::Format > LocalType;
+  typedef MessageValue5< ResourceManager, ResourceId, unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleAddFrameBufferImageRequest, id, width, height, pixelFormat );
+  new (slot) LocalType( &manager, &ResourceManager::HandleAddFrameBufferImageRequest, id, width, height, pixelFormat, bufferFormat );
 }
 
 inline void RequestAddFrameBufferImageMessage( EventThreadServices& eventThreadServices,
@@ -522,19 +503,6 @@ inline void RequestAllocateTextureMessage( EventThreadServices& eventThreadServi
   new (slot) LocalType( &manager, &ResourceManager::HandleAllocateTextureRequest, id, width, height, pixelFormat );
 }
 
-inline void RequestAllocateMeshMessage( EventThreadServices& eventThreadServices,
-                                        ResourceManager& manager,
-                                        ResourceId id,
-                                        OwnerPointer<MeshData>& meshData )
-{
-  typedef MessageValue2< ResourceManager, ResourceId, OwnerPointer<MeshData> > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleAllocateMeshRequest, id, meshData.Release() );
-}
 
 inline void RequestLoadShaderMessage( EventThreadServices& eventThreadServices,
                                       ResourceManager& manager,
@@ -596,22 +564,6 @@ inline void RequestUploadBitmapMessage( EventThreadServices& eventThreadServices
   new (slot) LocalType( &manager, &ResourceManager::HandleUploadBitmapRequest, destId, srcId, xOffset, yOffset );
 }
 
-inline void RequestUpdateMeshMessage( EventThreadServices& eventThreadServices,
-                                      ResourceManager& manager,
-                                      ResourceId id,
-                                      const Dali::MeshData& meshData,
-                                      ResourcePolicy::Discardable discardable )
-{
-  typedef MessageDoubleBuffered2< ResourceManager, ResourceId, OwnerPointer< MeshData > > LocalType;
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  MeshData* internalMeshData = new MeshData( meshData, discardable, false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleUpdateMeshRequest, id, internalMeshData );
-}
-
 inline void RequestReloadResourceMessage( EventThreadServices& eventThreadServices,
                                           ResourceManager& manager,
                                           ResourceId id,