/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
#include <test-native-image.h>
// Internal headers are allowed here
-#include <dali/public-api/shader-effects/shader-effect.h>
#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/update/resources/bitmap-metadata.h>
+#include <dali/internal/update/resources/texture-metadata.h>
#include <dali/internal/update/resources/resource-manager.h>
#include <dali/internal/update/manager/update-manager.h>
#include <dali/internal/event/resources/resource-client.h>
{}
int LoadFailedCalled() {
- tet_printf("TicketObserver: LoadingFailed() called %d times", mLoadingFailedCalled);
+ tet_printf("TicketObserver: LoadingFailed() called %d times\n", mLoadingFailedCalled);
return mLoadingFailedCalled;
}
int LoadSucceededCalled() {
- tet_printf("TicketObserver: LoadingSucceeded() called %d times", mLoadingSucceededCalled);
+ tet_printf("TicketObserver: LoadingSucceeded() called %d times\n", mLoadingSucceededCalled);
return mLoadingSucceededCalled;
}
int UploadCalled() {
- tet_printf("TicketObserver: Uploaded() called %d times", mUploadedCount);
+ tet_printf("TicketObserver: Uploaded() called %d times\n", mUploadedCount);
return mUploadedCount;
}
void Reset() {
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
DALI_TEST_CHECK( resourceManager.IsResourceLoaded(req->GetId()) );
- Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(req->GetId());
- DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+ 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 );
DALI_TEST_CHECK( req->GetId() == ticket->GetId() );
application.GetPlatform().SetResourceLoaded(id, Integration::ResourceBitmap, resourcePtr2);
- application.Render(0); // Process update messages / UpdateCache
+ application.Render(0 , TEST_LOCATION ); // Process update messages / UpdateCache
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(id);
- DALI_TEST_CHECK( bitmapData.GetWidth() == 120 );
- DALI_TEST_CHECK( bitmapData.GetHeight() == 120 );
+ 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); // Process update messages / UpdateCache
+ 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(), 0, 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); // Process update messages
+ application.Render(1, TEST_LOCATION ); // 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_EQUALS( testTicketObserver.LoadSucceededCalled(), 2, TEST_LOCATION );
DALI_TEST_EQUALS( testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 1, TEST_LOCATION );
END_TEST;
}
application.Render(0);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(id);
- DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+ 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 );
DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- bitmapData = resourceManager.GetBitmapMetadata(id);
- DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+ 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 );
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(id);
- DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
- DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+ 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 );
application.Render(0); // Process update messages / UpdateCache
DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
- bitmapData = resourceManager.GetBitmapMetadata(id);
- DALI_TEST_CHECK( bitmapData.GetWidth() == 120 );
- DALI_TEST_CHECK( bitmapData.GetHeight() == 120 );
+ 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 );