1 #ifndef __DALI_INTERNAL_RESOURCE_MANAGER_H__
2 #define __DALI_INTERNAL_RESOURCE_MANAGER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/public-api/images/image.h>
26 #include <dali/public-api/images/native-image.h>
27 #include <dali/public-api/images/bitmap-image.h>
28 #include <dali/public-api/common/ref-counted-dali-vector.h>
30 #include <dali/integration-api/bitmap.h>
31 #include <dali/integration-api/platform-abstraction.h>
32 #include <dali/integration-api/resource-cache.h>
33 #include <dali/integration-api/shader-data.h>
35 #include <dali/internal/common/event-to-update.h>
36 #include <dali/internal/common/message.h>
37 #include <dali/internal/common/bitmap-upload.h>
38 #include <dali/internal/event/text/font-impl.h>
39 #include <dali/internal/event/modeling/model-data-impl.h>
40 #include <dali/internal/event/resources/resource-client-declarations.h>
41 #include <dali/internal/event/effects/shader-factory.h>
42 #include <dali/internal/update/modeling/internal-mesh-data.h>
43 #include <dali/internal/update/modeling/scene-graph-mesh-declarations.h>
44 #include <dali/internal/update/resources/resource-manager-declarations.h>
45 #include <dali/internal/update/resources/bitmap-metadata.h>
60 // value types used by messages
61 template <> struct ParameterType< Integration::LoadResourcePriority >
62 : public BasicType< Integration::LoadResourcePriority > {};
63 template <> struct ParameterType< Pixel::Format >
64 : public BasicType< Pixel::Format > {};
65 template <> struct ParameterType< Integration::ResourceTypeId >
66 : public BasicType< Integration::ResourceTypeId > {};
72 class TextureCacheDispatcher;
73 class PostProcessResourceDispatcher;
76 class NotificationManager;
78 /** Raw bytes of a resource laid out exactly as it wouldbe in a file, but in memory. */
79 typedef Dali::RefCountedVector<uint8_t> RequestBuffer;
80 /** Counting smart pointer for managing a buffer of raw bytes. */
81 typedef IntrusivePtr<RequestBuffer> RequestBufferPtr;
84 * ResourceManager keeps track of resource loading requests, and caches resources that are loaded.
85 * It uses ResourceTicket objects, to keep track of the lifetime of each request.
86 * If the same resource is required by two client objects, they will share the same ResourceTicket
87 * i.e. only one load will occur using the native filesystem.
89 * Multi-threading notes:
90 * Resources are received from the PlatformAbstraction API during the Core::Render() method, which
91 * may be called from a dedicated rendering thread.
92 * Loading requests must be made from the application's main thread e.g. when Dali::Image is created.
94 class ResourceManager : public Integration::ResourceCache
99 * Create a resource manager.
100 * There should exactly one of these objects per Dali Core.
101 * @param[in] platformAbstraction Used to request resources from the native filesystem.
102 * @param[in] notificationManager Used to send NotifyTickets message.
103 * @param[in] postProcessResourcesQueue Used for performing post processing on resources
104 * @param[in] discardQueue Used to cleanup nodes & resources when no longer in use.
105 * @param[in] renderQueue Used to queue resource updates until the next Render.
107 ResourceManager( Integration::PlatformAbstraction& platformAbstraction,
108 NotificationManager& notificationManager,
109 SceneGraph::TextureCacheDispatcher& textureCacheDispatcher,
110 ResourcePostProcessList& postProcessResourcesQueue,
111 SceneGraph::PostProcessResourceDispatcher& postProcessResourceDispatcher,
112 SceneGraph::DiscardQueue& discardQueue,
113 SceneGraph::RenderQueue& renderQueue );
116 * Virtual destructor.
118 virtual ~ResourceManager();
120 public: // Used by ResourceClient
122 /********************************************************************************
123 ************************ ResourceClient direct interface **********************
124 ********************************************************************************/
127 * Resource client passes itself for secondary intialisation.
128 * (The resource client requires the ResourceManager to be instantiated first).
129 * @param[in] resourceClient The ResourceClient.
131 void SetClient( ResourceClient& resourceClient );
133 /********************************************************************************
134 ************************ UpdateManager direct interface ***********************
135 ********************************************************************************/
138 * Called to update the resource cache before rendering.
139 * New resources will be added to the cache using PlatformAbstraction::FillResourceCache().
140 * Unwanted resources will be added to the DiscardQueue.
141 * @param[in] updateBufferIndex The current update buffer index.
142 * @return true, if a resource load was completed or failed
144 bool UpdateCache( BufferIndex updateBufferIndex );
147 * Iterate through the post process queue, performing requested updates.
148 * @param[in] updateBufferIndex The current update buffer index.
150 void PostProcessResources( BufferIndex updateBufferIndex );
152 /********************************************************************************
153 *************************** CoreImpl direct interface *************************
154 ********************************************************************************/
157 * Returns whether the Resource Manager is still processing any resource requests.
158 * @return true if still processing, false otherwise.
160 bool ResourcesToProcess();
162 /********************************************************************************
163 ********************************* Message handlers *****************************
164 ********************************************************************************/
167 * Request a resource from the native filesystem.
168 * @param[in] id The Id of the requested resource
169 * @param[in] typePath The type & path of requested resource.
170 * @param[in] priority The priority of the request. This is ignored if the resource is already being loaded.
172 void HandleLoadResourceRequest( ResourceId id,
173 const ResourceTypePath& typePath,
174 Integration::LoadResourcePriority priority );
177 * Decode a resource from a memory buffer with the semantics of loading.
178 * Notifications of partial completion, success, and failure will happen via
179 * the same loading notification path used for loading from files: Update()
180 * will retrieve loading events in its main loop and notify listeners to its
181 * own loading events, and forward them, still as loading events, to the event
182 * thread via its update queue.
183 * Resource manager and lower levels make no attempt to detect resource
184 * aliases as is done for multiple requests to load the same resource
185 * file, so the caller is responsible for ensuring that it only requests
186 * the decoding of an in-memory resource once and for doing the sharing of the
187 * resulting object itself. Ultimately this responsibility resides with the
189 * @note ! Only Bitmap resources are supported for decoding from memory !
190 * @param[in] id The Id of the requested resource.
191 * @param[in] typePath The type of the requested resource and a path that is ignored.
192 * @param[in] buffer The raw encoded bytes of the resource as they would appear in a file.
193 * @param[in] priority The priority of the request. This is ignored if the resource is already being loaded.
195 void HandleDecodeResourceRequest( ResourceId id,
196 const ResourceTypePath& typePath,
197 RequestBufferPtr buffer,
198 Integration::LoadResourcePriority priority );
201 * Injects a bitmap resource (does not require loading).
202 * @pre bitmap has to be initialized
203 * @param[in] id The resource id
204 * @param[in] bitmap an initialized bitmap
206 void HandleAddBitmapImageRequest(ResourceId id, Integration::BitmapPtr bitmap);
209 * Add an existing resource to the resource manager.
210 * @param[in] id The resource id
211 * @param [in] resourceData the NativeImage object
212 * @return A ref-counted request object. Keep a copy until the resource is no longer required.
214 void HandleAddNativeImageRequest( ResourceId id, NativeImagePtr resourceData );
217 * Add an existing resource to the resource manager.
218 * @param[in] id The resource id
219 * @param[in] width width in pixels
220 * @param[in] height height in pixels
221 * @param[in] pixelFormat Pixel format
223 void HandleAddFrameBufferImageRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat );
226 * Add an existing resource to the resource manager.
227 * @param[in] id The resource id
228 * @param[in] nativeImage The NativeImage
230 void HandleAddFrameBufferImageRequest( ResourceId id, NativeImagePtr nativeImage );
233 * Allocate a new empty texture.
234 * @param[in] id The resource id
235 * @param[in] width width in pixels
236 * @param[in] height height in pixels
237 * @param[in] pixelFormat Pixel format
239 void HandleAllocateTextureRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat );
242 * Upload an array of bitmaps to a texture.
243 * @param[in] id The resource id
244 * @param[in] uploadArray bitmap upload array.
246 void HandleUpdateTextureRequest( ResourceId id, const BitmapUploadArray& uploadArray );
249 * Requests allocation of a mesh resource
250 * @param[in] id The resource id
251 * @param[in] meshData The mesh data
253 void HandleAllocateMeshRequest (ResourceId id, MeshData* meshData);
256 * Requests allocation of a font resource
258 void HandleAllocateFontRequest(ResourceId id, const std::string& familyNameAndStyle);
261 * Load a shader program from a file
262 * @param[in] id The resource id
263 * @param[in] typePath The type & path of the resource
265 void HandleLoadShaderRequest(ResourceId id, const ResourceTypePath& typePath );
268 * Update bitmap area request
269 * @param[in] textureId The resource ID of a bitmap-texture to remove.
270 * @param[in] area The updated area. Zero width/height indicates the whole bitmap has been updated
272 void HandleUpdateBitmapAreaRequest( ResourceId textureId, const Dali::RectArea& area );
275 * Upload mesh buffer changes.
276 * @param[in] updateBufferIndex The current update buffer index.
277 * @param[in] id The ID of a Mesh resource.
278 * @param[in] meshData Newly allocated mesh data; ownership is taken.
280 void HandleUpdateMeshRequest( BufferIndex updateBufferIndex, ResourceId id, MeshData* meshData );
283 * Request reloading a resource from the native filesystem.
284 * @param[in] id The resource id
285 * @param[in] typePath The type & path of the resource
286 * @param[in] priority The priority of the request. This is ignored if the resource is already being refreshed.
288 void HandleReloadResourceRequest( ResourceId id, const ResourceTypePath& typePath, Integration::LoadResourcePriority priority );
291 * Save a resource to the given url
292 * @param[in] id The resource id
293 * @param[in] typePath The type & path of the resource
295 void HandleSaveResourceRequest( ResourceId id, const ResourceTypePath& typePath );
298 * Resource ticket has been discarded, throw away the actual resource
300 void HandleDiscardResourceRequest( ResourceId id, Integration::ResourceTypeId typeId );
303 * Update font texture atlas status
304 * @param[in] id The resource id
305 * @param[in] atlasId texture ID of the atlas
306 * @param[in] loadStatus The status update.
308 void HandleAtlasUpdateRequest( ResourceId id, ResourceId atlasId, Integration::LoadStatus loadStatus );
310 /********************************************************************************
311 ******************** Event thread object direct interface *********************
312 ********************************************************************************/
315 * Called by model implementations which require access to the model
317 * @note Only called from event thread objects - ModelData is not used
319 * @param[in] id - the id of a ModelData resource.
320 * @return the model data or NULL if it has not been loaded.
322 Internal::ModelDataPtr GetModelData(ResourceId id);
324 /********************************************************************************
325 ******************** Update thread object direct interface ********************
326 ********************************************************************************/
329 * Check if a resource has completed loading.
330 * @param[in] id The ID of a bitmap/texture resource.
331 * @return true if the bitmap or texture has finished loading
333 bool IsResourceLoaded(ResourceId id);
336 * Check if a resource has failed to load, e.g. file not found, etc.
337 * @param[in] id The ID of a bitmap/texture resource.
338 * @return true if the bitmap or texture has failed to load
340 bool IsResourceLoadFailed(ResourceId id);
343 * Get bitmap metadata. This stores meta data about the resource, but
344 * doesn't keep track of the resource
346 BitmapMetadata GetBitmapMetadata(ResourceId id);
350 * @note Used by update thread objects (SceneGraph::Mesh) only
351 * @param[in] id - the id of a MeshData resource.
352 * @return the mesh data or NULL if this resource isn't valid
354 Internal::SceneGraph::Mesh* GetMesh(ResourceId id);
357 * Returns the shader resource corresponding to the Id
358 * @param[in] id - the id of a shader binary resource.
359 * @return the shader binary resource data or NULL if it has not been loaded.
361 Integration::ShaderDataPtr GetShaderData(ResourceId id);
364 * Check if current set of glyph requests on given atlas have finished loading
365 * @param[in] id Request Id of the text atlas texture
366 * @return true if the current set of glyph requests have all completed, false
367 * if there are outstanding glyph requests that haven't finished.
369 bool IsAtlasLoaded(ResourceId id);
372 * Check the load status of a given atlas.
373 * @param[in] id Request Id of the text atlas texture
376 Integration::LoadStatus GetAtlasLoadStatus( ResourceId atlasId );
378 /********************************************************************************
379 ************************* ResourceCache Implementation ************************
380 ********************************************************************************/
384 * @copydoc Integration::ResourceCache::LoadResponse
386 virtual void LoadResponse(ResourceId id, Integration::ResourceTypeId type, Integration::ResourcePointer resource, Integration::LoadStatus loadStatus);
389 * @copydoc Integration::ResourceCache::SaveComplete
391 virtual void SaveComplete(ResourceId id, Integration::ResourceTypeId type);
394 * @copydoc Integration::ResourceCache::LoadFailed
396 virtual void LoadFailed(ResourceId id, Integration::ResourceFailure failure);
399 * @copydoc Integration::ResourceCache::SaveFailed
401 virtual void SaveFailed(ResourceId id, Integration::ResourceFailure failure);
403 /********************************************************************************
404 ********************************* Private Methods *****************************
405 ********************************************************************************/
408 * @param[in] id Resource id to clear
409 * @param[in] typePath Glyphs to be loaded, and cleared beforehand
411 void ClearRequestedGlyphArea( ResourceId id, const ResourceTypePath& typePath );
414 * Sends loaded glyphs to texture atlas for uploading
415 * @param[in] glyphSet Loaded glyphs
417 void UploadGlyphsToTexture( const Integration::GlyphSet& glyphSet );
420 * Sends notification messages for load sucess & failure,
421 * pushes from newComplete / newFailed into oldComplete / oldFailed respectively
423 void NotifyTickets();
426 * Triggers message to Event thread to update the ticket's image attributes
427 * @pre An Image resource with the given id should exist in the cache.
428 * @param id ID of the image resource
429 * @param attributes Resource image attributes
431 void UpdateImageTicket( ResourceId id, ImageAttributes& attributes );
434 * Send message to ResourceClient in event thread
435 * @param[in] message The message to send
437 void SendToClient( MessageBase* message );
440 * Discard all dead resources.
441 * @param[in] updateBufferIndex The current update buffer index.
443 void DiscardDeadResources( BufferIndex updateBufferIndex );
446 struct ResourceManagerImpl;
447 ResourceManagerImpl* mImpl;
450 // Messages sent to resource manager from other threads:
451 // These functions are run on other threads and insert messages to be
452 // picked-up by the update thread in its main loop and executed on that in
455 inline void RequestLoadResourceMessage( EventToUpdate& eventToUpdate,
456 ResourceManager& manager,
458 const ResourceTypePath& typePath,
459 Integration::LoadResourcePriority priority )
461 typedef MessageValue3< ResourceManager, ResourceId, ResourceTypePath, Integration::LoadResourcePriority > LocalType;
463 // Reserve some memory inside the message queue
464 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ), false );
466 // Construct message in the message queue memory; note that delete should not be called on the return value
467 new (slot) LocalType( &manager, &ResourceManager::HandleLoadResourceRequest, id, typePath, priority );
470 inline void RequestDecodeResourceMessage( EventToUpdate& eventToUpdate,
471 ResourceManager& manager,
473 /// We use typePath instead of the raw type for ownership and to enable copying of a concrete type.
474 const ResourceTypePath& typePath,
475 RequestBufferPtr buffer,
476 Integration::LoadResourcePriority priority )
478 typedef MessageValue4< ResourceManager, ResourceId, ResourceTypePath, RequestBufferPtr, Integration::LoadResourcePriority > LocalType;
480 // Reserve some memory inside the message queue
481 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ), false );
483 // Construct message in the message queue memory; note that delete should not be called on the return value
484 new (slot) LocalType( &manager, &ResourceManager::HandleDecodeResourceRequest, id, typePath, buffer, priority );
487 inline void RequestAddBitmapImageMessage( EventToUpdate& eventToUpdate,
488 ResourceManager& manager,
490 Integration::Bitmap* resourceData )
492 typedef MessageValue2< ResourceManager, ResourceId, Integration::BitmapPtr > LocalType;
494 // Reserve some memory inside the message queue
495 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
497 // Construct message in the message queue memory; note that delete should not be called on the return value
498 new (slot) LocalType( &manager, &ResourceManager::HandleAddBitmapImageRequest, id, resourceData );
501 inline void RequestAddNativeImageMessage( EventToUpdate& eventToUpdate,
502 ResourceManager& manager,
504 NativeImagePtr resourceData )
506 typedef MessageValue2< ResourceManager, ResourceId, NativeImagePtr > LocalType;
508 // Reserve some memory inside the message queue
509 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
511 // Construct message in the message queue memory; note that delete should not be called on the return value
512 new (slot) LocalType( &manager, &ResourceManager::HandleAddNativeImageRequest, id, resourceData );
515 inline void RequestAddFrameBufferImageMessage( EventToUpdate& eventToUpdate,
516 ResourceManager& manager,
520 Pixel::Format pixelFormat )
522 typedef MessageValue4< ResourceManager, ResourceId, unsigned int, unsigned int, Pixel::Format > LocalType;
524 // Reserve some memory inside the message queue
525 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
527 // Construct message in the message queue memory; note that delete should not be called on the return value
528 new (slot) LocalType( &manager, &ResourceManager::HandleAddFrameBufferImageRequest, id, width, height, pixelFormat );
531 inline void RequestAddFrameBufferImageMessage( EventToUpdate& eventToUpdate,
532 ResourceManager& manager,
534 NativeImagePtr resourceData )
536 typedef MessageValue2< ResourceManager, ResourceId, NativeImagePtr > LocalType;
538 // Reserve some memory inside the message queue
539 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
541 // Construct message in the message queue memory; note that delete should not be called on the return value
542 new (slot) LocalType( &manager, &ResourceManager::HandleAddFrameBufferImageRequest, id, resourceData );
545 inline void RequestAllocateTextureMessage(EventToUpdate& eventToUpdate,
546 ResourceManager& manager,
550 Pixel::Format pixelFormat)
552 typedef MessageValue4< ResourceManager, ResourceId, unsigned int, unsigned int, Pixel::Format > LocalType;
554 // Reserve some memory inside the message queue
555 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
557 // Construct message in the message queue memory; note that delete should not be called on the return value
558 new (slot) LocalType( &manager, &ResourceManager::HandleAllocateTextureRequest, id, width, height, pixelFormat );
561 inline void RequestUpdateTextureMessage(EventToUpdate& eventToUpdate,
562 ResourceManager& manager,
564 BitmapUploadArray uploadArray )
566 typedef MessageValue2< ResourceManager, ResourceId, BitmapUploadArray > LocalType;
568 // Reserve some memory inside the message queue
569 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
571 // Construct message in the message queue memory; note that delete should not be called on the return value
572 new (slot) LocalType( &manager, &ResourceManager::HandleUpdateTextureRequest, id, uploadArray );
575 inline void RequestAllocateMeshMessage( EventToUpdate& eventToUpdate,
576 ResourceManager& manager,
578 OwnerPointer<MeshData>& meshData )
580 typedef MessageValue2< ResourceManager, ResourceId, OwnerPointer<MeshData> > LocalType;
582 // Reserve some memory inside the message queue
583 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
585 // Construct message in the message queue memory; note that delete should not be called on the return value
586 new (slot) LocalType( &manager, &ResourceManager::HandleAllocateMeshRequest, id, meshData.Release() );
589 inline void RequestAllocateFontMessage( EventToUpdate& eventToUpdate,
590 ResourceManager& manager,
592 const std::string& familyNameAndStyle)
594 typedef MessageValue2< ResourceManager, ResourceId, std::string > LocalType;
596 // Reserve some memory inside the message queue
597 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
599 // Construct message in the message queue memory; note that delete should not be called on the return value
600 new (slot) LocalType( &manager, &ResourceManager::HandleAllocateFontRequest, id, familyNameAndStyle );
603 inline void RequestLoadShaderMessage( EventToUpdate& eventToUpdate,
604 ResourceManager& manager,
606 const ResourceTypePath& typePath )
608 typedef MessageValue2< ResourceManager, ResourceId, ResourceTypePath > LocalType;
610 // Reserve some memory inside the message queue
611 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
613 // Construct message in the message queue memory; note that delete should not be called on the return value
614 new (slot) LocalType( &manager, &ResourceManager::HandleLoadShaderRequest, id, typePath );
617 inline void RequestUpdateBitmapAreaMessage( EventToUpdate& eventToUpdate,
618 ResourceManager& manager,
620 const Dali::RectArea& area )
622 typedef MessageValue2< ResourceManager, ResourceId, Dali::RectArea > LocalType;
624 // Reserve some memory inside the message queue
625 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ), false );
627 // Construct message in the message queue memory; note that delete should not be called on the return value
628 new (slot) LocalType( &manager, &ResourceManager::HandleUpdateBitmapAreaRequest, id, area );
631 inline void RequestUpdateMeshMessage( EventToUpdate& eventToUpdate,
632 ResourceManager& manager,
634 const Dali::MeshData& meshData )
636 typedef MessageDoubleBuffered2< ResourceManager, ResourceId, OwnerPointer< MeshData > > LocalType;
638 // Reserve some memory inside the message queue
639 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
641 MeshData* internalMeshData = new MeshData( meshData, true, false );
643 // Construct message in the message queue memory; note that delete should not be called on the return value
644 new (slot) LocalType( &manager, &ResourceManager::HandleUpdateMeshRequest, id, internalMeshData );
647 inline void RequestReloadResourceMessage( EventToUpdate& eventToUpdate,
648 ResourceManager& manager,
650 const ResourceTypePath& typePath,
651 Integration::LoadResourcePriority priority )
653 typedef MessageValue3< ResourceManager, ResourceId, ResourceTypePath, Integration::LoadResourcePriority > LocalType;
655 // Reserve some memory inside the message queue
656 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ), false );
658 // Construct message in the message queue memory; note that delete should not be called on the return value
659 new (slot) LocalType( &manager, &ResourceManager::HandleReloadResourceRequest, id, typePath, priority );
662 inline void RequestSaveResourceMessage( EventToUpdate& eventToUpdate,
663 ResourceManager& manager,
665 const ResourceTypePath& typePath )
667 typedef MessageValue2< ResourceManager, ResourceId, ResourceTypePath > LocalType;
669 // Reserve some memory inside the message queue
670 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
672 // Construct message in the message queue memory; note that delete should not be called on the return value
673 new (slot) LocalType( &manager, &ResourceManager::HandleSaveResourceRequest, id, typePath );
676 inline void RequestDiscardResourceMessage( EventToUpdate& eventToUpdate,
677 ResourceManager& manager,
679 Integration::ResourceTypeId typeId )
681 typedef MessageValue2< ResourceManager, ResourceId, Integration::ResourceTypeId > LocalType;
683 // Reserve some memory inside the message queue
684 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
686 // Construct message in the message queue memory; note that delete should not be called on the return value
687 new (slot) LocalType( &manager, &ResourceManager::HandleDiscardResourceRequest, id, typeId );
690 inline void RequestAtlasUpdateMessage( EventToUpdate& eventToUpdate,
691 ResourceManager& manager,
694 Integration::LoadStatus loadStatus )
696 typedef MessageValue3< ResourceManager, ResourceId, ResourceId, Integration::LoadStatus > LocalType;
698 // Reserve some memory inside the message queue
699 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
701 // Construct message in the message queue memory; note that delete should not be called on the return value
702 new (slot) LocalType( &manager, &ResourceManager::HandleAtlasUpdateRequest, id, atlasId, loadStatus );
705 } // namespace Internal
709 #endif // __DALI_INTERNAL_RESOURCE_MANAGER_H__