From: Paul Wisbey
Date: Thu, 2 Feb 2017 19:17:47 +0000 (+0000)
Subject: Removed ResourceClient
X-Git-Tag: dali_1.2.26~7
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F112791%2F2;p=platform%2Fcore%2Fuifw%2Fdali-core.git
Removed ResourceClient
Change-Id: Iecccb23503008d3c5f24203998f14d92a3a99888
---
diff --git a/automated-tests/src/dali-internal/CMakeLists.txt b/automated-tests/src/dali-internal/CMakeLists.txt
index aa640b1..6e497f7 100644
--- a/automated-tests/src/dali-internal/CMakeLists.txt
+++ b/automated-tests/src/dali-internal/CMakeLists.txt
@@ -8,7 +8,6 @@ SET(CAPI_LIB "dali-internal")
SET(TC_SOURCES
utc-Dali-Internal-Core.cpp
utc-Dali-Internal-Handles.cpp
- utc-Dali-Internal-ResourceClient.cpp
utc-Dali-Internal-FixedSizeMemoryPool.cpp
utc-Dali-Internal-MemoryPoolObjectAllocator.cpp
utc-Dali-Internal-FrustumCulling.cpp
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp
deleted file mode 100644
index 7191eca..0000000
--- a/automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp
+++ /dev/null
@@ -1,868 +0,0 @@
-/*
- * Copyright (c) 2016 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include
-
-#include
-#include
-#include
-#include
-
-// Internal headers are allowed here
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Dali;
-
-#include
-
-namespace
-{
-
-class TestTicketObserver : public Internal::ResourceTicketObserver
-{
-public:
- TestTicketObserver()
- : mLoadingFailedCalled(0), mLoadingSucceededCalled(0),
- mUploadedCount(0)
- {}
-
- int LoadFailedCalled() {
- tet_printf("TicketObserver: LoadingFailed() called %d times\n", mLoadingFailedCalled);
- return mLoadingFailedCalled;
- }
- int LoadSucceededCalled() {
- tet_printf("TicketObserver: LoadingSucceeded() called %d times\n", mLoadingSucceededCalled);
- return mLoadingSucceededCalled;
- }
- int UploadCalled() {
- tet_printf("TicketObserver: Uploaded() called %d times\n", mUploadedCount);
- return mUploadedCount;
- }
- void Reset() {
- mLoadingFailedCalled = 0;
- mLoadingSucceededCalled = 0;
- mUploadedCount = 0;
- }
-
-public: // From ResourceTicketObserver
- virtual void ResourceLoadingFailed(const Internal::ResourceTicket& ticket) {mLoadingFailedCalled++;}
- virtual void ResourceLoadingSucceeded(const Internal::ResourceTicket& ticket) {mLoadingSucceededCalled++;}
- virtual void ResourceUploaded(const Internal::ResourceTicket& ticket) {mUploadedCount++;}
-
-private:
- int mLoadingFailedCalled;
- int mLoadingSucceededCalled;
- int mUploadedCount;
-};
-
-class TestTicketLifetimeObserver : public Internal::ResourceTicketLifetimeObserver
-{
-public:
- TestTicketLifetimeObserver() : resourceTicketDiscarded(false) {}
-
- virtual void ResourceTicketDiscarded( const Internal::ResourceTicket& ticket )
- { resourceTicketDiscarded = true; }
-
- void Reset() { resourceTicketDiscarded = false; }
- bool resourceTicketDiscarded;
-};
-
-static TestTicketObserver testTicketObserver;
-static TestTicketLifetimeObserver testTicketLifetimeObserver;
-
-Internal::ResourceTicketPtr CheckLoadBitmap(TestApplication& application, const char* name, int w, int h)
-{
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Integration::BitmapResourceType bitmapRequest;
- Internal::ResourceTicketPtr ticket = resourceClient.RequestResource( bitmapRequest, name );
- ticket->AddObserver(testTicketObserver);
- application.SendNotification(); // Flush update messages
- application.Render(); // Process resource request
- Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, w, h, w, h );
- Integration::ResourcePointer resourcePtr(bitmap); // reference it
- application.GetPlatform().SetResourceLoaded(req->GetId(), req->GetType()->id, resourcePtr);
- application.Render(); // Process LoadComplete
- application.SendNotification(); // Process event messages
- DALI_TEST_CHECK( ticket->GetLoadingState() == ResourceLoadingSucceeded );
- application.GetPlatform().DiscardRequest(); // Ensure load request is discarded
- req=NULL;
- application.GetPlatform().ResetTrace();
-
- return ticket;
-}
-
-} //anonymous namespace
-
-
-void utc_dali_internal_resource_client_startup()
-{
- test_return_value = TET_UNDEF;
-}
-
-void utc_dali_internal_resource_client_cleanup()
-{
- test_return_value = TET_PASS;
-}
-
-// Load a bitmap resource successfully, then discard it's ticket
-int UtcDaliInternalRequestResourceBitmapRequests01(void)
-{
- TestApplication application; // Reset all test adapter return codes
-
- tet_infoline("Testing bitmap requests");
-
- Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
- Integration::BitmapResourceType bitmapRequest;
- Internal::ResourceId id(0);
-
- testTicketObserver.Reset();
-
- {
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- /************************************************************
- * FUNCTION UNDER TEST
- ***********************************************************/
- Internal::ResourceTicketPtr ticket = resourceClient.RequestResource( bitmapRequest, "image.png" );
- ticket->AddObserver(testTicketObserver);
-
- // Update thread will request the bitmap resource:
- // Sets application.GetPlatform().mRequest
- application.SendNotification(); // Run flush update queue
- application.Render(1); // Process update messages
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
-
- application.SendNotification(); // Send any event messages
- DALI_TEST_CHECK( testTicketObserver.LoadFailedCalled() == 0 );
- DALI_TEST_CHECK( testTicketObserver.LoadSucceededCalled() == 0 );
- DALI_TEST_CHECK( ticket->GetLoadingState() == ResourceLoading );
-
- Internal::ImageTicketPtr imageTicket(dynamic_cast(ticket.Get()));
- DALI_TEST_CHECK( imageTicket );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
- // Create a resource
- Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80, 80, 80, 80 );
- Integration::ResourcePointer resourcePtr(bitmap); // reference it
-
- // Set up platform abstraction to load it
- id=req->GetId();
- application.GetPlatform().SetResourceLoaded( id, Integration::ResourceBitmap, resourcePtr );
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(req->GetId()) );
-
- // load the cache, which will immediately have the loaded resource
- application.Render(0);
-
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
-
- DALI_TEST_CHECK( resourceManager.IsResourceLoaded(req->GetId()) );
- Internal::TextureMetadata* bitmapData = NULL;
- DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
- DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
-
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
- // Trigger the event thread to process notify messages. Should then trigger the signals
- // in the ticket observer
- application.SendNotification();
-
- DALI_TEST_CHECK( ticket->GetLoadingState() == ResourceLoadingSucceeded );
- DALI_TEST_EQUALS(testTicketObserver.LoadSucceededCalled(), 1, TEST_LOCATION );
-
- // Check that the image ticket was updated with the image attributes
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
- } // Discard ticket
-
- application.SendNotification(); // Flush update queue (with ticket discarded message
- application.Render(1); // Process update messages
- application.SendNotification(); // Send event notifications
- application.Render(1); // Process update messages
-
- // Resource should have been discarded.
- DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::CancelLoadFunc ) );
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
-
- DALI_TEST_EQUALS(testTicketObserver.LoadSucceededCalled(), 1, TEST_LOCATION );
- DALI_TEST_EQUALS(testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
- END_TEST;
-}
-
-// Starting Loading a bitmap resource, then discard it's ticket before loading complete.
-int UtcDaliInternalRequestResourceBitmapRequests02(void)
-{
- TestApplication application; // Reset all test adapter return codes
-
- tet_infoline("Testing bitmap request ticket discard before load complete");
-
- Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
- Integration::BitmapResourceType bitmapRequest;
- Internal::ResourceId id(0);
-
- testTicketObserver.Reset();
-
- {
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- /************************************************************
- * FUNCTION UNDER TEST
- ***********************************************************/
- Internal::ResourceTicketPtr ticket = resourceClient.RequestResource( bitmapRequest, "image.png" );
- ticket->AddObserver(testTicketObserver);
- Internal::ImageTicketPtr imageTicket(dynamic_cast(ticket.Get()));
- DALI_TEST_CHECK( imageTicket );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
- // Update thread will request the bitmap resource:
- // Sets application.GetPlatform().mRequest
- application.SendNotification(); // Run flush update queue
- application.Render(1);
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
- Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
- id=req->GetId();
-
- application.SendNotification(); // Should produce no messages
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
-
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
- DALI_TEST_CHECK( ticket->GetLoadingState() == ResourceLoading );
-
- } // Discard ticket
-
- // Ensure ticket discarded message is sent to update thread
- application.SendNotification(); // Flush update queue
- application.Render(0); // Process update messages
-
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::CancelLoadFunc ) );
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
-
- // Trigger the event thread to process notify messages. Should then trigger the signals
- // in the ticket observer
- application.SendNotification();
-
- DALI_TEST_EQUALS(testTicketObserver.LoadSucceededCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS(testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
- END_TEST;
-}
-
-// start loading a bitmap resource that doesn't exist, then discard it's ticket after failure
-int UtcDaliInternalRequestResourceBitmapRequests03(void)
-{
- TestApplication application; // Reset all test adapter return codes
-
- tet_infoline("Load bitmap that doesn't exist, followed by ticket discard. Expect LoadingFailed");
-
- Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
- Integration::BitmapResourceType bitmapRequest;
- Internal::ResourceId id(0);
-
- testTicketObserver.Reset();
- { // Scope lifetime of ticket
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
- /************************************************************
- * FUNCTION UNDER TEST
- ***********************************************************/
- Internal::ResourceTicketPtr ticket = resourceClient.RequestResource( bitmapRequest, "image.png" );
- ticket->AddObserver(testTicketObserver);
- Internal::ImageTicketPtr imageTicket(dynamic_cast(ticket.Get()));
- DALI_TEST_CHECK( imageTicket );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
- // Update thread will request the bitmap resource:
- // Sets application.GetPlatform().mRequest
- application.SendNotification(); // Run flush update queue
- application.Render(1); // process update messages
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
- Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
- id=req->GetId();
- application.SendNotification(); // Should produce no messages
- DALI_TEST_CHECK( testTicketObserver.LoadFailedCalled() == 0 );
- DALI_TEST_CHECK( testTicketObserver.LoadSucceededCalled() == 0 );
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
-
- application.GetPlatform().SetResourceLoadFailed(id, Integration::FailureFileNotFound );
-
- application.Render(0); // Get failed result
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
- application.SendNotification(); // send failed
- DALI_TEST_CHECK( testTicketObserver.LoadFailedCalled() != 0 );
- DALI_TEST_CHECK( ticket->GetLoadingState() == ResourceLoadingFailed );
-
- DALI_TEST_CHECK( testTicketObserver.LoadSucceededCalled() == 0 );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
- } // Discard ticket
-
- application.Render(0); // Send DiscardTicket
- application.SendNotification();
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
- END_TEST;
-}
-
-
-
-// Load a bitmap resource successfully, then reload it
-int UtcDaliInternalRequestReloadBitmapRequests01(void)
-{
- TestApplication application; // Reset all test adapter return codes
-
- tet_infoline("Testing bitmap reload after successful load");
-
- Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
- Internal::ResourceId id(0);
- testTicketObserver.Reset();
-
- {
- Internal::ResourceTicketPtr ticket = CheckLoadBitmap( application, "image.png", 80, 80 );
- Internal::ImageTicketPtr imageTicket(dynamic_cast(ticket.Get()));
- id = ticket->GetId();
-
- // Reset call statistics - test that resource is reloaded
- application.GetPlatform().ResetTrace();
-
- /************************************************************
- * FUNCTION UNDER TEST
- ***********************************************************/
- resourceClient.ReloadResource( ticket->GetId() );
-
- DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
- application.SendNotification(); // Flush update messages
- application.Render(0); // Process update messages
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
- application.SendNotification(); // Process event messages
-
- DALI_TEST_EQUALS( ticket->GetLoadingState(), ResourceLoading, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 1, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
-
- // Create a new resource - the image size could have changed in the meantime
- Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
- Integration::Bitmap* bitmap2 = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- bitmap2->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 120, 120, 120, 120 );
- Integration::ResourcePointer resourcePtr2(bitmap2); // reference it
- DALI_TEST_CHECK( req->GetId() == ticket->GetId() );
- application.GetPlatform().SetResourceLoaded(id, Integration::ResourceBitmap, resourcePtr2);
-
- application.Render(0 , TEST_LOCATION ); // Process update messages / UpdateCache
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
-
- DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- Internal::TextureMetadata* bitmapData = NULL;
- DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
- DALI_TEST_CHECK( bitmapData->GetWidth() == 120 );
- DALI_TEST_CHECK( bitmapData->GetHeight() == 120 );
-
- // Ticket can't have been updated yet - it should still have old values
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
- application.SendNotification(); // Process event messages
- application.Render(0, TEST_LOCATION ); // Process update messages / UpdateCache
- application.SendNotification(); // Process event messages
-
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 2, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 1, TEST_LOCATION );
- DALI_TEST_EQUALS( ticket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 120, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 120, TEST_LOCATION );
-
- } // Discard ticket
-
- application.SendNotification(); // Flush update queue (with ticket discarded message
- application.Render(1, TEST_LOCATION ); // Process update messages
- application.SendNotification(); // Send event notifications
-
- // Resource should have been discarded.
- DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::CancelLoadFunc ) );
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
-
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 2, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 1, TEST_LOCATION );
- END_TEST;
-}
-
-
-int UtcDaliInternalRequestReloadBitmapRequests02(void)
-{
- TestApplication application; // Reset all test adapter return codes
-
- tet_infoline("Testing bitmap reload during first load");
-
- Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
- Integration::BitmapResourceType bitmapRequest;
- Internal::ResourceId id(0);
-
- testTicketObserver.Reset();
-
- {
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Internal::ResourceTicketPtr ticket = resourceClient.RequestResource( bitmapRequest, "image.png" );
- ticket->AddObserver(testTicketObserver);
-
- // Update thread will request the bitmap resource:
- // Sets application.GetPlatform().mRequest
- application.SendNotification(); // Run flush update queue
- application.Render(1); // Process update messages
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
-
- application.SendNotification(); // Send any event messages
- DALI_TEST_CHECK( testTicketObserver.LoadFailedCalled() == 0 );
- DALI_TEST_CHECK( testTicketObserver.LoadSucceededCalled() == 0 );
-
- Internal::ImageTicketPtr imageTicket(dynamic_cast(ticket.Get()));
- DALI_TEST_CHECK( imageTicket );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
-
- /************************************************************
- * FUNCTION UNDER TEST
- ***********************************************************/
- resourceClient.ReloadResource( ticket->GetId() );
- /************************************************************
- * Expected result - current load completes as usual, no reload requested
- ************************************************************/
-
- application.SendNotification(); // Flush update methods
-
- // Reset call statistics - test that resource is not reloaded
- application.GetPlatform().ResetTrace();
-
- application.Render(0); // Process reload message (nothing for UpdateCache yet)
-
- DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
- // Create a resource
- Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80, 80, 80, 80 );
- Integration::ResourcePointer resourcePtr(bitmap); // reference it
-
- // Set up platform abstraction to load it
- id=req->GetId();
-
- application.GetPlatform().SetResourceLoaded(id, Integration::ResourceBitmap, resourcePtr);
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
-
- application.GetPlatform().ResetTrace();
- // load the cache, which will immediately have the loaded resource
- application.Render(0);
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
- DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- Internal::TextureMetadata* bitmapData = NULL;
- DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
- DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
-
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
- // Trigger the event thread to process notify messages. Should then trigger the signals
- // in the ticket observer
- application.SendNotification();
-
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 1, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( ticket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
-
- // Check that the image ticket was updated with the image attributes
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
- DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
-
- application.SendNotification(); // Flush update messages
- application.Render(0); // Process update messages
-
- // There should be no reload
- DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
- application.SendNotification(); // Process event messages
-
- DALI_TEST_EQUALS( ticket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 1, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
-
- DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
- DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
- } // Discard ticket
- END_TEST;
-}
-
-
-int UtcDaliInternalRequestReloadBitmapRequests03(void)
-{
- TestApplication application; // Reset all test adapter return codes
-
- tet_infoline("Testing bitmap reload at end of first load");
-
- Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
- Integration::BitmapResourceType bitmapRequest;
- Internal::ResourceId id(0);
-
- testTicketObserver.Reset();
-
- {
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Internal::ResourceTicketPtr ticket = resourceClient.RequestResource( bitmapRequest, "image.png" );
- ticket->AddObserver(testTicketObserver);
-
- // Update thread will request the bitmap resource:
- // Sets application.GetPlatform().mRequest
- application.SendNotification(); // Run flush update queue
- application.Render(1); // Process update messages
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
-
- application.SendNotification(); // Send any event messages
- DALI_TEST_CHECK( testTicketObserver.LoadFailedCalled() == 0 );
- DALI_TEST_CHECK( testTicketObserver.LoadSucceededCalled() == 0 );
-
- Internal::ImageTicketPtr imageTicket(dynamic_cast(ticket.Get()));
- DALI_TEST_CHECK( imageTicket );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
-
- /************************************************************
- * FUNCTION UNDER TEST
- ***********************************************************/
- resourceClient.ReloadResource( ticket->GetId() );
- /************************************************************
- * Expected result - current load completes as usual, no reload requested
- ************************************************************/
-
- application.SendNotification(); // Flush update methods
-
- // Reset call statistics - test that resource is not reloaded
- application.GetPlatform().ResetTrace();
-
- // Create a resource
- Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80, 80, 80, 80 );
- Integration::ResourcePointer resourcePtr(bitmap); // reference it
-
- // Set up platform abstraction to load it
- id=req->GetId();
-
- application.GetPlatform().SetResourceLoaded(id, Integration::ResourceBitmap, resourcePtr);
-
- DALI_TEST_CHECK( ! resourceManager.IsResourceLoaded(id));
-
- application.GetPlatform().ResetTrace();
- // load the cache, which will immediately have the loaded resource
- application.Render(0);
-
- // UpdateCache runs before ProcessMessages, so the loading resource completes before
- // the reload request is handled.
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc ) );
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
-
- DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- Internal::TextureMetadata* bitmapData = NULL;
- DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
- DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
-
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
-
- // Trigger the event thread to process notify messages. Should then trigger the signals
- // in the ticket observer
- application.SendNotification();
-
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 1, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( ticket->GetLoadingState(), ResourceLoading, TEST_LOCATION );
-
- // Check that the image ticket was updated with the image attributes
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
- DALI_TEST_EQUALS( resourceManager.ResourcesToProcess(), true, TEST_LOCATION );
-
- // Create a new resource - the image size could have changed in the meantime
- req = application.GetPlatform().GetRequest();
- Integration::Bitmap* bitmap2 = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- bitmap2->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 120, 120, 120, 120 );
- Integration::ResourcePointer resourcePtr2(bitmap2); // reference it
- DALI_TEST_CHECK( req->GetId() == id );
- application.GetPlatform().SetResourceLoaded(id, Integration::ResourceBitmap, resourcePtr2);
-
- application.Render(0); // Process update messages / UpdateCache
-
- DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
- DALI_TEST_CHECK( bitmapData->GetWidth() == 120 );
- DALI_TEST_CHECK( bitmapData->GetHeight() == 120 );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
- application.SendNotification(); // Process event messages
-
- DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 2, TEST_LOCATION );
-
- // Not staged - no GL upload
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
-
- DALI_TEST_EQUALS( ticket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetWidth(), 120, TEST_LOCATION );
- DALI_TEST_EQUALS( imageTicket->GetHeight(), 120, TEST_LOCATION );
- DALI_TEST_EQUALS( resourceManager.ResourcesToProcess(), false, TEST_LOCATION );
- }
- END_TEST;
-}
-
-int UtcDaliInternalRequestResourceTicket01(void)
-{
- TestApplication application;
- tet_infoline("Testing RequestResourceTicket() with valid id");
-
- testTicketObserver.Reset();
-
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
- // First, load a bitmap resource
- Internal::ResourceTicketPtr ticket = CheckLoadBitmap(application, "bitmap.jpg", 80, 80);
-
- Internal::ResourceTicketPtr newTicket = resourceClient.RequestResourceTicket( ticket->GetId() );
- DALI_TEST_CHECK( newTicket );
- DALI_TEST_CHECK( newTicket->GetId() == ticket->GetId() );
- DALI_TEST_CHECK( newTicket->GetTypePath().type->id == ticket->GetTypePath().type->id );
- END_TEST;
-}
-
-int UtcDaliInternalRequestResourceTicket02(void)
-{
- TestApplication application;
- tet_infoline("Testing RequestResourceTicket() with invalid id");
-
- testTicketObserver.Reset();
-
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
- // First, load a bitmap resource
- Internal::ResourceTicketPtr ticket = CheckLoadBitmap(application, "bitmap.jpg", 80, 80);
-
- Internal::ResourceTicketPtr newTicket = resourceClient.RequestResourceTicket( ticket->GetId() + 2000 );
- DALI_TEST_CHECK( ! newTicket );
- END_TEST;
-}
-
-int UtcDaliInternalAddBitmapImage01(void)
-{
- TestApplication application;
- tet_infoline("Testing AddBitmap with reserved buffer()");
- testTicketObserver.Reset();
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGB565, 80, 80, 80, 80 );
-
- Internal::ImageTicketPtr imageTicket = resourceClient.AddBitmapImage( bitmap );
- DALI_TEST_CHECK( imageTicket );
- imageTicket->AddObserver( testTicketObserver );
-
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
- application.SendNotification(); // Flush update queue
- application.Render(0); // Process message
- application.SendNotification(); // Send message to tickets
-
- DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliInternalAddBitmapImage02(void)
-{
- TestApplication application;
- tet_infoline("Testing AddBitmap without reserved buffer()");
- testTicketObserver.Reset();
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
-
- Internal::ImageTicketPtr imageTicket = resourceClient.AddBitmapImage( bitmap );
- DALI_TEST_CHECK( imageTicket );
- imageTicket->AddObserver( testTicketObserver );
-
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 0, TEST_LOCATION );
- DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
-
- application.SendNotification(); // Flush update queue
- application.Render(0); // Process message
- application.SendNotification(); // Send message to tickets
-
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 0, TEST_LOCATION );
- DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
- END_TEST;
-}
-
-
-int UtcDaliInternalAddBitmapImage03(void)
-{
- TestApplication application;
- tet_infoline("Testing AddBitmap() with invalid bitmap");
- testTicketObserver.Reset();
-
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Internal::ImageTicketPtr imageTicket;
- bool exceptionRaised=false;
- try
- {
- imageTicket = resourceClient.AddBitmapImage( NULL );
- }
- catch( DaliException& e )
- {
- exceptionRaised = true;
- }
- DALI_TEST_CHECK( exceptionRaised );
- DALI_TEST_CHECK( ! imageTicket );
- END_TEST;
-}
-
-int UtcDaliInternalAllocateTexture01(void)
-{
- TestApplication application;
- tet_infoline("Testing AllocateTexture()");
- testTicketObserver.Reset();
-
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Internal::ResourceTicketPtr resourceTicket = resourceClient.AllocateTexture(80, 80, Pixel::L8 );
- resourceTicket->AddObserver( testTicketObserver );
-
- DALI_TEST_CHECK( resourceTicket );
- DALI_TEST_EQUALS ( resourceTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_CHECK( testTicketObserver.LoadSucceededCalled() == 0 );
-
- application.SendNotification(); // Flush update queue
- application.Render(0); // Process message
- application.SendNotification(); // Send message to tickets
-
- DALI_TEST_EQUALS ( resourceTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_CHECK( testTicketObserver.LoadSucceededCalled() == 0 );
- END_TEST;
-}
-
-int UtcDaliInternalAddNativeImage(void)
-{
- TestApplication application;
- tet_infoline("Testing AddNativeImage()");
-
- testTicketObserver.Reset();
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Internal::ResourceTicketPtr ticket;
- Internal::ImageTicketPtr imageTicket;
- { // Test image going out of scope after ticket creation (message to Update thread holds a ref)
- TestNativeImagePointer nativeImage = TestNativeImage::New( 80, 80 );
- ticket = resourceClient.AddNativeImage( *nativeImage );
- imageTicket = dynamic_cast(ticket.Get());
- DALI_TEST_CHECK( imageTicket );
- imageTicket->AddObserver( testTicketObserver );
- }
-
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
- DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
-
- application.SendNotification(); // Flush update queue
- application.Render(0); // Process message
- application.SendNotification(); // Send message to tickets
-
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
- DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
- END_TEST;
-}
-
-int UtcDaliInternalAddFrameBufferImage(void)
-{
- TestApplication application;
- tet_infoline("Testing AddFrameBufferImage()");
-
- testTicketObserver.Reset();
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
- Internal::ImageTicketPtr imageTicket = resourceClient.AddFrameBufferImage(80, 80, Pixel::A8, RenderBuffer::COLOR );
- DALI_TEST_CHECK( imageTicket );
- imageTicket->AddObserver( testTicketObserver );
-
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
-
- application.SendNotification(); // Flush update queue
- application.Render(0); // Process message
- application.SendNotification(); // Send message to tickets
-
- DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
- DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
- DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
- END_TEST;
-}
diff --git a/dali/internal/common/core-impl.cpp b/dali/internal/common/core-impl.cpp
index c7f51ae..0f1e821 100644
--- a/dali/internal/common/core-impl.cpp
+++ b/dali/internal/common/core-impl.cpp
@@ -163,8 +163,6 @@ Core::Core( RenderController& renderController, PlatformAbstraction& platform,
mStage->Initialize();
- mResourceClient = new ResourceClient( *mResourceManager, *mStage );
-
mGestureEventProcessor = new GestureEventProcessor(*mStage, gestureManager, mRenderController);
mEventProcessor = new EventProcessor(*mStage, *mNotificationManager, *mGestureEventProcessor);
@@ -208,7 +206,6 @@ Core::~Core()
delete mGestureEventProcessor;
delete mNotificationManager;
delete mShaderFactory;
- delete mResourceClient;
delete mResourceManager;
delete mDiscardQueue;
delete mTextureCacheDispatcher;
@@ -433,11 +430,6 @@ ResourceManager& Core::GetResourceManager()
return *(mResourceManager);
}
-ResourceClient& Core::GetResourceClient()
-{
- return *(mResourceClient);
-}
-
ShaderFactory& Core::GetShaderFactory()
{
return *(mShaderFactory);
diff --git a/dali/internal/common/core-impl.h b/dali/internal/common/core-impl.h
index 091408f..32daf86 100644
--- a/dali/internal/common/core-impl.h
+++ b/dali/internal/common/core-impl.h
@@ -53,7 +53,6 @@ class AnimationPlaylist;
class PropertyNotificationManager;
class EventProcessor;
class GestureEventProcessor;
-class ResourceClient;
class ResourceManager;
class ShaderFactory;
class TouchResampler;
@@ -237,12 +236,6 @@ private: // for use by ThreadLocalStorage
ResourceManager& GetResourceManager();
/**
- * Returns the Resource client.
- * @return A reference to the Resource Client.
- */
- ResourceClient& GetResourceClient();
-
- /**
* Returns the Shader factory
* @return A reference to the Shader binary factory.
*/
@@ -290,7 +283,6 @@ private:
AnimationPlaylistOwner mAnimationPlaylist; ///< For 'Fire and forget' animation support
OwnerPointer mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications
ShaderFactory* mShaderFactory; ///< Shader resource factory
- ResourceClient* mResourceClient; ///< Asynchronous Resource Loading
ResourceManager* mResourceManager; ///< Asynchronous Resource Loading
IntrusivePtr< RelayoutController > mRelayoutController; ///< Size negotiation relayout controller
SceneGraph::GeometryBatcher* mGeometryBatcher; ///< Instance of the geometry batcher
diff --git a/dali/internal/event/common/thread-local-storage.cpp b/dali/internal/event/common/thread-local-storage.cpp
index 33d4540..9769032 100644
--- a/dali/internal/event/common/thread-local-storage.cpp
+++ b/dali/internal/event/common/thread-local-storage.cpp
@@ -92,11 +92,6 @@ ResourceManager& ThreadLocalStorage::GetResourceManager()
return mCore->GetResourceManager();
}
-ResourceClient& ThreadLocalStorage::GetResourceClient()
-{
- return mCore->GetResourceClient();
-}
-
ShaderFactory& ThreadLocalStorage::GetShaderFactory()
{
return mCore->GetShaderFactory();
diff --git a/dali/internal/event/common/thread-local-storage.h b/dali/internal/event/common/thread-local-storage.h
index 4b16f1f..53f629d 100644
--- a/dali/internal/event/common/thread-local-storage.h
+++ b/dali/internal/event/common/thread-local-storage.h
@@ -36,7 +36,6 @@ namespace Internal
class Core;
class NotificationManager;
-class ResourceClient;
class ResourceManager;
class ShaderFactory;
class GestureEventProcessor;
@@ -116,12 +115,6 @@ public:
ResourceManager& GetResourceManager();
/**
- * Returns the Resource Client
- * @return reference to the Resource Client
- */
- ResourceClient& GetResourceClient();
-
- /**
* Returns the Shader Factory
* @return reference to the Shader Factory
*/
diff --git a/dali/internal/event/images/buffer-image-impl.cpp b/dali/internal/event/images/buffer-image-impl.cpp
index 3e2ca4b..a689537 100644
--- a/dali/internal/event/images/buffer-image-impl.cpp
+++ b/dali/internal/event/images/buffer-image-impl.cpp
@@ -65,7 +65,6 @@ BufferImage::BufferImage(unsigned int width, unsigned int height, Pixel::Format
: Image(),
mInternalBuffer( NULL ),
mExternalBuffer( NULL ),
- mResourceClient( NULL ),
mBufferSize( 0 ),
mByteStride( 0 ),
mBytesPerPixel( 0 ),
@@ -87,7 +86,6 @@ BufferImage::BufferImage(PixelBuffer* pixBuf,
: Image(),
mInternalBuffer( NULL ),
mExternalBuffer( pixBuf ),
- mResourceClient( NULL ),
mBufferSize( 0 ),
mByteStride( 0 ),
mBytesPerPixel( 0 ),
@@ -108,8 +106,6 @@ void BufferImage::SetupBuffer( unsigned int width,
Pixel::Format pixelformat,
unsigned int byteStride )
{
- ThreadLocalStorage& tls = ThreadLocalStorage::Get();
- mResourceClient = &tls.GetResourceClient();
mWidth = width;
mHeight = height;
mPixelFormat = pixelformat;
diff --git a/dali/internal/event/images/buffer-image-impl.h b/dali/internal/event/images/buffer-image-impl.h
index 6b8ceb5..74446a3 100644
--- a/dali/internal/event/images/buffer-image-impl.h
+++ b/dali/internal/event/images/buffer-image-impl.h
@@ -18,6 +18,9 @@
*
*/
+// EXTERNAL INCLUDES
+#include // for uint32_t
+
// INTERNAL INCLUDES
#include // For Integration::BitmapPtr
#include
@@ -34,7 +37,6 @@ namespace Internal
class BufferImage;
typedef IntrusivePtr BufferImagePtr;
-class ResourceClient;
class ResourceManager;
/**
@@ -189,7 +191,6 @@ private:
PixelBuffer* mInternalBuffer; ///< NULL if the data is supplied by an external buffer.
PixelBuffer* mExternalBuffer; ///< NULL if there is no external pixel data (this is never owned by BufferImage).
- ResourceClient* mResourceClient; ///< pointer to the resource client.
uint32_t mBufferSize; ///< size of the pixel buffer.
uint32_t mByteStride; ///< width of the pixel buffer in bytes.
uint32_t mBytesPerPixel; ///< width of a pixel in bytes.
diff --git a/dali/internal/event/images/encoded-buffer-image-impl.h b/dali/internal/event/images/encoded-buffer-image-impl.h
index c43db57..e06379b 100644
--- a/dali/internal/event/images/encoded-buffer-image-impl.h
+++ b/dali/internal/event/images/encoded-buffer-image-impl.h
@@ -32,7 +32,6 @@ namespace Internal
class EncodedBufferImage;
typedef IntrusivePtr EncodedBufferImagePtr;
-class ResourceClient;
class ResourceManager;
namespace SceneGraph
diff --git a/dali/internal/event/images/image-impl.cpp b/dali/internal/event/images/image-impl.cpp
index 3c41b7f..29a34af 100644
--- a/dali/internal/event/images/image-impl.cpp
+++ b/dali/internal/event/images/image-impl.cpp
@@ -28,7 +28,6 @@
#include
#include
#include
-#include
#include
using namespace Dali::Integration;
diff --git a/dali/internal/event/images/image-impl.h b/dali/internal/event/images/image-impl.h
index e6b3af1..a730955 100644
--- a/dali/internal/event/images/image-impl.h
+++ b/dali/internal/event/images/image-impl.h
@@ -25,7 +25,7 @@
#include
#include
#include
-#include
+#include
#include
namespace Dali
diff --git a/dali/internal/event/images/nine-patch-image-impl.cpp b/dali/internal/event/images/nine-patch-image-impl.cpp
index 16f2f89..8909749 100644
--- a/dali/internal/event/images/nine-patch-image-impl.cpp
+++ b/dali/internal/event/images/nine-patch-image-impl.cpp
@@ -25,7 +25,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -178,7 +177,6 @@ NinePatchImage::NinePatchImage( const std::string& filename )
{
mUrl = filename;
ThreadLocalStorage& tls = ThreadLocalStorage::Get();
- mResourceClient = &tls.GetResourceClient();
Integration::PlatformAbstraction& platformAbstraction = tls.GetPlatformAbstraction();
Integration::BitmapResourceType resourceType;
diff --git a/dali/internal/event/images/nine-patch-image-impl.h b/dali/internal/event/images/nine-patch-image-impl.h
index cdcea86..1bc8723 100644
--- a/dali/internal/event/images/nine-patch-image-impl.h
+++ b/dali/internal/event/images/nine-patch-image-impl.h
@@ -32,7 +32,6 @@ namespace Internal
class NinePatchImage;
typedef IntrusivePtr NinePatchImagePtr;
-class ResourceClient;
class ResourceManager;
namespace SceneGraph
@@ -130,7 +129,6 @@ private: // from ResourceImage
Uint16Pair ParseRange( unsigned int& index, unsigned int width, const PixelBuffer* & pixel, unsigned int pixelStride, int testByte, int testBits, int testValue );
private:
- ResourceClient* mResourceClient;
Integration::BitmapPtr mBitmap;
std::string mUrl;
StretchRanges mStretchPixelsX; //< The horizontal stretchable pixels in the cropped image space
diff --git a/dali/internal/event/images/resource-image-impl.cpp b/dali/internal/event/images/resource-image-impl.cpp
index 6c9ad3d..68f0acc 100644
--- a/dali/internal/event/images/resource-image-impl.cpp
+++ b/dali/internal/event/images/resource-image-impl.cpp
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
using namespace Dali::Integration;
diff --git a/dali/internal/event/images/resource-image-impl.h b/dali/internal/event/images/resource-image-impl.h
index 9ab3503..5843fd8 100644
--- a/dali/internal/event/images/resource-image-impl.h
+++ b/dali/internal/event/images/resource-image-impl.h
@@ -24,6 +24,7 @@
// INTERNAL INCLUDES
#include
#include
+#include
#include // For DALI_LOG_OBJECT_STRING_DECLARATION
namespace Dali
diff --git a/dali/internal/event/resources/image-ticket.h b/dali/internal/event/resources/image-ticket.h
index 09007db..f12daa7 100644
--- a/dali/internal/event/resources/image-ticket.h
+++ b/dali/internal/event/resources/image-ticket.h
@@ -109,12 +109,6 @@ private:
* If requested width or height was 0, the natural size is used.
*/
ImageAttributes mAttributes;
-
- /*
- * ResourceClient needs to set dimensions and pixelformat.
- * Image needs to know about them.
- */
- friend class ResourceClient;
};
} // namespace Internal
diff --git a/dali/internal/event/resources/resource-client-declarations.h b/dali/internal/event/resources/resource-client-declarations.h
index 12f17b4..9d488fe 100644
--- a/dali/internal/event/resources/resource-client-declarations.h
+++ b/dali/internal/event/resources/resource-client-declarations.h
@@ -19,8 +19,10 @@
*/
// EXTERNAL INCLUDES
+#include // for uint32_t
// INTERNAL INCLUDES
+#include
#include
#include
@@ -30,6 +32,15 @@ namespace Dali
namespace Internal
{
+typedef Integration::ResourceId ResourceId;
+
+/** Raw bytes of a resource laid out exactly as it wouldbe in a file, but in memory. */
+typedef Dali::RefCountedVector RequestBuffer;
+/** Counting smart pointer for managing a buffer of raw bytes. */
+typedef IntrusivePtr RequestBufferPtr;
+
+typedef Rect RectArea;
+
template <> struct ParameterType< Integration::LoadStatus >
: public BasicType< Integration::LoadStatus > {};
diff --git a/dali/internal/event/resources/resource-client.cpp b/dali/internal/event/resources/resource-client.cpp
deleted file mode 100644
index 2a0e2cd..0000000
--- a/dali/internal/event/resources/resource-client.cpp
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-
-namespace Dali
-{
-namespace Internal
-{
-using namespace Dali::Integration;
-
-typedef std::map TicketContainer;
-typedef TicketContainer::iterator TicketContainerIter;
-typedef TicketContainer::size_type TicketContainerSize;
-typedef std::pair TicketPair;
-
-struct ResourceClient::Impl
-{
- Impl()
- : mNextId(0)
- {
- }
-
- ResourceId mNextId;
- TicketContainer mTickets;
-};
-
-ResourceClient::ResourceClient( ResourceManager& resourceManager,
- EventThreadServices& eventThreadServices)
-: mResourceManager(resourceManager),
- mEventThreadServices(eventThreadServices)
-{
- mImpl = new ResourceClient::Impl();
- mResourceManager.SetClient(*this);
-}
-
-ResourceClient::~ResourceClient()
-{
- // Guard to allow handle destruction after Core has been destroyed
- if ( Stage::IsInstalled() )
- {
- for (TicketContainerIter iter = mImpl->mTickets.begin(); iter != mImpl->mTickets.end(); ++iter)
- {
- (*iter).second->StopLifetimeObservation();
- }
- }
- delete mImpl;
-}
-
-ResourceTicketPtr ResourceClient::RequestResource(
- const ResourceType& type,
- const std::string& path,
- LoadResourcePriority priority )
-{
- ResourceTicketPtr newTicket;
- ResourceTypePath typePath(type, path);
- ResourceId newId = 0;
-
- // Create the ticket first
- // NOTE: pre-increment, otherwise we get 0 for first one.
- newId = ++(mImpl->mNextId);
-
- switch (type.id)
- {
- case ResourceBitmap:
- {
- const BitmapResourceType& bitmapResource = static_cast (type);
- // image tickets will cache the requested parameters, which are updated on successful loading
- ImageTicket* imageTicket = new ImageTicket(*this, newId, typePath);
- imageTicket->mAttributes.Reset( bitmapResource.size, bitmapResource.scalingMode, bitmapResource.samplingMode, bitmapResource.orientationCorrection );
- newTicket = imageTicket;
- break;
- }
-
- case ResourceNativeImage:
- {
- const NativeImageResourceType& nativeResource = static_cast (type);
- // image tickets will cache the requested parameters, which are updated on successful loading
- ImageTicket* imageTicket = new ImageTicket(*this, newId, typePath);
- imageTicket->mAttributes.SetSize( nativeResource.imageDimensions.GetWidth(), nativeResource.imageDimensions.GetHeight() );
- newTicket = imageTicket;
- break;
- }
- case ResourceTargetImage:
- {
- newTicket = new ResourceTicket(*this, newId, typePath);
- break;
- }
- }
-
- mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: RequestResource(path:%s type.id:%d) newId:%u\n", path.c_str(), type.id, newId);
-
- RequestLoadResourceMessage( mEventThreadServices, mResourceManager, newId, typePath, priority );
- return newTicket;
-}
-
-ResourceTicketPtr ResourceClient::DecodeResource(
- const ResourceType& type,
- RequestBufferPtr buffer,
- LoadResourcePriority priority )
-{
- DALI_ASSERT_DEBUG( type.id == ResourceBitmap && "Only bitmap resources are currently decoded from memory buffers. It should be easy to expand to other resource types though. The public API function at the front and the resource thread at the back end are all that should need to be changed. The code in the middle should be agnostic to the the resource type it is conveying.\n" );
- DALI_ASSERT_DEBUG( buffer.Get() && "Null resource buffer passed for decoding." );
- ResourceTicketPtr newTicket;
- if( buffer.Get() ) //< Check to avoid SEGV on a null pointer.
- {
- ResourceTypePath typePath( type, "" );
- ResourceId newId = 0;
-
- // Create the correct ticket type for the resource:
- switch (type.id)
- {
- case ResourceBitmap:
- {
- // NOTE: pre-increment, otherwise we get 0 for first one.
- newId = ++(mImpl->mNextId);
- const BitmapResourceType& bitmapResource = static_cast ( type );
- // Image tickets will cache the requested parameters, which are updated on successful loading
- ImageTicket* imageTicket = new ImageTicket( *this, newId, typePath );
- imageTicket->mAttributes.Reset( bitmapResource.size, bitmapResource.scalingMode, bitmapResource.samplingMode, bitmapResource.orientationCorrection );
- newTicket = imageTicket;
- break;
- }
-
- // FALLTHROUGH:
- case ResourceNativeImage:
- case ResourceTargetImage:
- {
- DALI_LOG_ERROR( "Unsupported resource type passed for decoding from a memory buffer.\n" );
- }
- }
-
- if( newTicket )
- {
- mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: DecodeResource( type.id:%d ) newId:%u\n", type.id, newId);
-
- RequestDecodeResourceMessage( mEventThreadServices, mResourceManager, newId, typePath, buffer, priority );
- }
- }
- return newTicket;
-}
-
-bool ResourceClient::ReloadResource( ResourceId id, bool resetFinishedStatus, LoadResourcePriority priority )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: ReloadResource(Id: %u)\n", id);
-
- bool resourceExists = false;
- TicketContainerIter ticketIter;
- ticketIter = mImpl->mTickets.find(id);
-
- if(ticketIter != mImpl->mTickets.end())
- {
- resourceExists = true;
- // The ticket is already being observed
- ResourceTicket* ticket = ticketIter->second;
- DALI_ASSERT_DEBUG(ticket && "Null ticket for tracked resource request." );
- const ResourceTypePath * const typePathPtr = &ticket->GetTypePath();
- DALI_ASSERT_DEBUG( typePathPtr );
- RequestReloadResourceMessage( mEventThreadServices, mResourceManager, id, *typePathPtr, priority, resetFinishedStatus );
- }
- else
- {
- DALI_LOG_ERROR ("Resource %d does not exist\n", id);
- }
- return resourceExists;
-}
-
-ResourceTicketPtr ResourceClient::RequestResourceTicket( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: RequestResourceTicket(Id: %u)\n", id);
-
- ResourceTicketPtr ticket;
-
- TicketContainerIter ticketIter = mImpl->mTickets.find( id );
-
- if ( mImpl->mTickets.end() != ticketIter )
- {
- ticket = ticketIter->second;
- }
-
- return ticket;
-}
-
-ImageTicketPtr ResourceClient::AddBitmapImage(Bitmap* bitmap)
-{
- DALI_ASSERT_DEBUG( bitmap != NULL );
-
- ImageTicketPtr newTicket;
-
- const ResourceId newId = ++(mImpl->mNextId);
-
- ImageAttributes imageAttributes = ImageAttributes::New(bitmap->GetImageWidth(), bitmap->GetImageHeight());
- BitmapResourceType bitmapResourceType( ImageDimensions::FromFloatVec2( imageAttributes.GetSize() ) ); // construct first as no copy ctor (needed to bind ref to object)
- ResourceTypePath typePath(bitmapResourceType, "");
- newTicket = new ImageTicket(*this, newId, typePath);
- newTicket->mAttributes = imageAttributes;
- newTicket->LoadingSucceeded();
-
- mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: AddBitmapImage() New id = %u\n", newId);
- RequestAddBitmapImageMessage( mEventThreadServices, mResourceManager, newId, bitmap );
-
- return newTicket;
-}
-
-ResourceTicketPtr ResourceClient::AddNativeImage ( NativeImageInterface& resourceData )
-{
- ImageTicketPtr newTicket;
-
- const ResourceId newId = ++(mImpl->mNextId);
- NativeImageResourceType nativeImageResourceType; // construct first as no copy ctor (needed to bind ref to object)
- ResourceTypePath typePath(nativeImageResourceType, "");
- newTicket = new ImageTicket(*this, newId, typePath);
- newTicket->mAttributes = ImageAttributes::New(resourceData.GetWidth(),
- resourceData.GetHeight());
- newTicket->LoadingSucceeded();
-
- mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: AddNativeImage() New id = %u\n", newId);
-
- RequestAddNativeImageMessage( mEventThreadServices, mResourceManager, newId, &resourceData );
-
- return newTicket;
-}
-
-ImageTicketPtr ResourceClient::AddFrameBufferImage ( unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat )
-{
- ImageTicketPtr newTicket;
-
- const ResourceId newId = ++(mImpl->mNextId);
-
- ImageAttributes imageAttributes = ImageAttributes::New(width, height);
- RenderTargetResourceType renderTargetResourceType( ImageDimensions( width, height ) ); // construct first as no copy ctor (needed to bind ref to object)
- ResourceTypePath typePath(renderTargetResourceType, "");
- newTicket = new ImageTicket(*this, newId, typePath);
- newTicket->mAttributes = imageAttributes;
- newTicket->LoadingSucceeded();
-
- mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: AddFrameBufferImage() New id = %u\n", newId);
- RequestAddFrameBufferImageMessage( mEventThreadServices, mResourceManager, newId, width, height, pixelFormat, bufferFormat );
-
- return newTicket;
-}
-
-ImageTicketPtr ResourceClient::AddFrameBufferImage ( NativeImageInterface& nativeImage )
-{
- ImageTicketPtr newTicket;
-
- const ResourceId newId = ++(mImpl->mNextId);
-
- ImageAttributes imageAttributes = ImageAttributes::New( nativeImage.GetWidth(), nativeImage.GetHeight() );
- RenderTargetResourceType renderTargetResourceType( ImageDimensions( nativeImage.GetWidth(), nativeImage.GetHeight() ) ); // construct first as no copy ctor (needed to bind ref to object)
- ResourceTypePath typePath(renderTargetResourceType, "");
- newTicket = new ImageTicket(*this, newId, typePath);
- newTicket->mAttributes = imageAttributes;
- newTicket->LoadingSucceeded();
-
- mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: AddFrameBufferImage() New id = %u\n", newId);
- RequestAddFrameBufferImageMessage( mEventThreadServices, mResourceManager, newId, &nativeImage );
-
- return newTicket;
-}
-
-
-ResourceTicketPtr ResourceClient::AllocateTexture( unsigned int width,
- unsigned int height,
- Pixel::Format pixelformat )
-{
- ImageTicketPtr newTicket;
- const ResourceId newId = ++(mImpl->mNextId);
-
- ImageAttributes imageAttributes = ImageAttributes::New( width, height);
- BitmapResourceType bitmapResourceType( ImageDimensions( width, height ) ); // construct first as no copy ctor (needed to bind ref to object)
- ResourceTypePath typePath(bitmapResourceType, "");
- newTicket = new ImageTicket(*this, newId, typePath);
-
- mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
- newTicket->mAttributes = imageAttributes;
- newTicket->LoadingSucceeded();
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: AllocateTexture() New id = %u\n", newId);
-
- RequestAllocateTextureMessage( mEventThreadServices, mResourceManager, newId, width, height, pixelformat );
-
- return newTicket;
-}
-
-void ResourceClient::UpdateBitmapArea( ResourceTicketPtr ticket, RectArea& updateArea )
-{
- DALI_ASSERT_DEBUG( ticket );
-
- RequestUpdateBitmapAreaMessage( mEventThreadServices, mResourceManager, ticket->GetId(), updateArea );
-}
-
-void ResourceClient::UploadBitmap( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset )
-{
- RequestUploadBitmapMessage( mEventThreadServices,
- mResourceManager,
- destId,
- srcId,
- xOffset,
- yOffset );
-}
-
-
-void ResourceClient::UploadBitmap( ResourceId destId,Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset)
-{
- RequestUploadBitmapMessage( mEventThreadServices,
- mResourceManager,
- destId,
- bitmap,
- xOffset,
- yOffset );
-}
-
-void ResourceClient::UploadBitmap( ResourceId destId, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset)
-{
- RequestUploadBitmapMessage( mEventThreadServices,
- mResourceManager,
- destId,
- pixelData,
- xOffset,
- yOffset );
-}
-
-void ResourceClient::CreateGlTexture( ResourceId id )
-{
- RequestCreateGlTextureMessage( mEventThreadServices, mResourceManager, id );
-}
-
-
-/********************************************************************************
- ******************** ResourceTicketLifetimeObserver methods ****************
- ********************************************************************************/
-
-void ResourceClient::ResourceTicketDiscarded(const ResourceTicket& ticket)
-{
- const ResourceId deadId = ticket.GetId();
- const ResourceTypePath& typePath = ticket.GetTypePath();
-
- // The ticket object is dead, remove from tickets container
- TicketContainerSize erased = mImpl->mTickets.erase(deadId);
- DALI_ASSERT_DEBUG(erased != 0);
- (void)erased; // Avoid "unused variable erased" in release builds
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: ResourceTicketDiscarded() deadId = %u\n", deadId);
- RequestDiscardResourceMessage( mEventThreadServices, mResourceManager, deadId, typePath.type->id );
-}
-
-/********************************************************************************
- *********************** Notifications from ResourceManager ******************
- ********************************************************************************/
-
-void ResourceClient::NotifyUploaded( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifyUpdated(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- ticket->Uploaded();
- }
-}
-
-void ResourceClient::NotifyLoading( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifyLoading(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- ticket->Loading();
- }
-}
-
-void ResourceClient::NotifyLoadingSucceeded( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifyLoadingSucceeded(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- ticket->LoadingSucceeded();
- }
-}
-
-void ResourceClient::NotifyLoadingFailed( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifyLoadingFailed(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- ticket->LoadingFailed();
- }
-}
-
-void ResourceClient::UpdateImageTicket( ResourceId id, const ImageAttributes& imageAttributes ) ///!< Issue #AHC01
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: UpdateImageTicket(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- ImageTicketPtr imageTicket = dynamic_cast(ticket);
- if(imageTicket)
- {
- imageTicket->mAttributes = imageAttributes;
- }
- }
-}
-
-} // Internal
-
-} // Dali
diff --git a/dali/internal/event/resources/resource-client.h b/dali/internal/event/resources/resource-client.h
deleted file mode 100644
index 7c10b7e..0000000
--- a/dali/internal/event/resources/resource-client.h
+++ /dev/null
@@ -1,309 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_CLIENT_H__
-#define __DALI_INTERNAL_RESOURCE_CLIENT_H__
-
-/*
- * Copyright (c) 2016 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include
-
-// INTERNAL INCLUDES
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace Dali
-{
-class NativeImage;
-
-namespace Integration
-{
-class Bitmap;
-}
-
-namespace Internal
-{
-class EventThreadServices;
-class ResourceManager;
-class NotificationManager;
-
-
-typedef Integration::ResourceId ResourceId;
-
-/** Raw bytes of a resource laid out exactly as it wouldbe in a file, but in memory. */
-typedef Dali::RefCountedVector RequestBuffer;
-/** Counting smart pointer for managing a buffer of raw bytes. */
-typedef IntrusivePtr RequestBufferPtr;
-/** rectangular area (x,y,w,h) */
-typedef Rect RectArea;
-
-/**
- * ResourceClient is an event side object that manages resource requests.
- * It uses ResourceTicket objects to keep track of the lifetime of each request.
- * If the same resource is required by two client objects, they will share the same ResourceTicket
- * i.e. only one load will occur using the native filesystem.
- *
- * Resources themselves are handled by the Resource Manager in the update thread
- */
-class ResourceClient : public ResourceTicketLifetimeObserver
-{
-public:
-
- /**
- * Create a resource client.
- * There should exactly one of these objects per Dali Core.
- * @param[in] resourceManager The resource manager
- * @param[in] eventThreadServices Used for messaging to and reading from scene-graph.
- */
- ResourceClient( ResourceManager& resourceManager,
- EventThreadServices& eventThreadServices );
-
- /**
- * Virtual destructor.
- */
- virtual ~ResourceClient();
-
-public:
-
- /**
- * Request a resource from the native filesystem.
- * Adding an observer to the ticket will enable the application to determine when the
- * resource has finished loading.
- * @param[in] type The type of requested resource.
- * @param[in] path The path to the requested resource.
- * @param[in] priority The priority of the request. This is ignored if the resource is already being loaded.
- * @return A ref-counted request object. Keep a copy until the resource is no longer required.
- */
- ResourceTicketPtr RequestResource( const Integration::ResourceType& type,
- const std::string& path,
- Integration::LoadResourcePriority priority = Integration::LoadPriorityNormal );
- /**
- * Request that a resource be decoded in the background from the memory buffer
- * that is passed-in. The data in the memory buffer should be formatted exactly
- * as it would be in a file of a supported resource type.
- *
- * Adding an observer to the ticket will enable the application to determine when the
- * resource has finished decoding.
- * @note Only images are currently supported by this function.
- * @param[in] type The type of resource. Must be BitmapResourceType.
- * @param[in] buffer The raw data of the resource.
- * @param[in] priority The priority of the request. This is ignored if the resource is already being loaded.
- * @return A ref-counted request object on success or a null pointer on failure.
- * Keep a copy until the resource is no longer required.
- */
- ResourceTicketPtr DecodeResource( const Integration::ResourceType& type,
- RequestBufferPtr buffer,
- Integration::LoadResourcePriority priority = Integration::LoadPriorityNormal );
-
- /**
- * Request reloading a resource from the native filesystem.
- * If the resource is still loading, this request is ignored.
- * The ticket observer will be notified of completion with ResourceLoadingSucceeded() or
- * ResourceLoadingFailed()
- *
- * @param[in] id resource id
- * @param[in] resetFinishedStatus True if the finished status of the current image should be reset.
- * @param[in] priority The priority of the request. This is ignored if the resource is already being refreshed.
- * @return true if successful, false if resource doesn't exist
- */
- bool ReloadResource( ResourceId id, bool resetFinishedStatus = false, Integration::LoadResourcePriority priority = Integration::LoadPriorityNormal );
-
- /**
- * Get the ticket for the associated resource ID.
- * If no ticket can be found for this resource, then this returns
- * NULL to indicate the resource doesn't exist.
- * @param[in] id The resource ID.
- * @return A resource ticket, or NULL if no resource existed with the given ID.
- */
- ResourceTicketPtr RequestResourceTicket( ResourceId id );
-
- /**
- * Injects a bitmap resource (does not require loading).
- * @pre bitmap has to be initialized
- * @param[in] bitmap an initialized bitmap
- * @return A ref-counted request object. Keep a copy until the resource is no longer required.
- */
- ImageTicketPtr AddBitmapImage(Integration::Bitmap* bitmap);
-
- /**
- * Add an existing resource to the resource manager.
- * @param [in] resourceData the NativeImage object
- * @return A ref-counted request object. Keep a copy until the resource is no longer required.
- */
- ResourceTicketPtr AddNativeImage ( NativeImageInterface& resourceData );
-
- /**
- * Add a framebuffer resource to the resource manager.
- * @param[in] width width in pixels
- * @param[in] height height in pixels
- * @param[in] pixelFormat Pixel format
- * @return A ref-counted request object. Keep a copy until the resource is no longer required.
- */
- ImageTicketPtr AddFrameBufferImage ( unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat );
-
- /**
- * Add a framebuffer resource to the resource manager.
- * @param[in] nativeImage the NativeImage object
- * @return A ref-counted request object. Keep a copy until the resource is no longer required.
- */
- ImageTicketPtr AddFrameBufferImage ( NativeImageInterface& nativeImage );
-
- /**
- * Request allocation of a texture.
- * The texture is initially empty.
- * @note Older hardware may require image width and image height to be a power of two
- * @param[in] width Image width in pixels
- * @param[in] height Image height in pixels
- * @param[in] pixelformat Pixel format
- * @return A ref-counted request object. Keep a copy until the resource is no longer required.
- */
- ResourceTicketPtr AllocateTexture( unsigned int width,
- unsigned int height,
- Pixel::Format pixelformat );
-
- /**
- * Update bitmap area
- * @param[in] ticket The ticket representing the bitmap
- * @param[in] updateArea the area updated.
- */
- void UpdateBitmapArea( ResourceTicketPtr ticket, RectArea& updateArea );
-
- /**
- * Upload a bitmap to a texture
- * @param[in] destId The destination texture ID
- * @param[in] srcId The resource ID of the bitmap to upload
- * @param [in] xOffset Specifies an offset in the x direction within the texture
- * @param [in] yOffset Specifies an offset in the y direction within the texture
- */
- void UploadBitmap( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset );
-
- /**
- * Upload a bitmap to a texture
- * @param[in] destId The destination texture ID
- * @param[in] bitmap The pointer pointing to the bitmap to upload
- * @param [in] xOffset Specifies an offset in the x direction within the texture
- * @param [in] yOffset Specifies an offset in the y direction within the texture
- */
- void UploadBitmap( ResourceId destId, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset);
-
- /**
- * Upload a pixel buffer to a texture
- * @param[in] destId The destination texture ID
- * @param[in] bitmap The pointer pointing to the pixel data
- * @param [in] xOffset Specifies an offset in the x direction within the texture
- * @param [in] yOffset Specifies an offset in the y direction within the texture
- */
- void UploadBitmap( ResourceId destId, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset);
-
- /**
- * @brief Trigger asynchronous creation of GL texture to back resource immediately.
- * @param[in] id The resource ID to allocate a GL texture for.
- */
- void CreateGlTexture( ResourceId id );
-
-public: // From ResourceTicketLifetimeObserver.
-
- /**
- * This indicates that the previously requested resource is no longer needed.
- * @param[in] ticket The ticket to remove from resource manager.
- */
- virtual void ResourceTicketDiscarded(const ResourceTicket& ticket);
-
-public: // Message methods
-
- /**
- * Notify associated ticket observers that the resource has been uploaded to GL.
- * @param[in] id The resource id of the uploaded resource
- */
- void NotifyUploaded( ResourceId id );
-
- /**
- * Notify associated ticket observers that the resource is loading.
- * @param[in] id The resource id of the loading resource
- */
- void NotifyLoading( ResourceId id );
-
- /**
- * Notify associated ticket observers that the resource has loaded.
- * @param[in] id The resource id of the loaded resource
- */
- void NotifyLoadingSucceeded( ResourceId id );
-
- /**
- * Notify associated ticket observers that the resource has failed to load
- * @param[in] id The resource id of the resource
- */
- void NotifyLoadingFailed( ResourceId id );
-
- /**
- * Finds ImageTicket which belongs to resource identified by id and updates the cached
- * attributes with a new set which contains the actual width and height of the loaded
- * image but has undefined values for all other fields.
- * @param id The resource id to find the ticket of
- * @param imageAttributes The image attributes to assign to the ticket
- */
- void UpdateImageTicket( ResourceId id, const ImageAttributes& imageAttributes ); ///!< Issue #AHC01
-
-private:
-
- ResourceClient( const ResourceClient& ); ///< Undefined
- ResourceClient& operator=( const ResourceClient& ); ///< Undefined
-
- ResourceManager& mResourceManager; ///< The resource manager
- EventThreadServices& mEventThreadServices; ///< Interface to send messages through
-
-private:
- struct Impl;
- Impl* mImpl;
-};
-
-inline MessageBase* UpdateImageTicketMessage( ResourceClient& client, ResourceId id, const ImageAttributes& attrs )
-{
- return new MessageValue2< ResourceClient, ResourceId, ImageAttributes >(
- &client, &ResourceClient::UpdateImageTicket, id, attrs );
-}
-
-inline MessageBase* UploadedMessage( ResourceClient& client, ResourceId id )
-{
- return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyUploaded, id );
-}
-
-inline MessageBase* LoadingMessage( ResourceClient& client, ResourceId id )
-{
- return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyLoading, id );
-}
-
-inline MessageBase* LoadingSucceededMessage( ResourceClient& client, ResourceId id )
-{
- return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyLoadingSucceeded, id );
-}
-
-inline MessageBase* LoadingFailedMessage( ResourceClient& client, ResourceId id )
-{
- return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyLoadingFailed, id );
-}
-
-} // namespace Internal
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_CLIENT_H__
diff --git a/dali/internal/file.list b/dali/internal/file.list
index cf648b1..c46e12c 100644
--- a/dali/internal/file.list
+++ b/dali/internal/file.list
@@ -83,7 +83,6 @@ internal_src_files = \
$(internal_src_dir)/event/rendering/sampler-impl.cpp \
$(internal_src_dir)/event/rendering/shader-impl.cpp \
$(internal_src_dir)/event/resources/image-ticket.cpp \
- $(internal_src_dir)/event/resources/resource-client.cpp \
$(internal_src_dir)/event/resources/resource-ticket.cpp \
$(internal_src_dir)/event/resources/resource-type-path.cpp \
$(internal_src_dir)/event/size-negotiation/memory-pool-relayout-container.cpp \
diff --git a/dali/internal/render/gl-resources/texture-cache.cpp b/dali/internal/render/gl-resources/texture-cache.cpp
index 1dec123..9682d6c 100644
--- a/dali/internal/render/gl-resources/texture-cache.cpp
+++ b/dali/internal/render/gl-resources/texture-cache.cpp
@@ -21,7 +21,6 @@
// INTERNAL HEADERS
#include
#include
-#include // For RectArea
#include
#include
#include
diff --git a/dali/internal/render/gl-resources/texture-cache.h b/dali/internal/render/gl-resources/texture-cache.h
index 4ae5bef..4af5f1f 100644
--- a/dali/internal/render/gl-resources/texture-cache.h
+++ b/dali/internal/render/gl-resources/texture-cache.h
@@ -24,6 +24,7 @@
// INTERNAL INCLUDES
#include
#include
+#include
#include
#include
#include
@@ -31,7 +32,8 @@
#include
#include
#include
-#include // For RectArea
+#include
+#include // For RectArea
#include
#include
#include
diff --git a/dali/internal/update/common/texture-cache-dispatcher.h b/dali/internal/update/common/texture-cache-dispatcher.h
index e006754..d77d40c 100644
--- a/dali/internal/update/common/texture-cache-dispatcher.h
+++ b/dali/internal/update/common/texture-cache-dispatcher.h
@@ -28,7 +28,6 @@
#include
#include
#include
-#include // For RectArea
#include
#include
#include
diff --git a/dali/internal/update/manager/update-manager.cpp b/dali/internal/update/manager/update-manager.cpp
index 5ec876f..4485b89 100644
--- a/dali/internal/update/manager/update-manager.cpp
+++ b/dali/internal/update/manager/update-manager.cpp
@@ -937,9 +937,6 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
//Process the queued scene messages
mImpl->messageQueue.ProcessMessages( bufferIndex );
- //Post Process Ids of resources updated by renderer
- mImpl->resourceManager.PostProcessResources( bufferIndex );
-
//Forward compiled shader programs to event thread for saving
ForwardCompiledShadersToEventThread();
diff --git a/dali/internal/update/resources/resource-manager.cpp b/dali/internal/update/resources/resource-manager.cpp
index 7546d64..409e9d9 100644
--- a/dali/internal/update/resources/resource-manager.cpp
+++ b/dali/internal/update/resources/resource-manager.cpp
@@ -35,7 +35,6 @@
#include
#include
-#include
#include
#include
@@ -85,7 +84,6 @@ struct ResourceManager::ResourceManagerImpl
RenderQueue& renderQueue )
: mPlatformAbstraction(platformAbstraction),
mNotificationManager(notificationManager),
- mResourceClient(NULL),
mTextureCacheDispatcher(textureCacheDispatcher),
mTextureUploadedQueue(textureUploadedQueue),
mTextureUploadedProcessingQueue(),
@@ -103,7 +101,6 @@ struct ResourceManager::ResourceManagerImpl
PlatformAbstraction& mPlatformAbstraction;
NotificationManager& mNotificationManager;
- ResourceClient* mResourceClient; // (needs to be a ptr - it's not instantiated yet)
TextureCacheDispatcher& mTextureCacheDispatcher;
LockedResourceQueue& mTextureUploadedQueue;
TextureUploadedQueue mTextureUploadedProcessingQueue;
@@ -158,15 +155,6 @@ ResourceManager::~ResourceManager()
}
/********************************************************************************
- ************************ ResourceClient direct interface **********************
- ********************************************************************************/
-
-void ResourceManager::SetClient( ResourceClient& client )
-{
- mImpl->mResourceClient = &client;
-}
-
-/********************************************************************************
************************ UpdateManager direct interface ***********************
********************************************************************************/
@@ -186,25 +174,6 @@ bool ResourceManager::UpdateCache( BufferIndex updateBufferIndex )
return mImpl->cacheUpdated;
}
-void ResourceManager::PostProcessResources( BufferIndex updateBufferIndex )
-{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::Verbose, "ResourceManager: PostProcessResources()\n");
-
- mImpl->mTextureUploadedQueue.SwapQueue( mImpl->mTextureUploadedProcessingQueue );
-
- unsigned int numIds = mImpl->mTextureUploadedProcessingQueue.Size();
- unsigned int i;
-
- // process the list where RenderManager put post process requests
- for ( i = 0; i < numIds; ++i )
- {
- ResourceId resourceId = mImpl->mTextureUploadedProcessingQueue[i];
- SendToClient( UploadedMessage( *mImpl->mResourceClient, resourceId ) );
- }
-}
-
-
/********************************************************************************
*************************** CoreImpl direct interface *************************
********************************************************************************/
@@ -255,7 +224,6 @@ void ResourceManager::HandleDecodeResourceRequest(
void ResourceManager::HandleAddBitmapImageRequest( ResourceId id, BitmapPtr bitmap )
{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddBitmapImageRequest(id:%u)\n", id);
mImpl->oldCompleteRequests.insert(id);
@@ -265,7 +233,6 @@ void ResourceManager::HandleAddBitmapImageRequest( ResourceId id, BitmapPtr bitm
void ResourceManager::HandleAddNativeImageRequest(ResourceId id, NativeImageInterfacePtr nativeImage)
{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddNativeImageRequest(id:%u)\n", id);
mImpl->oldCompleteRequests.insert(id);
@@ -276,7 +243,6 @@ void ResourceManager::HandleAddNativeImageRequest(ResourceId id, NativeImageInte
void ResourceManager::HandleAddFrameBufferImageRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat )
{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddFrameBufferImageRequest(id:%u)\n", id);
mImpl->oldCompleteRequests.insert(id);
@@ -290,7 +256,6 @@ void ResourceManager::HandleAddFrameBufferImageRequest( ResourceId id, unsigned
void ResourceManager::HandleAddFrameBufferImageRequest( ResourceId id, NativeImageInterfacePtr nativeImage )
{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddFrameBufferImageRequest(id:%u)\n", id);
mImpl->oldCompleteRequests.insert(id);
@@ -349,11 +314,8 @@ void ResourceManager::HandleUploadBitmapRequest( ResourceId destId, PixelDataPtr
void ResourceManager::HandleReloadResourceRequest( ResourceId id, const ResourceTypePath& typePath, LoadResourcePriority priority, bool resetFinishedStatus )
{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
DALI_LOG_INFO( Debug::Filter::gResource, Debug::General, "ResourceManager: HandleReloadRequest(id:%u, path:%s)\n", id, typePath.path.c_str() );
- bool resourceIsAlreadyLoading = true;
-
if( resetFinishedStatus )
{
if( ! RemoveId( mImpl->newCompleteRequests, id ) )
@@ -368,14 +330,6 @@ void ResourceManager::HandleReloadResourceRequest( ResourceId id, const Resource
{
// Add ID to the loading set
mImpl->loadingRequests.insert(id);
- resourceIsAlreadyLoading = false;
- }
-
- if ( !resourceIsAlreadyLoading )
- {
- // load resource again
- mImpl->mPlatformAbstraction.LoadResource(ResourceRequest(id, *typePath.type, typePath.path, priority));
- SendToClient( LoadingMessage( *mImpl->mResourceClient, id ) );
}
}
@@ -561,7 +515,6 @@ bool ResourceManager::GetTextureMetadata( ResourceId id, TextureMetadata*& metad
void ResourceManager::LoadResponse( ResourceId id, ResourceTypeId type, ResourcePointer resource, LoadStatus loadStatus )
{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: LoadResponse(id:%u, status=%s)\n", id, loadStatus==RESOURCE_LOADING?"LOADING":loadStatus==RESOURCE_PARTIALLY_LOADED?"PARTIAL":"COMPLETE");
// ID might be in the loading set
@@ -598,7 +551,6 @@ void ResourceManager::LoadResponse( ResourceId id, ResourceTypeId type, Resource
bitmapHeight = packedBitmap->GetBufferHeight();
}
ImageAttributes attrs = ImageAttributes::New( bitmapWidth, bitmapHeight ); ///!< Issue #AHC01
- UpdateImageTicket (id, attrs);
// Check for reloaded bitmap
TextureMetadataCache::Iterator iter = mImpl->mTextureMetadata.Begin();
@@ -633,7 +585,6 @@ void ResourceManager::LoadResponse( ResourceId id, ResourceTypeId type, Resource
mImpl->mTextureMetadata.PushBack( TextureMetadata::New( id, nativeImg ) );
mImpl->mTextureCacheDispatcher.DispatchCreateTextureForNativeImage( id, nativeImg );
- UpdateImageTicket (id, attrs);
break;
}
@@ -643,9 +594,6 @@ void ResourceManager::LoadResponse( ResourceId id, ResourceTypeId type, Resource
}
}
- // Let ResourceClient know that the resource manager has loaded something that its clients might want to hear about:
- NotifyTickets();
-
// flag that a load has completed and the cache updated
mImpl->cacheUpdated = true;
}
@@ -671,9 +619,6 @@ void ResourceManager::LoadFailed(ResourceId id, ResourceFailure failure)
// Add the ID to the failed set, this will trigger a notification during UpdateTickets
mImpl->newFailedRequests.insert(id);
- // Let NotificationManager know that the resource manager needs to do some processing
- NotifyTickets();
-
mImpl->cacheUpdated = true;
}
}
@@ -682,46 +627,6 @@ void ResourceManager::LoadFailed(ResourceId id, ResourceFailure failure)
********************************* Private Methods *****************************
********************************************************************************/
-void ResourceManager::NotifyTickets()
-{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
- // Success notifications
- for (LiveRequestIter iter = mImpl->newCompleteRequests.begin(); iter != mImpl->newCompleteRequests.end(); ++iter)
- {
- // Move to oldCompleteRequests
- mImpl->oldCompleteRequests.insert(*iter);
-
- SendToClient( LoadingSucceededMessage( *mImpl->mResourceClient, *iter ) );
- }
- mImpl->newCompleteRequests.clear();
-
- // Failure notifications
- for (LiveRequestIter iter = mImpl->newFailedRequests.begin(); iter != mImpl->newFailedRequests.end(); ++iter)
- {
- // Move to oldFailedRequests
- mImpl->oldFailedRequests.insert(*iter);
-
- // We should have a matching request ticket
- SendToClient( LoadingFailedMessage( *mImpl->mResourceClient, *iter ) );
- }
- mImpl->newFailedRequests.clear();
-}
-
-void ResourceManager::UpdateImageTicket( ResourceId id, ImageAttributes& attributes ) ///!< Issue #AHC01
-{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
- // ResourceLoader should load images considering the requested size
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: UpdateImageTicket(id:%u)\n", id);
-
- // Let NotificationManager know that the resource manager needs to do some processing
- SendToClient( UpdateImageTicketMessage( *mImpl->mResourceClient, id, attributes) );
-}
-
-void ResourceManager::SendToClient( MessageBase* message )
-{
- mImpl->mNotificationManager.QueueMessage( message );
-}
-
void ResourceManager::DiscardDeadResources( BufferIndex updateBufferIndex )
{
for (DeadRequestIter iter = mImpl->deadRequests.begin(); iter != mImpl->deadRequests.end(); )
diff --git a/dali/internal/update/resources/resource-manager.h b/dali/internal/update/resources/resource-manager.h
index a8b9abb..5fe00b5 100644
--- a/dali/internal/update/resources/resource-manager.h
+++ b/dali/internal/update/resources/resource-manager.h
@@ -37,7 +37,6 @@
#include
#include
#include
-#include
#include
namespace Dali
@@ -115,18 +114,7 @@ public:
*/
virtual ~ResourceManager();
-public: // Used by ResourceClient
-
- /********************************************************************************
- ************************ ResourceClient direct interface **********************
- ********************************************************************************/
-
- /**
- * Resource client passes itself for secondary intialisation.
- * (The resource client requires the ResourceManager to be instantiated first).
- * @param[in] resourceClient The ResourceClient.
- */
- void SetClient( ResourceClient& resourceClient );
+public:
/********************************************************************************
************************ UpdateManager direct interface ***********************
@@ -141,12 +129,6 @@ public: // Used by ResourceClient
*/
bool UpdateCache( BufferIndex updateBufferIndex );
- /**
- * Iterate through the post process queue, performing requested updates.
- * @param[in] updateBufferIndex The current update buffer index.
- */
- void PostProcessResources( BufferIndex updateBufferIndex );
-
/********************************************************************************
*************************** CoreImpl direct interface *************************
********************************************************************************/
@@ -349,26 +331,6 @@ public:
********************************************************************************/
/**
- * Sends notification messages for load sucess & failure,
- * pushes from newComplete / newFailed into oldComplete / oldFailed respectively
- */
- void NotifyTickets();
-
- /**
- * Triggers message to Event thread to update the ticket's image attributes
- * @pre An Image resource with the given id should exist in the cache.
- * @param id ID of the image resource
- * @param attributes Resource image attributes
- */
- void UpdateImageTicket( ResourceId id, ImageAttributes& attributes );
-
- /**
- * Send message to ResourceClient in event thread
- * @param[in] message The message to send
- */
- void SendToClient( MessageBase* message );
-
- /**
* Discard all dead resources.
* @param[in] updateBufferIndex The current update buffer index.
*/