Removed redundant resource loading & rendering code 24/113024/6
authorFrancisco Santos <f1.santos@samsung.com>
Wed, 15 Feb 2017 16:45:41 +0000 (16:45 +0000)
committerFrancisco Santos <f1.santos@samsung.com>
Tue, 21 Feb 2017 18:18:36 +0000 (18:18 +0000)
Change-Id: I369e0e907f452125eb97059f853e9e16fa31f158

98 files changed:
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h
automated-tests/src/dali/utc-Dali-Image.cpp
automated-tests/src/dali/utc-Dali-ResourceImage.cpp
dali/devel-api/images/texture-set-image.cpp
dali/integration-api/core.h
dali/integration-api/file.list
dali/integration-api/platform-abstraction.h
dali/integration-api/profiling.cpp
dali/integration-api/resource-cache.h [deleted file]
dali/integration-api/resource-request.h [deleted file]
dali/integration-api/resource-types.h
dali/internal/common/core-impl.cpp
dali/internal/common/core-impl.h
dali/internal/event/common/thread-local-storage.cpp
dali/internal/event/common/thread-local-storage.h
dali/internal/event/images/buffer-image-impl.cpp
dali/internal/event/images/buffer-image-impl.h
dali/internal/event/images/encoded-buffer-image-impl.cpp
dali/internal/event/images/encoded-buffer-image-impl.h
dali/internal/event/images/frame-buffer-image-impl.cpp
dali/internal/event/images/image-impl.cpp
dali/internal/event/images/image-impl.h
dali/internal/event/images/native-image-impl.cpp
dali/internal/event/images/nine-patch-image-impl.cpp
dali/internal/event/images/nine-patch-image-impl.h
dali/internal/event/images/resource-image-impl.cpp
dali/internal/event/rendering/frame-buffer-impl.cpp
dali/internal/event/rendering/frame-buffer-impl.h
dali/internal/event/rendering/shader-impl.cpp
dali/internal/event/rendering/shader-impl.h
dali/internal/event/rendering/texture-impl.cpp
dali/internal/event/rendering/texture-impl.h
dali/internal/event/rendering/texture-set-impl.cpp
dali/internal/event/rendering/texture-set-impl.h
dali/internal/event/resources/image-ticket.cpp [deleted file]
dali/internal/event/resources/image-ticket.h [deleted file]
dali/internal/event/resources/resource-client-declarations.h [deleted file]
dali/internal/event/resources/resource-ticket-lifetime-observer.h [deleted file]
dali/internal/event/resources/resource-ticket-observer.h [deleted file]
dali/internal/event/resources/resource-ticket.cpp [deleted file]
dali/internal/event/resources/resource-ticket.h [deleted file]
dali/internal/event/resources/resource-type-path.cpp [deleted file]
dali/internal/event/resources/resource-type-path.h [deleted file]
dali/internal/file.list
dali/internal/render/common/render-algorithms.cpp
dali/internal/render/common/render-algorithms.h
dali/internal/render/common/render-manager.cpp
dali/internal/render/common/render-manager.h
dali/internal/render/common/texture-uploaded-dispatcher.h [deleted file]
dali/internal/render/data-providers/render-data-provider.cpp
dali/internal/render/data-providers/render-data-provider.h
dali/internal/render/gl-resources/bitmap-texture.cpp [deleted file]
dali/internal/render/gl-resources/bitmap-texture.h [deleted file]
dali/internal/render/gl-resources/compressed-bitmap-texture.cpp [deleted file]
dali/internal/render/gl-resources/compressed-bitmap-texture.h [deleted file]
dali/internal/render/gl-resources/frame-buffer-texture.cpp [deleted file]
dali/internal/render/gl-resources/frame-buffer-texture.h [deleted file]
dali/internal/render/gl-resources/gl-texture.cpp [deleted file]
dali/internal/render/gl-resources/gl-texture.h [deleted file]
dali/internal/render/gl-resources/native-texture.cpp [deleted file]
dali/internal/render/gl-resources/native-texture.h [deleted file]
dali/internal/render/gl-resources/texture-cache.cpp [deleted file]
dali/internal/render/gl-resources/texture-cache.h [deleted file]
dali/internal/render/gl-resources/texture-declarations.h [deleted file]
dali/internal/render/gl-resources/texture-factory.cpp [deleted file]
dali/internal/render/gl-resources/texture-factory.h [deleted file]
dali/internal/render/gl-resources/texture-observer.h [deleted file]
dali/internal/render/renderers/render-frame-buffer.cpp
dali/internal/render/renderers/render-frame-buffer.h
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/renderers/render-renderer.h
dali/internal/render/renderers/render-texture.cpp
dali/internal/render/renderers/render-texture.h
dali/internal/render/shaders/program-controller.cpp
dali/internal/update/common/texture-cache-dispatcher.cpp [deleted file]
dali/internal/update/common/texture-cache-dispatcher.h [deleted file]
dali/internal/update/manager/render-instruction-processor.cpp
dali/internal/update/manager/render-instruction-processor.h
dali/internal/update/manager/update-algorithms.cpp
dali/internal/update/manager/update-algorithms.h
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h
dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
dali/internal/update/render-tasks/scene-graph-render-task-list.h
dali/internal/update/render-tasks/scene-graph-render-task.cpp
dali/internal/update/render-tasks/scene-graph-render-task.h
dali/internal/update/rendering/scene-graph-renderer.cpp
dali/internal/update/rendering/scene-graph-texture-set.cpp
dali/internal/update/rendering/scene-graph-texture-set.h
dali/internal/update/resources/resource-manager-declarations.h [deleted file]
dali/internal/update/resources/resource-manager.cpp [deleted file]
dali/internal/update/resources/resource-manager.h [deleted file]
dali/internal/update/resources/texture-metadata.h [deleted file]
dali/public-api/rendering/frame-buffer.cpp
dali/public-api/rendering/texture-set.cpp
dali/public-api/rendering/texture.cpp
dali/public-api/rendering/texture.h

index 86b5430..b177e4a 100644 (file)
@@ -25,10 +25,6 @@ namespace Dali
 TestPlatformAbstraction::TestPlatformAbstraction()
 : mTrace(),
   mIsLoadingResult( false ),
-  mGetDefaultFontSizeResult( 0 ),
-  mLoadedResourcesQueue(),
-  mFailedLoadQueue(),
-  mResourceRequests(),
   mSize(),
   mClosestSize(),
   mLoadFileResult(),
@@ -40,17 +36,6 @@ TestPlatformAbstraction::TestPlatformAbstraction()
 
 TestPlatformAbstraction::~TestPlatformAbstraction()
 {
-  DiscardRequest();
-}
-
-void TestPlatformAbstraction::Suspend()
-{
-  mTrace.PushCall("Suspend", "");
-}
-
-void TestPlatformAbstraction::Resume()
-{
-  mTrace.PushCall("Resume", "");
 }
 
 ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
@@ -75,16 +60,6 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::Resou
   return closestSize;
 }
 
-void TestPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
-{
-  std::ostringstream out;
-  out << "Type:" << request.GetType()->id << ", Path: " << request.GetPath() << std::endl ;
-
-  mTrace.PushCall("LoadResource", out.str());
-
-  mResourceRequests.PushBack( new Integration::ResourceRequest(request) );
-}
-
 Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath )
 {
   mTrace.PushCall("LoadResourceSynchronously", "");
@@ -97,59 +72,6 @@ Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer( const Integration:
   return mDecodedBitmap;
 }
 
-void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
-{
-  mTrace.PushCall("CancelLoad", "");
-}
-
-void TestPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
-{
-  mTrace.PushCall("GetResources", "");
-
-  while( !mLoadedResourcesQueue.empty() )
-  {
-    LoadedResource loaded( *mLoadedResourcesQueue.begin() );
-    mLoadedResourcesQueue.erase( mLoadedResourcesQueue.begin() );
-    cache.LoadResponse( loaded.id, loaded.type, loaded.resource, Integration::RESOURCE_COMPLETELY_LOADED );
-  }
-
-  // iterate through the resources which failed to load
-  while( !mFailedLoadQueue.empty() )
-  {
-    FailedLoad failed( *mFailedLoadQueue.begin() );
-    mFailedLoadQueue.erase( mFailedLoadQueue.begin() );
-    cache.LoadFailed( failed.id, failed.failure );
-  }
-}
-
-bool TestPlatformAbstraction::IsLoading()
-{
-  mTrace.PushCall("IsLoading", "");
-  return mIsLoadingResult;
-}
-
-int TestPlatformAbstraction::GetDefaultFontSize() const
-{
-  mTrace.PushCall("GetDefaultFontSize", "");
-  return mGetDefaultFontSizeResult;
-}
-
-void TestPlatformAbstraction::SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical)
-{
-  mTrace.PushCall("SetDpi", "");
-}
-
-bool TestPlatformAbstraction::LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
-{
-  mTrace.PushCall("LoadFile", "");
-  if( mLoadFileResult.loadResult )
-  {
-    buffer = mLoadFileResult.buffer;
-  }
-
-  return mLoadFileResult.loadResult;
-}
-
 bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
 {
   mTrace.PushCall("LoadShaderBinaryFile", "");
@@ -161,25 +83,12 @@ bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename,
   return mLoadFileResult.loadResult;
 }
 
-bool TestPlatformAbstraction::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const
-{
-  mTrace.PushCall("SaveFile", "");
-  return false;
-}
-
-void TestPlatformAbstraction::JoinLoaderThreads()
-{
-  mTrace.PushCall("JoinLoaderThreads", "");
-}
 
 /** Call this every test */
 void TestPlatformAbstraction::Initialize()
 {
   mTrace.Reset();
   mTrace.Enable(true);
-  mLoadedResourcesQueue.clear();
-  mFailedLoadQueue.clear();
-  mResourceRequests.Clear();
   mIsLoadingResult=false;
   mSynchronouslyLoadedResource.Reset();
   mDecodedBitmap.Reset();
@@ -189,19 +98,9 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
 {
   switch(func)
   {
-    case SuspendFunc:                         return mTrace.FindMethod("Suspend");
-    case ResumeFunc:                          return mTrace.FindMethod("Resume");
-    case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
     case LoadResourceSynchronouslyFunc:       return mTrace.FindMethod("LoadResourceSynchronously");
-    case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
     case LoadShaderBinaryFileFunc:            return mTrace.FindMethod("LoadShaderBinaryFile");
     case SaveShaderBinaryFileFunc:            return mTrace.FindMethod("SaveShaderBinaryFile");
-    case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
-    case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
-    case GetResourcesFunc:                    return mTrace.FindMethod("GetResources");
-    case IsLoadingFunc:                       return mTrace.FindMethod("IsLoading");
-    case SetDpiFunc:                          return mTrace.FindMethod("SetDpi");
-    case JoinLoaderThreadsFunc:               return mTrace.FindMethod("JoinLoaderThreads");
   }
   return false;
 }
@@ -213,88 +112,10 @@ void TestPlatformAbstraction::SetIsLoadingResult(bool result)
 
 void TestPlatformAbstraction::ClearReadyResources()
 {
-  mLoadedResourcesQueue.clear();
-  mFailedLoadQueue.clear();
   mSynchronouslyLoadedResource.Reset();
   mDecodedBitmap.Reset();
 }
 
-void TestPlatformAbstraction::SetResourceLoaded(Integration::ResourceId  loadedId,
-                                                Integration::ResourceTypeId  loadedType,
-                                                Integration::ResourcePointer loadedResource)
-{
-  LoadedResource loadedInfo;
-  loadedInfo.id = loadedId;
-  loadedInfo.type = loadedType;
-  loadedInfo.resource = loadedResource;
-  mLoadedResourcesQueue.push_back( loadedInfo );
-}
-
-void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId  id,
-                                                    Integration::ResourceFailure failure)
-{
-  FailedLoad failedInfo;
-  failedInfo.id = id;
-  failedInfo.failure = failure;
-  mFailedLoadQueue.push_back( failedInfo );
-}
-
-Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
-{
-  Integration::ResourceRequest* request = NULL;
-
-  // Return last request
-  if( ! mResourceRequests.Empty() )
-  {
-    request = *( mResourceRequests.End() - 1 );
-  }
-
-  return request;
-}
-
-const TestPlatformAbstraction::ResourceRequestContainer& TestPlatformAbstraction::GetAllRequests() const
-{
-  return mResourceRequests;
-}
-
-void TestPlatformAbstraction::SetAllResourceRequestsAsLoaded()
-{
-  for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
-       iter != endIter; ++iter )
-  {
-    Integration::ResourceRequest* request = *iter;
-    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
-    Integration::ResourcePointer resource(bitmap);
-    bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
-    SetResourceLoaded( request->GetId(), request->GetType()->id, resource );
-    delete request;
-  }
-  mResourceRequests.Clear();
-}
-
-void TestPlatformAbstraction::SetAllResourceRequestsAsFailed( Integration::ResourceFailure failure )
-{
-  for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
-       iter != endIter; ++iter )
-  {
-    Integration::ResourceRequest* request = *iter;
-    SetResourceLoadFailed( (*iter)->GetId(), failure);
-    delete request;
-  }
-  mResourceRequests.Clear();
-}
-
-void TestPlatformAbstraction::DiscardRequest()
-{
-  for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
-       iter != endIter; ++iter )
-  {
-    Integration::ResourceRequest* request = *iter;
-    delete request;
-  }
-  mResourceRequests.Clear();
-}
-
 void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
 {
   mClosestSize = size;
index 42e2d98..230ed02 100644 (file)
@@ -40,8 +40,6 @@ class DALI_IMPORT_API TestPlatformAbstraction : public Dali::Integration::Platfo
 
 public:
 
-  typedef Vector< Integration::ResourceRequest* > ResourceRequestContainer;
-
   /**
    * Constructor
    */
@@ -53,16 +51,6 @@ public:
   virtual ~TestPlatformAbstraction();
 
   /**
-   * @copydoc PlatformAbstraction::Suspend()
-   */
-  virtual void Suspend();
-
-  /**
-   * @copydoc PlatformAbstraction::Resume()
-   */
-  virtual void Resume();
-
-  /**
    * @copydoc PlatformAbstraction::GetClosestImageSize()
    */
   virtual ImageDimensions GetClosestImageSize( const std::string& filename,
@@ -81,11 +69,6 @@ public:
                                                bool orientationCorrection );
 
   /**
-   * @copydoc PlatformAbstraction::LoadResource()
-   */
-  virtual void LoadResource(const Integration::ResourceRequest& request);
-
-  /**
    * @copydoc PlatformAbstraction::LoadResourceSynchronously()
    */
   virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
@@ -96,70 +79,24 @@ public:
   virtual Integration::BitmapPtr DecodeBuffer( const Dali::Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
 
   /**
-   * @copydoc PlatformAbstraction::CancelLoad()
-   */
-  virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
-
-  /**
-   * @copydoc PlatformAbstraction::GetResources()
-   */
-  virtual void GetResources(Integration::ResourceCache& cache);
-
-  /**
-   * @copydoc PlatformAbstraction::IsLoading()
-   */
-  virtual bool IsLoading();
-
-  /**
-   * @copydoc PlatformAbstraction::GetDefaultFontSize()
-   */
-  virtual int GetDefaultFontSize() const;
-
-  /**
-   * @copydoc PlatformAbstraction::SetDpi()
-   */
-  virtual void SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical);
-
-  /**
-   * @copydoc PlatformAbstraction::LoadFile()
-   */
-  virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
-
-  /**
    * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
    */
   virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
 
   /**
-   * @copydoc PlatformAbstraction::SaveFile()
+   * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
    */
-  virtual bool SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
-
- /**
-  * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
-  */
   virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const { return true; }
 
-  virtual void JoinLoaderThreads();
 
 public: // TEST FUNCTIONS
 
   // Enumeration of Platform Abstraction methods
   typedef enum
   {
-    SuspendFunc,
-    ResumeFunc,
-    LoadResourceFunc,
     LoadResourceSynchronouslyFunc,
-    SaveFileFunc,
-    LoadFileFunc,
     LoadShaderBinaryFileFunc,
-    SaveShaderBinaryFileFunc,
-    CancelLoadFunc,
-    GetResourcesFunc,
-    IsLoadingFunc,
-    SetDpiFunc,
-    JoinLoaderThreadsFunc,
+    SaveShaderBinaryFileFunc
   } TestFuncEnum;
 
   /** Call this every test */
@@ -183,63 +120,11 @@ public: // TEST FUNCTIONS
   void SetIsLoadingResult(bool result);
 
   /**
-   * @brief Sets the value returned by GetDefaultFontSize
-   * @param[in] result The value to return
-   */
-  void SetGetDefaultFontSizeResult(float result);
-
-  /**
    * @brief Clears all resource queues
    */
   void ClearReadyResources();
 
   /**
-   * @brief Sets a particular resource request as loaded.
-   * @param[in] loadedId The ResourceID of the resource that has been loaded.
-   * @param[in] loadedType The type of resource that has been loaded.
-   * @param[in] loadedResource A pointer to the resource that has been loaded.
-   */
-  void SetResourceLoaded(Integration::ResourceId  loadedId,
-                         Integration::ResourceTypeId  loadedType,
-                         Integration::ResourcePointer loadedResource);
-
-  /**
-   * @brief Sets a particular resource request as load failure.
-   * @param[in] id The ID of the failed resource request.
-   * @param[in] failure The type of failure.
-   */
-  void SetResourceLoadFailed(Integration::ResourceId  id,
-                             Integration::ResourceFailure failure);
-
-  /**
-   * @brief Retrieves the latest resource request
-   * @return A pointer to the latest resource request.
-   */
-  Integration::ResourceRequest* GetRequest();
-
-  /**
-   * @brief Retrieves a reference to a container of all the resource requests.
-   * @return A reference to a container of all the resource requests.
-   */
-  const ResourceRequestContainer& GetAllRequests() const;
-
-  /**
-   * @brief Sets all resource requests as loaded.
-   */
-  void SetAllResourceRequestsAsLoaded();
-
-  /**
-   * @brief Sets all resource requests as loaded.
-   * @param[in] failure The failure type
-   */
-  void SetAllResourceRequestsAsFailed( Integration::ResourceFailure failure );
-
-  /**
-   * @brief Discards all current resource requests.
-   */
-  void DiscardRequest();
-
-  /**
    * @brief Sets the value returned by GetClosestImageSize.
    * @param[in] size The size that should be returned.
    */
@@ -277,19 +162,6 @@ private:
 
 private:
 
-  struct LoadedResource
-  {
-    Integration::ResourceId      id;
-    Integration::ResourceTypeId  type;
-    Integration::ResourcePointer resource;
-  };
-
-  struct FailedLoad
-  {
-    Integration::ResourceId      id;
-    Integration::ResourceFailure failure;
-  };
-
   struct LoadFileResult
   {
     inline LoadFileResult()
@@ -302,15 +174,8 @@ private:
     Dali::Vector< unsigned char> buffer;
   };
 
-  typedef std::vector< LoadedResource > LoadedResourceContainer;
-  typedef std::vector< FailedLoad > FailedLoadContainer;
-
   mutable TraceCallStack        mTrace;
   bool                          mIsLoadingResult;
-  int                           mGetDefaultFontSizeResult;
-  LoadedResourceContainer       mLoadedResourcesQueue;
-  FailedLoadContainer           mFailedLoadQueue;
-  ResourceRequestContainer      mResourceRequests;
   Vector2                       mSize;
   Vector2                       mClosestSize;
 
index aca4563..8caa2be 100644 (file)
@@ -39,18 +39,6 @@ static const char* gTestImageFilename = "icon_wrt.png";
 
 namespace
 {
-void LoadBitmapResource(TestPlatformAbstraction& platform)
-{
-  Integration::ResourceRequest* request = platform.GetRequest();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
-  Integration::ResourcePointer resource(bitmap);
-  bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
-
-  if(request)
-  {
-    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
-  }
-}
 
 }
 
@@ -126,8 +114,6 @@ int UtcDaliImageDiscard01(void)
     std::vector<GLuint> ids;
     ids.push_back( 23 );
     application.GetGlAbstraction().SetNextTextureIds( ids );
-    TestPlatformAbstraction& platform = application.GetPlatform();
-    LoadBitmapResource( platform );
     application.Render(16);
     application.SendNotification();
   } // Drop image handle
index cd9e95e..ccd3eb4 100644 (file)
@@ -213,15 +213,6 @@ int UtcDaliResourceImageSignalLoadingFinished(void)
   application.SendNotification();
   application.Render(16);
 
-  Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
-  if(request)
-  {
-    application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD)));
-  }
-
-  application.Render(16);
-  application.SendNotification();
-
   DALI_TEST_CHECK( SignalLoadFlag == true );
   END_TEST;
 }
index 869c8f1..84411ce 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 
 void TextureSetImage( TextureSet textureSet, size_t index, Image image )
 {
-  Internal::NewTexture* texture = NULL;
+  Internal::Texture* texture = NULL;
   if( image )
   {
     texture = GetImplementation( image ).GetTexture();
index 19693d8..ba492a1 100644 (file)
@@ -56,9 +56,8 @@ enum Reasons
   NOT_REQUESTED           = 0,    ///< Zero means that no further updates are required
   STAGE_KEEP_RENDERING    = 1<<1, ///<  - Stage::KeepRendering() is being used
   ANIMATIONS_RUNNING      = 1<<2, ///< - Animations are ongoing
-  LOADING_RESOURCES       = 1<<3, ///< - Resources are being loaded
-  MONITORING_PERFORMANCE  = 1<<4, ///< - The --enable-performance-monitor option is being used
-  RENDER_TASK_SYNC        = 1<<5  ///< - A render task is waiting for render sync
+  MONITORING_PERFORMANCE  = 1<<3, ///< - The --enable-performance-monitor option is being used
+  RENDER_TASK_SYNC        = 1<<4  ///< - A render task is waiting for render sync
 };
 }
 
index a6032f4..614ea22 100644 (file)
@@ -31,8 +31,6 @@ platform_abstraction_header_files = \
    $(platform_abstraction_src_dir)/bitmap.h \
    $(platform_abstraction_src_dir)/resource-policies.h \
    $(platform_abstraction_src_dir)/resource-types.h \
-   $(platform_abstraction_src_dir)/resource-request.h \
-   $(platform_abstraction_src_dir)/resource-cache.h \
    $(platform_abstraction_src_dir)/resource-declarations.h \
    $(platform_abstraction_src_dir)/gl-abstraction.h \
    $(platform_abstraction_src_dir)/gl-defines.h \
index db8bebb..ad79582 100644 (file)
@@ -20,8 +20,8 @@
 
 // INTERNAL INCLUDES
 
-#include <dali/integration-api/resource-cache.h>
 #include <dali/integration-api/bitmap.h>
+#include <dali/integration-api/resource-types.h>
 #include <dali/public-api/images/image-operations.h>
 #include <dali/public-api/common/dali-vector.h>
 
@@ -31,6 +31,8 @@ namespace Dali
 namespace Integration
 {
 
+typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
+
 /**
  * PlatformAbstraction is an abstract interface, used by Dali to access platform specific services.
  * A concrete implementation must be created for each platform, and provided when creating the
@@ -45,26 +47,6 @@ public:
    */
   virtual ~PlatformAbstraction() {}
 
-  // DALi Lifecycle
-
-  /**
-   * Tell the platform abstraction that Dali is ready to pause, such as when the
-   * application enters a background state.
-   * Allows background threads to pause their work until Resume() is called.
-   * This is a good time to release recreatable data such as memory caches
-   * to cooperate with other apps and reduce the chance of this one being
-   * force-killed in a low memory situation.
-   */
-  virtual void Suspend() = 0;
-
-  /**
-   * Tell the platform abstraction that Dali is resuming from a pause, such as
-   * when it has transitioned from a background state to a foreground one.
-   * It is time to wake up sleeping background threads and recreate memory
-   * caches and other temporary data.
-   */
-  virtual void Resume() = 0;
-
   // Resource Loading
 
   /**
@@ -112,17 +94,6 @@ public:
                                                bool orientationCorrection = true) = 0;
 
   /**
-   * Request a resource from the native filesystem. This is an asynchronous request.
-   * After this method returns, FillResourceCache() will be called to retrieve the result(s) of the
-   * resource loading operation. Loading resources in separate worker thread is recommended.
-   * Multi-threading note: this method will be called from the main thread only i.e. not
-   * from within the Core::Render() method.
-   * @param[in] request A unique resource request. This is not guaranteed to survive after LoadResource
-   * returns; the loading process should take a copy.
-   */
-  virtual void LoadResource(const ResourceRequest& request) = 0;
-
-  /**
    * Request a resource from the native filesystem. This is a synchronous request, i.e.
    * it will block the main loop whilst executing. It should therefore be used sparingly.
    *
@@ -145,51 +116,6 @@ public:
   virtual BitmapPtr DecodeBuffer( const ResourceType& resourceType, uint8_t * buffer, size_t bufferSize ) = 0;
 
   /**
-   * Cancel an ongoing LoadResource() request.
-   * Multi-threading note: this method will be called from the main thread only i.e. not
-   * from within the Core::Render() method.
-   * @param[in] id The ID of the resource to cancel.
-   * @param[in] typeId The ID type of the resource to cancel.
-   */
-  virtual void CancelLoad(ResourceId id, ResourceTypeId typeId) = 0;
-
-  /**
-   * Retrieve newly loaded resources.
-   * If no resources have finished loading, then this method returns immediately.
-   * Multi-threading note: this method will be called from the update thread, from within
-   * the UpdateManager::Update() method.
-   * @param[in] cache The resource cache to fill.
-   */
-  virtual void GetResources(ResourceCache& cache) = 0;
-
-  /**
-   * Waits for the asynchronous loader threads (if any) to finish.
-   * This will be only be called before Core destruction; no resource loading requests will be
-   * made following this method.
-   */
-  virtual void JoinLoaderThreads() = 0;
-
-  // Font Queries
-
-  /**
-   * Called by Dali to retrieve the default font size for the platform.
-   * This is an accessibility size, which is mapped to a UI Control specific point-size in stylesheets.
-   * For example if zero the smallest size, this could potentially map to TextLabel point-size 8.
-   * Multi-threading note: this method will be called from the main thread only i.e. not
-   * from within the Core::Render() method.
-   * @return The default font size.
-   */
-  virtual int GetDefaultFontSize() const = 0;
-
-  /**
-   * Load a file into a buffer
-   * @param[in] filename The filename to load
-   * @param[out] buffer  A buffer to receive the file.
-   * @result             true if the file is loaded.
-   */
-  virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const = 0;
-
-  /**
    * Load a shader binary file into a buffer
    * @param[in] filename The shader binary filename to load
    * @param[out] buffer  A buffer to receive the file.
index a4e97d1..8c1c74f 100644 (file)
 
 #include <dali/internal/event/images/image-impl.h>
 
-#include <dali/internal/event/resources/resource-ticket.h>
-#include <dali/internal/event/resources/image-ticket.h>
-
 #include <dali/internal/update/nodes/node.h>
 #include <dali/internal/update/nodes/scene-graph-layer.h>
 
 #include <dali/internal/update/rendering/scene-graph-renderer.h>
-#include <dali/internal/update/resources/texture-metadata.h>
 
-#include <dali/internal/render/gl-resources/bitmap-texture.h>
 #include <dali/internal/render/renderers/render-geometry.h>
 #include <dali/internal/render/renderers/render-property-buffer.h>
 #include <dali/internal/render/renderers/render-renderer.h>
@@ -104,10 +99,7 @@ const int LAYER_MEMORY_SIZE(
   sizeof( Internal::SceneGraph::Layer ) );
 const int IMAGE_MEMORY_SIZE(
   sizeof( Internal::Image ) +
-  sizeof( Integration::Bitmap ) +
-  sizeof( Internal::TextureMetadata ) +
-  sizeof( Internal::BitmapTexture ) +
-  sizeof( Internal::ImageTicket ) );
+  sizeof( Integration::Bitmap ) );
 const int RENDERER_MEMORY_SIZE(
   sizeof( Internal::Renderer ) +
   sizeof( Internal::SceneGraph::Renderer ) +
diff --git a/dali/integration-api/resource-cache.h b/dali/integration-api/resource-cache.h
deleted file mode 100644 (file)
index 0ca6803..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef __DALI_INTEGRATION_RESOURCE_CACHE_H__
-#define __DALI_INTEGRATION_RESOURCE_CACHE_H__
-
-/*
- * 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 <dali/public-api/common/intrusive-ptr.h>
-#include <dali/integration-api/resource-request.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-/**
- * Used to determine why a resource IO operation has failed.
- */
-enum ResourceFailure
-{
-  FailureUnknown,
-  FailureFileNotFound,
-  FailureInvalidPath
-};
-
-/**
- * Used to return loaded resources for rendering etc.
- */
-typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
-
-/**
- * Abstract interface to receive notifications of resource IO operations.
- * This is used when pulling loaded resources from the PlatformAbstraction.
- */
-class ResourceCache
-{
-protected:
-
-  /**
-   * Virtual protected destructor, no deletion through this interface
-   */
-  virtual ~ResourceCache() {}
-
-public:
-
-  /**
-   * Provide the results of a resource loading operation to the cache.
-   * @param[in] id The unique ID of the load request.
-   *               This should match an ID previously passed into PlatformAbstraction::LoadResource().
-   *               LoadResponse() may be called multiple times with the same ID, when results are available
-   *               at different stages e.g. a thumbnail image may be provided, before the full image is loaded.
-   * @param[in] type The type of the resource.
-   * @param[in] resource A pointer to a resource (Bitmap etc).
-   * @param[in] status The current loading status. RESOURCE_LOADING and RESOURCE_PARTIALLY_LOADED indicate there are more responses to come, RESOURCE_COMPLETELY_LOADED indicates this is the last response for this id.
-   */
-  virtual void LoadResponse(ResourceId id, ResourceTypeId type, ResourcePointer resource, LoadStatus status) = 0;
-
-  /**
-   * Report that a resource loading operation has failed.
-   * @param[in] id The unique ID of the load request.
-   *               This should match an ID previously passed into PlatformAbstraction::LoadResource().
-   * @param[in] failure An error code, used to determine why the load failed.
-   */
-  virtual void LoadFailed(ResourceId id, ResourceFailure failure) = 0;
-};
-
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_RESOURCE_CACHE_H__
diff --git a/dali/integration-api/resource-request.h b/dali/integration-api/resource-request.h
deleted file mode 100644 (file)
index 6690c64..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-#ifndef __DALI_INTEGRATION_RESOURCE_REQUEST_H__
-#define __DALI_INTEGRATION_RESOURCE_REQUEST_H__
-
-/*
- * 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 <dali/integration-api/resource-types.h>
-#include <dali/public-api/object/ref-object.h>
-
-namespace Dali
-{
-
-class RefObject;
-
-namespace Integration
-{
-
-// Resource Requests
-
-/**
- * Used to return loaded resources for rendering etc.
- */
-typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
-
-/**
- * Used to prioritize between loading operations.
- */
-enum LoadResourcePriority
-{
-  LoadPriorityLowest,
-  LoadPriorityLow,
-  LoadPriorityNormal,
-  LoadPriorityHigh,
-  LoadPriorityHighest,
-};
-
-/**
- * Used to request a resource from the native filesystem.
- */
-class ResourceRequest
-{
-public:
-
-  /**
-   * Used to request a resource be accessed from the native filesystem.
-   * @param[in] newId         A unique ID for this request.
-   * @param[in] resourceType  The type of resource requested. The implementation of
-   *                          PlatformAbstraction::LoadResource() is responsible for
-   *                          converting the native file(s) to this type
-   *                          e.g. decoding a jpeg to a bitmap.
-   * @param[in] resourcePath  The path of the resource; typically a filename.
-   * @param[in] loadPriority  The priority of the request.
-   */
-  ResourceRequest(ResourceId newId,
-                  const ResourceType& resourceType,
-                  const std::string& resourcePath,
-                  LoadResourcePriority loadPriority = LoadPriorityNormal)
-  : id(newId),
-    type(NULL),
-    path(resourcePath),
-    priority(loadPriority)
-  {
-    type = resourceType.Clone();
-  }
-
-  /**
-   * Used to request or save a resource from/to the native filesystem.
-   * @param[in] newId         A unique ID for this request.
-   * @param[in] resourceType  The type of resource.
-   * @param[in] resourcePath  The location of the resource / where the resource should be saved.
-   * @param[in] resourcePtr   The resource to decode / save.
-   * @param[in] savePriority  The priority of the request.
-   */
-  ResourceRequest(ResourceId newId,
-                  const ResourceType& resourceType,
-                  const std::string& resourcePath,
-                  ResourcePointer resourcePtr,
-                  LoadResourcePriority savePriority = LoadPriorityNormal)
-  : id(newId),
-    type(NULL),
-    path(resourcePath),
-    resource(resourcePtr),
-    priority(savePriority)
-  {
-    type = resourceType.Clone();
-  }
-
-  /**
-   * Copy constructor.
-   * @param[in] request The resource request to copy.
-   */
-  ResourceRequest(const ResourceRequest& request)
-  : id(request.id),
-    type(NULL),
-    path(request.path),
-    resource(request.resource),
-    priority(request.priority)
-  {
-    type = request.type->Clone();
-  }
-
-  /**
-   * Assignment operator.
-   * @param[in] rhs The resource request to copy.
-   */
-  ResourceRequest& operator=(const ResourceRequest& rhs)
-  {
-    if( this != &rhs )
-    {
-      id = rhs.id;
-      type = rhs.type->Clone();
-      path = rhs.path;
-      resource = rhs.resource;
-      priority = rhs.priority;
-    }
-
-    return *this;
-  }
-
-  /**
-   * Non-virtual destructor; not intended as a base class
-   */
-  ~ResourceRequest()
-  {
-    delete type;
-  }
-
-  /**
-   * Retrieve the resource ID
-   * @return The ID
-   */
-  ResourceId GetId() const
-  {
-    return id;
-  }
-
-  /**
-   * Retrieve the resource type
-   * @return The type
-   */
-  ResourceType* GetType() const
-  {
-    return type;
-  }
-
-  /**
-   * Retrieve the resource path
-   * @return The path
-   */
-  const std::string& GetPath() const
-  {
-    return path;
-  }
-
-  /**
-   * Retrieve the resource (for save and decode requests)
-   * @return The resource
-   */
-  ResourcePointer GetResource() const
-  {
-    return resource;
-  }
-
-  /**
-   * Retrieve the load priority
-   * @return The priority
-   */
-  LoadResourcePriority GetPriority() const
-  {
-    return priority;
-  }
-
-private:
-
-  ResourceId           id;
-  ResourceType*        type;
-  std::string          path;
-  /** When saving resources or decoding them, the resource data will be passed
-   *  through in a reference counted object here. When Loading, it will be null. */
-  ResourcePointer      resource;
-  LoadResourcePriority priority;
-};
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_RESOURCE_REQUEST_H__
index 1d5182e..db03510 100644 (file)
@@ -45,9 +45,7 @@ namespace Integration
  */
 enum ResourceTypeId
 {
-  ResourceBitmap,
-  ResourceNativeImage,
-  ResourceTargetImage
+  ResourceBitmap
 };
 
 /**
@@ -137,101 +135,6 @@ private:
   BitmapResourceType& operator=(const BitmapResourceType& rhs);
 };
 
-/**
- * NativeImageResourceType describes a native image resource, which can be injected
- * through ResourceManager::AddNativeImage() or requested through ResourceLoader::LoadResource().
- * If the adaptor does not support NativeImages, it can fall back to Bitmap type.
- */
-struct NativeImageResourceType : public ResourceType
-{
-  /**
-   * Constructor.
-   */
-  NativeImageResourceType()
-  : ResourceType(ResourceNativeImage) {}
-
-  /**
-   * Constructor.
-   * @param[in] dimensions Width and Height to allocate for image.
-   */
-  NativeImageResourceType( ImageDimensions dimensions )
-  : ResourceType(ResourceNativeImage),
-    imageDimensions(dimensions) {}
-
-  /**
-   * Destructor.
-   */
-  virtual ~NativeImageResourceType() {}
-
- /**
-  * @copydoc ResourceType::Clone
-  */
-  virtual ResourceType* Clone() const
-  {
-    return new NativeImageResourceType(imageDimensions);
-  }
-
-  /**
-   * Attributes are copied from the request (if supplied).
-   */
-  ImageDimensions imageDimensions;
-
-private:
-
-  // Undefined copy constructor.
-  NativeImageResourceType(const NativeImageResourceType& typePath);
-
-  // Undefined assignment operator.
-  NativeImageResourceType& operator=(const NativeImageResourceType& rhs);
-};
-
-/**
- * RenderTargetResourceType describes a bitmap resource, which can injected
- * through ResourceManager::AddTargetImage()
- */
-struct RenderTargetResourceType : public ResourceType
-{
-  /**
-   * Constructor.
-   */
-  RenderTargetResourceType()
-  : ResourceType(ResourceTargetImage) {}
-
-  /**
-   * Constructor.
-   * @param[in] dims Width and Height to allocate for image.
-   */
-  RenderTargetResourceType( ImageDimensions dims )
-  : ResourceType(ResourceTargetImage),
-    imageDimensions(dims) {}
-
-  /**
-   * Destructor.
-   */
-  virtual ~RenderTargetResourceType() {}
-
-  /**
-   * @copydoc ResourceType::Clone
-   */
-  virtual ResourceType* Clone() const
-  {
-    return new RenderTargetResourceType(imageDimensions);
-  }
-
-  /**
-   * Image size is copied from the request.
-   */
-  ImageDimensions imageDimensions;
-
-private:
-
-  // Undefined copy constructor.
-  RenderTargetResourceType(const RenderTargetResourceType& typePath);
-
-  // Undefined assignment operator.
-  RenderTargetResourceType& operator=(const RenderTargetResourceType& rhs);
-};
-
 } // namespace Integration
 
 } // namespace Dali
index 038743f..dccaacf 100644 (file)
 #include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
 
 #include <dali/internal/update/common/discard-queue.h>
-#include <dali/internal/update/common/texture-cache-dispatcher.h>
 #include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/update/manager/render-task-processor.h>
-#include <dali/internal/update/resources/resource-manager.h>
 
 #include <dali/internal/render/common/performance-monitor.h>
 #include <dali/internal/render/common/render-manager.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
 #include <dali/internal/render/gl-resources/context.h>
 
 using Dali::Internal::SceneGraph::UpdateManager;
 using Dali::Internal::SceneGraph::RenderManager;
 using Dali::Internal::SceneGraph::DiscardQueue;
 using Dali::Internal::SceneGraph::RenderQueue;
-using Dali::Internal::SceneGraph::TextureCache;
-using Dali::Internal::SceneGraph::TextureCacheDispatcher;
 
 namespace
 {
@@ -93,7 +88,6 @@ Core::Core( RenderController& renderController, PlatformAbstraction& platform,
   mUpdateManager(NULL),
   mRenderManager(NULL),
   mDiscardQueue(NULL),
-  mTextureUploadedQueue(),
   mNotificationManager(NULL),
   mShaderFactory(NULL),
   mIsActive(true),
@@ -111,42 +105,21 @@ Core::Core( RenderController& renderController, PlatformAbstraction& platform,
 
   mPropertyNotificationManager = PropertyNotificationManager::New();
 
-  mTextureUploadedQueue = new LockedResourceQueue;
-
   mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
 
-  mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, *mTextureUploadedQueue );
+  mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction );
 
   RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
-  TextureCache& textureCache = mRenderManager->GetTextureCache();
-
-  ResourcePolicy::Discardable discardPolicy = ResourcePolicy::OWNED_DISCARD;
-  if( dataRetentionPolicy == ResourcePolicy::DALI_RETAINS_ALL_DATA )
-  {
-    discardPolicy = ResourcePolicy::OWNED_RETAIN;
-  }
-  textureCache.SetDiscardBitmapsPolicy(discardPolicy);
-
-  mTextureCacheDispatcher = new SceneGraph::TextureCacheDispatcher( renderQueue, textureCache );
 
   mDiscardQueue = new DiscardQueue( renderQueue );
 
-  mResourceManager = new ResourceManager(  mPlatform,
-                                          *mNotificationManager,
-                                          *mTextureCacheDispatcher,
-                                          *mTextureUploadedQueue,
-                                          *mDiscardQueue,
-                                           renderQueue );
-
   mUpdateManager = new UpdateManager( *mNotificationManager,
                                       *mAnimationPlaylist,
                                       *mPropertyNotificationManager,
-                                      *mResourceManager,
                                       *mDiscardQueue,
                                        renderController,
                                       *mRenderManager,
                                        renderQueue,
-                                      *mTextureCacheDispatcher,
                                       *mRenderTaskProcessor );
 
   mRenderManager->SetShaderSaver( *mUpdateManager );
@@ -169,12 +142,6 @@ Core::Core( RenderController& renderController, PlatformAbstraction& platform,
 
 Core::~Core()
 {
-  /**
-   * TODO this should be done by Adaptor, Core does not know about threading
-   * First stop the resource loading thread(s)
-   */
-  mPlatform.JoinLoaderThreads();
-
   /*
    * The order of destructing these singletons is important!!!
    */
@@ -202,13 +169,10 @@ Core::~Core()
   delete mGestureEventProcessor;
   delete mNotificationManager;
   delete mShaderFactory;
-  delete mResourceManager;
   delete mDiscardQueue;
-  delete mTextureCacheDispatcher;
   delete mUpdateManager;
   delete mRenderManager;
   delete mRenderTaskProcessor;
-  delete mTextureUploadedQueue;
 }
 
 Integration::ContextNotifierInterface* Core::GetContextNotifier()
@@ -273,12 +237,6 @@ void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds,
 
   // No need to keep update running if there are notifications to process.
   // Any message to update will wake it up anyways
-
-  if ( mResourceManager->ResourcesToProcess() )
-  {
-    // If we are still processing resources, then we have to continue the update
-    status.keepUpdating |= Integration::KeepUpdating::LOADING_RESOURCES;
-  }
 }
 
 void Core::Render( RenderStatus& status )
@@ -290,15 +248,11 @@ void Core::Render( RenderStatus& status )
 
 void Core::Suspend()
 {
-  mPlatform.Suspend();
-
   mIsActive = false;
 }
 
 void Core::Resume()
 {
-  mPlatform.Resume();
-
   mIsActive = true;
 
   // trigger processing of events queued up while paused
@@ -420,11 +374,6 @@ NotificationManager& Core::GetNotificationManager()
   return *(mNotificationManager);
 }
 
-ResourceManager& Core::GetResourceManager()
-{
-  return *(mResourceManager);
-}
-
 ShaderFactory& Core::GetShaderFactory()
 {
   return *(mShaderFactory);
index cec1eb7..d2e4add 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/internal/common/owner-pointer.h>
 #include <dali/internal/event/animation/animation-playlist-declarations.h>
 #include <dali/internal/event/common/stage-def.h>
-#include <dali/internal/update/resources/resource-manager-declarations.h>
 #include <dali/public-api/common/view-mode.h>
 #include <dali/integration-api/resource-policies.h>
 
@@ -53,7 +52,6 @@ class AnimationPlaylist;
 class PropertyNotificationManager;
 class EventProcessor;
 class GestureEventProcessor;
-class ResourceManager;
 class ShaderFactory;
 class TouchResampler;
 class RelayoutController;
@@ -63,7 +61,6 @@ namespace SceneGraph
 class UpdateManager;
 class RenderManager;
 class DiscardQueue;
-class TextureCacheDispatcher;
 class RenderTaskProcessor;
 }
 
@@ -229,12 +226,6 @@ private:  // for use by ThreadLocalStorage
   NotificationManager& GetNotificationManager();
 
   /**
-   * Returns the Resource Manager.
-   * @return A reference to the Resource Manager.
-   */
-  ResourceManager& GetResourceManager();
-
-  /**
    * Returns the Shader factory
    * @return A reference to the Shader binary factory.
    */
@@ -276,13 +267,10 @@ private:
   SceneGraph::UpdateManager*                mUpdateManager;               ///< Update manager
   SceneGraph::RenderManager*                mRenderManager;               ///< Render manager
   SceneGraph::DiscardQueue*                 mDiscardQueue;                ///< Used to cleanup nodes & resources when no longer in use.
-  SceneGraph::TextureCacheDispatcher*       mTextureCacheDispatcher;      ///< Used to send messages to TextureCache
-  LockedResourceQueue*                      mTextureUploadedQueue;        ///< Stores resource ids which require post processing after render
   NotificationManager*                      mNotificationManager;         ///< Notification manager
   AnimationPlaylistOwner                    mAnimationPlaylist;           ///< For 'Fire and forget' animation support
   OwnerPointer<PropertyNotificationManager> mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications
   ShaderFactory*                            mShaderFactory;               ///< Shader resource factory
-  ResourceManager*                          mResourceManager;             ///< Asynchronous Resource Loading
   IntrusivePtr< RelayoutController >        mRelayoutController;          ///< Size negotiation relayout controller
   SceneGraph::RenderTaskProcessor*          mRenderTaskProcessor;         ///< Handles the processing of render tasks
   bool                                      mIsActive         : 1;        ///< Whether Core is active or suspended
index 9769032..627b668 100644 (file)
@@ -87,11 +87,6 @@ NotificationManager& ThreadLocalStorage::GetNotificationManager()
   return mCore->GetNotificationManager();
 }
 
-ResourceManager& ThreadLocalStorage::GetResourceManager()
-{
-  return mCore->GetResourceManager();
-}
-
 ShaderFactory& ThreadLocalStorage::GetShaderFactory()
 {
   return mCore->GetShaderFactory();
index 53f629d..95b6c30 100644 (file)
@@ -36,7 +36,6 @@ namespace Internal
 
 class Core;
 class NotificationManager;
-class ResourceManager;
 class ShaderFactory;
 class GestureEventProcessor;
 class RelayoutController;
@@ -109,12 +108,6 @@ public:
   NotificationManager& GetNotificationManager();
 
   /**
-   * Returns the Resource Manager
-   * @return reference to the Resource Manager
-   */
-  ResourceManager& GetResourceManager();
-
-  /**
    * Returns the Shader Factory
    * @return reference to the Shader Factory
    */
index a689537..7879f06 100644 (file)
@@ -127,7 +127,7 @@ void BufferImage::Update( const RectArea& updateArea )
 {
   if ( !mTexture )
   {
-    mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, mPixelFormat, mWidth, mHeight );
+    mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, mPixelFormat, mWidth, mHeight );
   }
   DALI_ASSERT_DEBUG( updateArea.x + updateArea.width <= mWidth && updateArea.y + updateArea.height <= mHeight );
   UploadArea( updateArea );
index 74446a3..008c8a0 100644 (file)
@@ -37,8 +37,6 @@ namespace Internal
 class BufferImage;
 typedef IntrusivePtr<BufferImage> BufferImagePtr;
 
-class ResourceManager;
-
 /**
  * BufferImage represents an image resource that can be added to actors etc.
  * Its pixel buffer data is provided by the application developer.
index f7bf280..6696f4d 100644 (file)
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/common/ref-counted-dali-vector.h>
 #include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/integration-api/platform-abstraction.h>
 
@@ -33,7 +34,14 @@ namespace Internal
 
 namespace
 {
+
 TypeRegistration mType( typeid( Dali::EncodedBufferImage ), typeid( Dali::Image ), NULL );
+
+/** Raw bytes of a resource laid out exactly as it would be in a file, but in memory. */
+typedef Dali::RefCountedVector<uint8_t> RequestBuffer;
+/** Counting smart pointer for managing a buffer of raw bytes. */
+typedef IntrusivePtr<RequestBuffer>     RequestBufferPtr;
+
 } // unnamed namespace
 
 EncodedBufferImagePtr EncodedBufferImage::New( const uint8_t * const encodedImage,
@@ -75,7 +83,7 @@ EncodedBufferImagePtr EncodedBufferImage::New( const uint8_t * const encodedImag
 
     //Create texture
     Pixel::Format format = bitmap->GetPixelFormat();
-    image->mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
+    image->mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
 
     //Upload data to the texture
     size_t bufferSize = bitmap->GetBufferSize();
@@ -97,7 +105,7 @@ EncodedBufferImagePtr EncodedBufferImage::New( const uint8_t * const encodedImag
   }
   else
   {
-    image->mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
+    image->mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
     image->mWidth = image->mHeight = 0u;
   }
 
index e06379b..26fb1ae 100644 (file)
@@ -32,8 +32,6 @@ namespace Internal
 class EncodedBufferImage;
 typedef IntrusivePtr<EncodedBufferImage> EncodedBufferImagePtr;
 
-class ResourceManager;
-
 namespace SceneGraph
 {
 class UpdateManager;
index d5f1c89..15aa6a8 100644 (file)
@@ -48,7 +48,7 @@ FrameBufferImagePtr FrameBufferImage::New( unsigned int width,
   FrameBufferImagePtr image = new FrameBufferImage( width, height );
   image->Initialize();
 
-  image->mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, pixelFormat, width, height );
+  image->mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelFormat, width, height );
   image->mFrameBufferObject = FrameBuffer::New( width, height, RenderBufferFormatToFrameBufferAttachments[bufferformat] );
   image->mFrameBufferObject->AttachColorTexture( image->mTexture, 0u, 0u );
 
@@ -60,7 +60,7 @@ FrameBufferImagePtr FrameBufferImage::New( NativeImageInterface& nativeImage )
   FrameBufferImagePtr image = new FrameBufferImage( nativeImage );
   image->Initialize();
 
-  image->mTexture = NewTexture::New( nativeImage );
+  image->mTexture = Texture::New( nativeImage );
   image->mFrameBufferObject = FrameBuffer::New( image->mTexture->GetWidth(), image->mTexture->GetHeight(), Dali::FrameBuffer::Attachment::NONE );
   image->mFrameBufferObject->AttachColorTexture( image->mTexture, 0u, 0u );
 
index 29a34af..9d5e275 100644 (file)
@@ -26,7 +26,6 @@
 #include <dali/public-api/object/type-registry.h>
 
 #include <dali/integration-api/debug.h>
-#include <dali/internal/event/resources/resource-ticket.h>
 #include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/event/common/stage-impl.h>
 
@@ -54,7 +53,7 @@ Dali::SignalConnectorType signalConnector1( mType, SIGNAL_IMAGE_UPLOADED, &Image
 bool Image::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   bool connected( true );
-  DALI_ASSERT_DEBUG( dynamic_cast<Image*>( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
+  DALI_ASSERT_DEBUG( dynamic_cast<Image*>( object ) && "Failed to downcast from BaseObject to Image.\n" );
   Image* image = static_cast<Image*>(object);
 
   if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_UPLOADED ) )
@@ -70,28 +69,6 @@ bool Image::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   return connected;
 }
 
-ResourceId Image::GetResourceId() const
-{
-  ResourceId ret = mTicket ? mTicket->GetId() : 0;
-
-  return ret;
-}
-
-void Image::ResourceLoadingFailed(const ResourceTicket& ticket)
-{
-  // do nothing
-}
-
-void Image::ResourceLoadingSucceeded(const ResourceTicket& ticket)
-{
-  // do nothing
-}
-
-void Image::ResourceUploaded(const ResourceTicket& ticket)
-{
-  mUploaded.Emit( Dali::Image( this ) );
-}
-
 unsigned int Image::GetWidth() const
 {
   return mWidth;
@@ -117,12 +94,6 @@ Image::Image()
 
 Image::~Image()
 {
-  if( mTicket )
-  {
-    mTicket->RemoveObserver( *this );
-    mTicket.Reset();
-  }
-
   if( Stage::IsInstalled() )
   {
     UnregisterObject();
index a730955..2a4f142 100644 (file)
@@ -25,8 +25,6 @@
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/internal/event/rendering/texture-impl.h>
-#include <dali/internal/event/resources/resource-client-declarations.h>
-#include <dali/internal/event/resources/resource-ticket-observer.h>
 
 namespace Dali
 {
@@ -43,7 +41,7 @@ typedef IntrusivePtr<Image> ImagePtr;
  * When the Image object is created, resource loading will be attempted.
  * Provided this is successful, the resource will exist until the Image is destroyed.
  */
-class Image : public BaseObject, public ResourceTicketObserver
+class Image : public BaseObject
 {
 public:
 
@@ -64,13 +62,6 @@ public:
   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
 
   /**
-   * returns the Id used for lookups
-   * @note if LoadPolicy::OnDemand is used and Image is off Stage, this will return 0.
-   * @return the unique ID of the image data resource. This is actually also the same as Dali Texture id.
-   */
-  ResourceId GetResourceId() const;
-
-  /**
    * Get the width of the image.
    * Only to be used after the image has finished loading.
    * (Ticket's LoadingSucceeded callback was called)
@@ -97,28 +88,11 @@ public:
   /**
    * Returns a pointer to the internal texture used by the image
    */
-  NewTexture* GetTexture() const
+  Texture* GetTexture() const
   {
     return mTexture.Get();
   }
 
-public: // From ResourceTicketObserver
-
-  /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingFailed()
-   */
-  virtual void ResourceLoadingFailed(const ResourceTicket& ticket);
-
-  /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingSucceeded()
-   */
-  virtual void ResourceLoadingSucceeded(const ResourceTicket& ticket);
-
-  /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceUploaded()
-   */
-  virtual void ResourceUploaded(const ResourceTicket& ticket);
-
 public:
 
   /**
@@ -150,8 +124,7 @@ protected:
 
 protected:
 
-  ResourceTicketPtr mTicket;              ///< smart pointer to the ticket object that gets completed when load finishes
-  NewTexturePtr mTexture;                 ///< smart pointer to the texture used by the image
+  TexturePtr mTexture;  ///< smart pointer to the texture used by the image
 
   unsigned int mWidth;     ///< natural width of the image
   unsigned int mHeight;    ///< natural height of the image
index 9c9fdc0..d7e3f9e 100644 (file)
@@ -57,7 +57,7 @@ NativeImagePtr NativeImage::New( NativeImageInterface& resourceData )
   image->mWidth  = resourceData.GetWidth();
   image->mHeight = resourceData.GetHeight();
 
-  image->mTexture = NewTexture::New( resourceData );
+  image->mTexture = Texture::New( resourceData );
   return image;
 }
 
index 8909749..97842b6 100644 (file)
@@ -28,7 +28,6 @@
 #include <dali/internal/update/manager/update-manager.h>
 #include <dali/integration-api/platform-abstraction.h>
 #include <dali/integration-api/resource-types.h>
-#include <dali/integration-api/resource-cache.h>
 
 
 namespace
@@ -189,7 +188,7 @@ NinePatchImage::NinePatchImage( const std::string& filename )
 
     mWidth = mBitmap->GetImageWidth();
     mHeight = mBitmap->GetImageHeight();
-    mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, mBitmap->GetPixelFormat(), mWidth, mHeight );
+    mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, mBitmap->GetPixelFormat(), mWidth, mHeight );
 
     size_t bufferSize = mBitmap->GetBufferSize();
     unsigned char* buffer = new unsigned char[bufferSize];
index 1bc8723..31b2f54 100644 (file)
@@ -32,8 +32,6 @@ namespace Internal
 class NinePatchImage;
 typedef IntrusivePtr<NinePatchImage> NinePatchImagePtr;
 
-class ResourceManager;
-
 namespace SceneGraph
 {
 class UpdateManager;
index 68f0acc..26114ac 100644 (file)
@@ -110,7 +110,7 @@ ResourceImage::~ResourceImage()
 bool ResourceImage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   bool connected( true );
-  DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
+  DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Failed to downcast from BaseObject to ResourceImage.\n" );
   ResourceImage* image = static_cast<ResourceImage*>(object);
 
   if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_LOADING_FINISHED ) )
@@ -156,7 +156,7 @@ void ResourceImage::Reload()
 
     //Create texture
     Pixel::Format format = bitmap->GetPixelFormat();
-    mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
+    mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
 
     //Upload data to the texture
     size_t bufferSize = bitmap->GetBufferSize();
@@ -181,7 +181,7 @@ void ResourceImage::Reload()
   }
   else
   {
-    mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
+    mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
     mWidth = mHeight = 0u;
     mLoadingState = Dali::ResourceLoadingFailed;
   }
index e9a1819..c2cfc80 100644 (file)
@@ -57,7 +57,7 @@ void FrameBuffer::Initialize()
   AddFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject );
 }
 
-void FrameBuffer::AttachColorTexture( NewTexturePtr texture, unsigned int mipmapLevel, unsigned int layer )
+void FrameBuffer::AttachColorTexture( TexturePtr texture, unsigned int mipmapLevel, unsigned int layer )
 {
   if( (unsigned int)( texture->GetWidth() / ( 1 << mipmapLevel ) ) == mWidth &&
       (unsigned int)( texture->GetHeight() / ( 1 << mipmapLevel ) ) == mHeight )
@@ -71,7 +71,7 @@ void FrameBuffer::AttachColorTexture( NewTexturePtr texture, unsigned int mipmap
   }
 }
 
-NewTexture* FrameBuffer::GetColorTexture()
+Texture* FrameBuffer::GetColorTexture()
 {
   return mColor.Get();
 }
index bf7f42f..8b0f776 100644 (file)
@@ -62,12 +62,12 @@ public:
   /**
    * @copydoc Dali::FrameBuffer::AttachColorTexture()
    */
-  void AttachColorTexture( NewTexturePtr texture, unsigned int mipmapLevel, unsigned int layer );
+  void AttachColorTexture( TexturePtr texture, unsigned int mipmapLevel, unsigned int layer );
 
   /**
    * @copydoc Dali::FrameBuffer::GetColorTexture()
    */
-  NewTexture* GetColorTexture();
+  Texture* GetColorTexture();
 
 private: // implementation
 
@@ -100,7 +100,7 @@ private: // data
   Internal::EventThreadServices& mEventThreadServices; ///< Used to send messages to the render thread via update thread
   Internal::Render::FrameBuffer* mRenderObject;        ///< The Render::Texture associated to this texture
 
-  NewTexturePtr mColor;
+  TexturePtr mColor;
   unsigned int mWidth;
   unsigned int mHeight;
   unsigned int mAttachments;                           ///< Bit-mask of type FrameBuffer::Attachment::Mask
index 9446377..db0b985 100644 (file)
@@ -25,7 +25,6 @@
 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
 #include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/event/effects/shader-factory.h>
-#include <dali/internal/event/resources/resource-ticket.h>
 #include <dali/internal/update/manager/update-manager.h>
 
 namespace Dali
index 083633f..99f6bd0 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/public-api/rendering/shader.h> // Dali::Shader
 #include <dali/internal/event/common/object-connector.h> // Dali::Internal::ObjectConnector
 #include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
-#include <dali/internal/event/resources/resource-ticket.h> // Dali::Internal::ResourceTicketPtr
 #include <dali/internal/common/shader-data.h> // ShaderPtr
 
 namespace Dali
index 1b2bc63..04f8a52 100644 (file)
@@ -27,26 +27,26 @@ namespace Dali
 namespace Internal
 {
 
-NewTexturePtr NewTexture::New(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
+TexturePtr Texture::New(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
 {
-  NewTexturePtr texture( new NewTexture( type, format, width, height ) );
+  TexturePtr texture( new Texture( type, format, width, height ) );
   texture->Initialize();
   return texture;
 }
 
-NewTexturePtr NewTexture::New( NativeImageInterface& nativeImageInterface )
+TexturePtr Texture::New( NativeImageInterface& nativeImageInterface )
 {
-  NewTexturePtr texture( new NewTexture( &nativeImageInterface ) );
+  TexturePtr texture( new Texture( &nativeImageInterface ) );
   texture->Initialize();
   return texture;
 }
 
-Render::NewTexture* NewTexture::GetRenderObject() const
+Render::Texture* Texture::GetRenderObject() const
 {
   return mRenderObject;
 }
 
-NewTexture::NewTexture(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
+Texture::Texture(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
 : mEventThreadServices( *Stage::GetCurrent() ),
   mRenderObject( NULL ),
   mNativeImage(),
@@ -57,7 +57,7 @@ NewTexture::NewTexture(TextureType::Type type, Pixel::Format format, unsigned in
 {
 }
 
-NewTexture::NewTexture( NativeImageInterfacePtr nativeImageInterface )
+Texture::Texture( NativeImageInterfacePtr nativeImageInterface )
 : mEventThreadServices( *Stage::GetCurrent() ),
   mRenderObject( NULL ),
   mNativeImage( nativeImageInterface ),
@@ -68,24 +68,24 @@ NewTexture::NewTexture( NativeImageInterfacePtr nativeImageInterface )
 {
 }
 
-void NewTexture::Initialize()
+void Texture::Initialize()
 {
   if( EventThreadServices::IsCoreRunning() )
   {
     if( mNativeImage )
     {
-      mRenderObject = new Render::NewTexture( mNativeImage );
+      mRenderObject = new Render::Texture( mNativeImage );
     }
     else
     {
-      mRenderObject = new Render::NewTexture( mType, mFormat, mWidth, mHeight );
+      mRenderObject = new Render::Texture( mType, mFormat, mWidth, mHeight );
     }
 
     AddTexture( mEventThreadServices.GetUpdateManager(), *mRenderObject );
   }
 }
 
-NewTexture::~NewTexture()
+Texture::~Texture()
 {
   if( EventThreadServices::IsCoreRunning() && mRenderObject )
   {
@@ -93,12 +93,12 @@ NewTexture::~NewTexture()
   }
 }
 
-bool NewTexture::Upload( PixelDataPtr pixelData )
+bool Texture::Upload( PixelDataPtr pixelData )
 {
   return Upload( pixelData, 0u, 0u, 0u, 0u, pixelData->GetWidth(), pixelData->GetHeight() );
 }
 
-bool NewTexture::Upload( PixelDataPtr pixelData,
+bool Texture::Upload( PixelDataPtr pixelData,
                          unsigned int layer, unsigned int mipmap,
                          unsigned int xOffset, unsigned int yOffset,
                          unsigned int width, unsigned int height )
@@ -150,7 +150,7 @@ bool NewTexture::Upload( PixelDataPtr pixelData,
   return result;
 }
 
-void NewTexture::GenerateMipmaps()
+void Texture::GenerateMipmaps()
 {
   if( EventThreadServices::IsCoreRunning() && mRenderObject )
   {
@@ -158,12 +158,12 @@ void NewTexture::GenerateMipmaps()
   }
 }
 
-unsigned int NewTexture::GetWidth() const
+unsigned int Texture::GetWidth() const
 {
   return mWidth;
 }
 
-unsigned int NewTexture::GetHeight() const
+unsigned int Texture::GetHeight() const
 {
   return mHeight;
 }
index a6fd3dc..213961e 100644 (file)
@@ -33,13 +33,13 @@ namespace Internal
 {
 namespace Render
 {
-class NewTexture;
+class Texture;
 }
 
-class NewTexture;
-typedef IntrusivePtr<NewTexture> NewTexturePtr;
+class Texture;
+typedef IntrusivePtr<Texture> TexturePtr;
 
-class NewTexture : public BaseObject
+class Texture : public BaseObject
 {
 public:
 
@@ -65,21 +65,21 @@ public:
    * @param[in] height The height of the texture
    * @return A smart-pointer to the newly allocated Texture.
    */
-  static NewTexturePtr New(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height);
+  static TexturePtr New(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height);
 
   /**
    * @brief Creates a new Texture from a native image
    * @param[in] nativeImageInterface The native image
    * @return A smart-pointer to the newly allocated Texture.
    */
-  static NewTexturePtr New( NativeImageInterface& nativeImageInterface );
+  static TexturePtr New( NativeImageInterface& nativeImageInterface );
 
   /**
    * @brief Get the texture render object
    *
    * @return the texture render object
    */
-  Render::NewTexture* GetRenderObject() const;
+  Render::Texture* GetRenderObject() const;
 
   /**
    * @copydoc Dali::Texture::Upload()
@@ -118,13 +118,13 @@ private: // implementation
    * @param[in] width The width of the texture
    * @param[in] height The height of the texture
    */
-  NewTexture(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height );
+  Texture(TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height );
 
   /**
    * Constructor from native image
    * @param[in] nativeImageInterface The native image
    */
-  NewTexture( NativeImageInterfacePtr nativeImageInterface );
+  Texture( NativeImageInterfacePtr nativeImageInterface );
 
   /**
    * Second stage initialization of the Texture
@@ -136,16 +136,16 @@ protected:
   /**
    * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual ~NewTexture();
+  virtual ~Texture();
 
 private: // unimplemented methods
-  NewTexture( const NewTexture& );
-  NewTexture& operator=( const NewTexture& );
+  Texture( const Texture& );
+  Texture& operator=( const Texture& );
 
 private: // data
 
   Internal::EventThreadServices& mEventThreadServices;    ///<Used to send messages to the render thread via update thread
-  Internal::Render::NewTexture* mRenderObject;            ///<The Render::Texture associated to this texture
+  Internal::Render::Texture* mRenderObject;            ///<The Render::Texture associated to this texture
 
   NativeImageInterfacePtr mNativeImage; ///< Pointer to native image
   Dali::TextureType::Type mType;      ///< Texture type (cached)
@@ -157,22 +157,22 @@ private: // data
 } // namespace Internal
 
 // Helpers for public-api forwarding methods
-inline Internal::NewTexture& GetImplementation(Dali::Texture& handle)
+inline Internal::Texture& GetImplementation(Dali::Texture& handle)
 {
   DALI_ASSERT_ALWAYS(handle && "Texture handle is empty");
 
   BaseObject& object = handle.GetBaseObject();
 
-  return static_cast<Internal::NewTexture&>(object);
+  return static_cast<Internal::Texture&>(object);
 }
 
-inline const Internal::NewTexture& GetImplementation(const Dali::Texture& handle)
+inline const Internal::Texture& GetImplementation(const Dali::Texture& handle)
 {
   DALI_ASSERT_ALWAYS(handle && "Texture handle is empty");
 
   const BaseObject& object = handle.GetBaseObject();
 
-  return static_cast<const Internal::NewTexture&>(object);
+  return static_cast<const Internal::Texture&>(object);
 }
 
 } // namespace Dali
index 5d018f3..1ebd9a0 100644 (file)
@@ -36,12 +36,12 @@ TextureSetPtr TextureSet::New()
   return textureSet;
 }
 
-void TextureSet::SetTexture( size_t index, NewTexturePtr texture )
+void TextureSet::SetTexture( size_t index, TexturePtr texture )
 {
-  size_t textureCount( mNewTextures.size() );
+  size_t textureCount( mTextures.size() );
   if( index >= textureCount )
   {
-    mNewTextures.resize(index + 1);
+    mTextures.resize(index + 1);
 
     bool samplerExist = true;
     if( mSamplers.size() < index + 1 )
@@ -52,7 +52,7 @@ void TextureSet::SetTexture( size_t index, NewTexturePtr texture )
 
     for( size_t i(textureCount); i<=index; ++i )
     {
-      mNewTextures[i] = NULL;
+      mTextures[i] = NULL;
 
       if( !samplerExist )
       {
@@ -61,9 +61,9 @@ void TextureSet::SetTexture( size_t index, NewTexturePtr texture )
     }
   }
 
-  mNewTextures[index]= texture;
+  mTextures[index]= texture;
 
-  Render::NewTexture* renderTexture(0);
+  Render::Texture* renderTexture(0);
   if( texture )
   {
     renderTexture = texture->GetRenderObject();
@@ -72,12 +72,12 @@ void TextureSet::SetTexture( size_t index, NewTexturePtr texture )
   SceneGraph::SetTextureMessage( mEventThreadServices, *mSceneObject, index, renderTexture );
 }
 
-NewTexture* TextureSet::GetTexture( size_t index ) const
+Texture* TextureSet::GetTexture( size_t index ) const
 {
-  NewTexture* result(0);
-  if( index < mNewTextures.size() )
+  Texture* result(0);
+  if( index < mTextures.size() )
   {
-    result = mNewTextures[index].Get();
+    result = mTextures[index].Get();
   }
   else
   {
@@ -127,7 +127,7 @@ Sampler* TextureSet::GetSampler( size_t index ) const
 
 size_t TextureSet::GetTextureCount() const
 {
-  return mNewTextures.size();
+  return mTextures.size();
 }
 
 const SceneGraph::TextureSet* TextureSet::GetTextureSetSceneObject() const
index 52ba8bd..eb692b9 100644 (file)
@@ -59,12 +59,12 @@ public:
   /**
    * @copydoc Dali::TextureSet::SetTexture()
    */
-  void SetTexture( size_t index, NewTexturePtr texture );
+  void SetTexture( size_t index, TexturePtr texture );
 
   /**
    * @copydoc Dali::TextureSet::GetTexture()
    */
-  NewTexture* GetTexture( size_t index ) const;
+  Texture* GetTexture( size_t index ) const;
 
   /**
    * @copydoc Dali::TextureSet::SetSampler()
@@ -111,7 +111,7 @@ private: // Data
   EventThreadServices& mEventThreadServices;    ///<Used to send messages to the update thread
   SceneGraph::TextureSet* mSceneObject;
   std::vector<SamplerPtr> mSamplers;
-  std::vector<NewTexturePtr> mNewTextures;
+  std::vector<TexturePtr> mTextures;
 };
 
 } // namespace Internal
diff --git a/dali/internal/event/resources/image-ticket.cpp b/dali/internal/event/resources/image-ticket.cpp
deleted file mode 100644 (file)
index e815791..0000000
+++ /dev/null
@@ -1,45 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/resources/image-ticket.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-ImageTicket::ImageTicket( ResourceTicketLifetimeObserver& observer, unsigned int id, ResourceTypePath& typePath )
-: ResourceTicket( observer, id, typePath )
-{
-}
-
-int ImageTicket::GetWidth() const
-{
-  return mAttributes.GetWidth();
-}
-
-int ImageTicket::GetHeight() const
-{
-  return mAttributes.GetHeight();
-}
-
-} // namespace Internal
-
-} // namespace Dali
-
diff --git a/dali/internal/event/resources/image-ticket.h b/dali/internal/event/resources/image-ticket.h
deleted file mode 100644 (file)
index f12daa7..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef __DALI_INTERNAL_IMAGE_TICKET_H__
-#define __DALI_INTERNAL_IMAGE_TICKET_H__
-
-/*
- * 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 <dali/internal/event/resources/resource-ticket.h>
-#include <dali/public-api/images/image.h>
-#include <dali/internal/common/image-attributes.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-class ImageTicket;
-class  ResourceManager;
-
-typedef IntrusivePtr<ImageTicket>    ImageTicketPtr;
-
-/**
- * ImageTicket is essentially the same as a ResourceTicket,
- * except that it contains additional information about the loaded image resource.
- * The data is the result of the resource loading request.
- *
- * Multi-threading note: this class should be used in the main thread only
- * i.e. not from within Dali::Integration::Core::Render().
- */
-class ImageTicket : public ResourceTicket
-{
-public:
-
-  /**
-   * Create an image resource request.
-   * This should only be done by the ResourceTicketRegistry.
-   * @param [in] observer A resource ticket lifetime observer.
-   * @param [in] id A unique ID for this ticket (loading request).
-   * @param [in] typePath The resource Type & Path pair.
-   */
-  ImageTicket( ResourceTicketLifetimeObserver& observer, unsigned int id, ResourceTypePath& typePath );
-
-  /**
-   * Get the attributes of an image.
-   * Only to be used after the image has finished loading.
-   * (Ticket's LoadingSucceeded callback was called)
-   * Reflects the last cached values after a LoadComplete.
-   * If requested width or height was 0, they are replaced by concrete dimensions.
-   * @return a copy of the image attributes
-   */
-  const ImageAttributes& GetAttributes() const { return mAttributes;}
-
-  /**
-   * Get the width of an image.
-   * Only to be used after the image has finished loading.
-   * (Ticket's LoadingSucceeded callback was called)
-   * Reflects the last cached values after a LoadComplete.
-   * If requested width or height was 0, they are replaced by concrete dimensions.
-   * @return the width
-   */
-  int GetWidth() const;
-
-  /**
-   * Get the height of an image.
-   * Only to be used after the image has finished loading.
-   * (Ticket's LoadingSucceeded callback was called)
-   * Reflects the last cached values after a LoadComplete.
-   * If requested width or height was 0, they are replaced by concrete dimensions.
-   * @return the height
-   */
-  int GetHeight() const;
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ImageTicket()
-  {
-  }
-
-private:
-
-  // Undefined copy constructor.
-  ImageTicket(const ImageTicket& typePath);
-
-  // Undefined copy constructor.
-  ImageTicket& operator=(const ImageTicket& rhs);
-
-private:
-
-  /**
-   * Loaded Image attributes (width, height, pixelformat etc.).
-   * Contains actual values only after the image has finished loading.
-   * If requested width or height was 0, the natural size is used.
-   */
-  ImageAttributes mAttributes;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_IMAGE_TICKET_H__
diff --git a/dali/internal/event/resources/resource-client-declarations.h b/dali/internal/event/resources/resource-client-declarations.h
deleted file mode 100644 (file)
index 9d488fe..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_CLIENT_DECLARATIONS_H__
-#define __DALI_INTERNAL_RESOURCE_CLIENT_DECLARATIONS_H__
-
-/*
- * 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <stdint.h> // for uint32_t
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/common/ref-counted-dali-vector.h>
-#include <dali/integration-api/resource-declarations.h>
-#include <dali/internal/common/type-abstraction.h>
-
-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<uint8_t> RequestBuffer;
-/** Counting smart pointer for managing a buffer of raw bytes. */
-typedef IntrusivePtr<RequestBuffer>     RequestBufferPtr;
-
-typedef Rect<unsigned int> RectArea;
-
-template <> struct ParameterType< Integration::LoadStatus >
-: public BasicType< Integration::LoadStatus > {};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_CLIENT_DECLARATIONS_H__
diff --git a/dali/internal/event/resources/resource-ticket-lifetime-observer.h b/dali/internal/event/resources/resource-ticket-lifetime-observer.h
deleted file mode 100644 (file)
index 77ee03d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_TICKET_LIFETIME_OBSERVER_H__
-#define __DALI_INTERNAL_RESOURCE_TICKET_LIFETIME_OBSERVER_H__
-
-/*
- * 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.
- *
- */
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class ResourceTicket;
-
-/**
- * The ResourceTicketLifetimeObserver observes the lifetime of resource tickets.
- */
-class ResourceTicketLifetimeObserver
-{
-public:
-
-  /**
-   * Called when a resource ticket is discarded.
-   * This occurs during the ResourceTicket destructor.
-   * @param[in] ticket The discarded ticket.
-   */
-  virtual void ResourceTicketDiscarded( const ResourceTicket& ticket ) = 0;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_TICKET_LIFETIME_OBSERVER_H__
diff --git a/dali/internal/event/resources/resource-ticket-observer.h b/dali/internal/event/resources/resource-ticket-observer.h
deleted file mode 100644 (file)
index 8b7c154..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_TICKET_OBSERVER_H__
-#define __DALI_INTERNAL_RESOURCE_TICKET_OBSERVER_H__
-
-/*
- * 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 <dali/public-api/object/ref-object.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class ResourceTicket;
-
-typedef IntrusivePtr<ResourceTicket> ResourceTicketPtr;
-
-/**
- * ResourceTicketObserver is used to observe the status of resource loading requests.
- */
-class ResourceTicketObserver
-{
-public:
-
-  /**
-   * Called when a resource loads successfully.
-   * @param[in] ticket The ticket for this resource.
-   */
-  virtual void ResourceLoadingSucceeded( const ResourceTicket& ticket ) = 0;
-
-  /**
-   * Called when a resource fails to load.
-   * @param[in] ticket The ticket for this resource.
-   */
-  virtual void ResourceLoadingFailed( const ResourceTicket& ticket ) = 0;
-
-  /**
-   * Called when a resource is uploaded to graphics memory.
-   * @param[in] ticket The ticket for this resource.
-   */
-  virtual void ResourceUploaded( const ResourceTicket& ticket ) = 0;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_TICKET_OBSERVER_H__
diff --git a/dali/internal/event/resources/resource-ticket.cpp b/dali/internal/event/resources/resource-ticket.cpp
deleted file mode 100644 (file)
index 0ebb28f..0000000
+++ /dev/null
@@ -1,171 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/resources/resource-ticket.h>
-
-// EXTERNAL INCLUDES
-#include <algorithm>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/images/image.h>
-#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/resources/resource-ticket-observer.h>
-#include <dali/internal/event/resources/resource-ticket-lifetime-observer.h>
-
-namespace // unnamed namespace
-{
-
-// predicate for std::remove_if algorithm for compressing observer list
-bool isNULL(void* ptr)
-{
-  return ptr == NULL;
-}
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-ResourceTicket::ResourceTicket( ResourceTicketLifetimeObserver& observer, unsigned int id, ResourceTypePath& typePath )
-: mLifetimeObserver( &observer ),
-  mId( id ),
-  mTypePath( typePath ),
-  mLoadingState( ResourceLoading )
-{
-}
-
-ResourceTicket::~ResourceTicket()
-{
-  // Guard to allow handle destruction after Core has been destroyed
-  if ( Stage::IsInstalled() &&
-       mLifetimeObserver )
-  {
-    mLifetimeObserver->ResourceTicketDiscarded( *this );
-  }
-}
-
-void ResourceTicket::AddObserver(ResourceTicketObserver& observer)
-{
-  mObservers.push_back(&observer);
-}
-
-void ResourceTicket::RemoveObserver(ResourceTicketObserver& observer)
-{
-  ObserverIter iter = find(mObservers.begin(), mObservers.end(), &observer);
-  DALI_ASSERT_DEBUG( mObservers.end() != iter );
-  if( mObservers.end() != iter )
-  {
-    (*iter) = NULL;
-  }
-}
-
-void ResourceTicket::LoadingSucceeded()
-{
-  DALI_ASSERT_DEBUG(mLoadingState == ResourceLoading);
-
-  mLoadingState = ResourceLoadingSucceeded;
-
-  // Using array operator as the call back out to application code might call back in
-  // and corrupt the mObservers list. Presumption is the operator gets the current address
-  // and adds an offset so a push_back() triggered reallocation should still work.
-  size_t count = mObservers.size();
-  for(size_t i = 0; i < count; i++)
-  {
-    if( mObservers[i] != NULL)
-    {
-      mObservers[i]->ResourceLoadingSucceeded(*this);
-    }
-  }
-
-  // Move NULL pointers to the end...
-  ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
-  // ...and remove them
-  mObservers.erase( endIter, mObservers.end() );
-}
-
-void ResourceTicket::LoadingFailed()
-{
-  DALI_ASSERT_DEBUG(mLoadingState == ResourceLoading);
-
-  mLoadingState = ResourceLoadingFailed;
-
-  // Using array operator as the call back out to application code might call back in
-  // and corrupt the mObservers list. Presumption is the operator gets the current address
-  // and adds an offset so a push_back() triggered reallocation should still work.
-  size_t count = mObservers.size();
-  for(size_t i = 0; i < count; i++)
-  {
-    if( mObservers[i] != NULL)
-    {
-      mObservers[i]->ResourceLoadingFailed(*this);
-    }
-  }
-
-  // Move NULL pointers to the end...
-  ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
-  // ...and remove them
-  mObservers.erase( endIter, mObservers.end() );
-}
-
-void ResourceTicket::Loading()
-{
-  mLoadingState = ResourceLoading;
-
-  // Move NULL pointers to the end...
-  ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
-  // ...and remove them
-  mObservers.erase( endIter, mObservers.end() );
-}
-
-void ResourceTicket::Uploaded()
-{
-  // Using array operator as the call back out to application code might call back in
-  // and corrupt the mObservers list. Presumption is the operator gets the current address
-  // and adds an offset so a push_back() triggered reallocation should still work.
-  size_t count = mObservers.size();
-  for(size_t i = 0; i < count; i++)
-  {
-    if( mObservers[i] != NULL)
-    {
-      mObservers[i]->ResourceUploaded(*this);
-    }
-  }
-
-  // Move NULL pointers to the end...
-  ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
-  // ...and remove them
-  mObservers.erase( endIter, mObservers.end() );
-}
-
-void ResourceTicket::StopLifetimeObservation()
-{
-  mLifetimeObserver = NULL;
-}
-
-} // namespace Internal
-
-} // namespace Dali
-
diff --git a/dali/internal/event/resources/resource-ticket.h b/dali/internal/event/resources/resource-ticket.h
deleted file mode 100644 (file)
index da510a4..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_TICKET_H__
-#define __DALI_INTERNAL_RESOURCE_TICKET_H__
-
-/*
- * 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 <dali/public-api/common/vector-wrapper.h>
-#include <dali/devel-api/common/map-wrapper.h>
-#include <dali/public-api/common/loading-state.h>
-#include <dali/public-api/object/ref-object.h>
-#include <dali/internal/event/resources/resource-type-path.h>
-#include <dali/integration-api/resource-cache.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class ResourceTicket;
-typedef IntrusivePtr<ResourceTicket> ResourceTicketPtr;
-typedef std::vector<ResourceTicketPtr> ResourceTicketContainer;
-
-class ResourceTicketObserver;
-class ResourceTicketLifetimeObserver;
-
-/**
- * @brief ResourceTicket records the lifetime of a resource loading request.
- *
- * When a resource is requested from ResourceClient, you get a ticket.
- * The state of the loading operation, can be observed using the ticket.
- * After the ticket is destroyed, the resource will be discarded.
- *
- * Multi-threading note: this class should be used in the main thread only
- * i.e. not from within Dali::Integration::Core::Render().
- */
-class ResourceTicket : public RefObject
-{
-public:
-
-  /**
-   * Create a resource request.
-   * This should only be done by the ResourceTicketRegistry.
-   * @param [in] observer The object which observes ticket lifetimes.
-   * @param [in] id A unique ID for this ticket (loading request).
-   * @param [in] typePath The resource Type & Path pair.
-   */
-  ResourceTicket( ResourceTicketLifetimeObserver& observer, unsigned int id, ResourceTypePath& typePath );
-
-  /**
-   * Retrieve the unique ID of the resource request.
-   * This can be shared with Nodes etc. which will require the resource when rendering.
-   * @return The unique ID for this request.
-   */
-  unsigned int GetId() const { return mId; }
-
-  /**
-   * Retrieve the type and path of the resource request.
-   * @return The type and path.
-   */
-  const ResourceTypePath& GetTypePath() const { return mTypePath; }
-
-  /**
-   * Query the state of the resource loading request.
-   * @return The state.
-   */
-  Dali::LoadingState GetLoadingState() const { return mLoadingState; }
-
-  /**
-   * Adds an observer.
-   * @param[in] observer The observer.
-   */
-  void AddObserver(ResourceTicketObserver& observer);
-
-  /**
-   * Removes an observer.
-   * @param[in] observer The observer.
-   */
-  void RemoveObserver(ResourceTicketObserver& observer);
-
-public: // Used by the ResourceClient
-
-  /**
-   * Called when a resource loads successfully.
-   * The ResourceTicketObservers will be notified.
-   */
-  void LoadingSucceeded();
-
-  /**
-   * Called when a resource fails to load.
-   * The ResourceTicketObservers will be notified.
-   */
-  void LoadingFailed();
-
-  /**
-   * Reset state to ResourceLoading.
-   */
-  void Loading();
-
-  /**
-   * Notification when a resource has been uploaded to GL.
-   * The ResourceTicketObservers will be notified.
-   */
-  void Uploaded();
-
-  /**
-   * Called when the ResourceTicketLifetimeObserver is being destroyed.
-   * This method should only be called during destruction of the Dali core.
-   */
-  void StopLifetimeObservation();
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ResourceTicket();
-
-private:
-
-  /**
-   * Undefined copy constructor.
-   */
-  ResourceTicket(const ResourceTicket&);
-
-  /**
-   * Undefined assignment operator.
-   */
-  ResourceTicket& operator=(const ResourceTicket& rhs);
-
-private:
-
-  ResourceTicketLifetimeObserver* mLifetimeObserver; ///< reference to the lifetime-observer; not owned
-
-  unsigned int mId;
-  ResourceTypePath mTypePath;
-
-  Dali::LoadingState mLoadingState;
-
-  // These ticket observers are not owned by the ticket.
-  // Observers must remove themselves by calling RemoveObserver e.g. during destruction.
-  typedef std::vector<ResourceTicketObserver*> ObserverContainer;
-  typedef ObserverContainer::iterator ObserverIter;
-
-  ObserverContainer mObservers;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_MANAGER_H__
diff --git a/dali/internal/event/resources/resource-type-path.cpp b/dali/internal/event/resources/resource-type-path.cpp
deleted file mode 100644 (file)
index 1204e81..0000000
+++ /dev/null
@@ -1,141 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/resources/resource-type-path.h>
-
-using namespace Dali::Integration;
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-/**
- * @brief Compare two sets of image loading parameters for equality.
- */
-inline bool AttributesEqual( ImageDimensions aDims, FittingMode::Type aScaling, SamplingMode::Type aSampling, bool aOrient, ImageDimensions bDims, FittingMode::Type bScaling, SamplingMode::Type bSampling, bool bOrient )
-{
-  return aDims     == bDims &&
-         aScaling  == bScaling &&
-         aSampling == bSampling &&
-         aOrient   == bOrient;
-}
-
-/**
- * @brief Compare two sets of image loading parameters
- * @pre The two sets are not identical.
- */
-inline bool AttributesLessAssumingNotEqual( ImageDimensions aDims, FittingMode::Type aScaling, SamplingMode::Type aSampling, bool aOrient, ImageDimensions bDims, FittingMode::Type bScaling, SamplingMode::Type bSampling, bool bOrient )
-{
-  return aDims     < bDims &&
-         aScaling  < bScaling &&
-         aSampling < bSampling &&
-         aOrient   < bOrient;
-}
-
-/**
- * Compare two resource types.
- * @return zero if the types are equal,
- *         less than zero if lhs < rhs or
- *         greater than zero if lhs > rhs
- */
-int ResourceTypeCompare(const ResourceType& lhs, const ResourceType& rhs)
-{
-  int result = 0;
-
-  if (lhs.id != rhs.id)
-  {
-    result = lhs.id > rhs.id ? 1 : -1;
-  }
-  else // lhs.id == rhs.id
-  {
-    // Cast to a derived resource type and compare...
-
-    switch (lhs.id)
-    {
-      case ResourceBitmap:
-      {
-        // compare bitmap widths & heights
-        const BitmapResourceType& lhsBitmap = static_cast<const BitmapResourceType&>(lhs);
-        const BitmapResourceType& rhsBitmap = static_cast<const BitmapResourceType&>(rhs);
-
-        if( ! AttributesEqual( lhsBitmap.size, lhsBitmap.scalingMode, lhsBitmap.samplingMode, lhsBitmap.orientationCorrection,
-                               rhsBitmap.size, rhsBitmap.scalingMode, rhsBitmap.samplingMode, rhsBitmap.orientationCorrection ) )
-        {
-          result = AttributesLessAssumingNotEqual( lhsBitmap.size, lhsBitmap.scalingMode, lhsBitmap.samplingMode, lhsBitmap.orientationCorrection,
-                                                   rhsBitmap.size, rhsBitmap.scalingMode, rhsBitmap.samplingMode, rhsBitmap.orientationCorrection );
-        }
-        // else result = 0
-        break;
-      }
-
-      case ResourceNativeImage:
-      {
-        // compare native image widths & heights
-
-        const NativeImageResourceType& lhsNativeImage = static_cast<const NativeImageResourceType&>(lhs);
-        const NativeImageResourceType& rhsNativeImage = static_cast<const NativeImageResourceType&>(rhs);
-
-        if (lhsNativeImage.imageDimensions != rhsNativeImage.imageDimensions)
-        {
-          result = lhsNativeImage.imageDimensions < rhsNativeImage.imageDimensions ? -1 : 1;
-        }
-        // else result = 0
-        break;
-      }
-
-      case ResourceTargetImage:
-      {
-        // compare bitmap widths & heights
-        const RenderTargetResourceType& lhsImage = static_cast<const RenderTargetResourceType&>(lhs);
-        const RenderTargetResourceType& rhsImage = static_cast<const RenderTargetResourceType&>(rhs);
-
-        if (lhsImage.imageDimensions != rhsImage.imageDimensions)
-        {
-          result = lhsImage.imageDimensions < rhsImage.imageDimensions ? -1 : 1;
-        }
-        // else result = 0
-        break;
-      }
-    }
-  }
-  return result;
-}
-}
-
-bool ResourceTypePath::operator<(const ResourceTypePath& rhs) const
-{
-  int typeComparison = ResourceTypeCompare(*type, *(rhs.type));
-
-  if (typeComparison != 0)
-  {
-    return (typeComparison < 0);
-  }
-  else
-  {
-    return path < rhs.path;
-  }
-}
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/event/resources/resource-type-path.h b/dali/internal/event/resources/resource-type-path.h
deleted file mode 100644 (file)
index e0d0b2c..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_TYPE_PATH_H__
-#define __DALI_INTERNAL_RESOURCE_TYPE_PATH_H__
-
-/*
- * 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <memory>
-// INTERNAL INCLUDES
-#include <dali/integration-api/resource-types.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-/**
- * A resource Type & Path pair. This is used by ResourceManager when creating tickets.
- * A new ticket will only be needed, if the same resource Type & Path has not already been requested.
- */
-class ResourceTypePath
-{
-public:
-
-  /**
-   * Create a resource Type and Path pair.
-   * @param[in] requestType The type of resource.
-   * @param[in] requestPath The path of the resource.
-   */
-  ResourceTypePath(const Integration::ResourceType& requestType,
-                   const std::string& requestPath)
-  : type(requestType.Clone()),
-    path(requestPath)
-  {
-  }
-
-  /**
-   * Copy constructor.
-   * @param[in] typePath The Type & Path to copy.
-   */
-  ResourceTypePath(const ResourceTypePath& typePath)
-  : type(typePath.type->Clone()),
-    path(typePath.path)
-  {
-  }
-
-  ~ResourceTypePath()
-  {
-    delete type;
-  }
-
-  /**
-   * Less than operator.
-   * @param[in] rhs The request to compare with.
-   */
-  bool operator<(const ResourceTypePath& rhs) const;
-
-private:
-
-  /**
-   * Undefined assignment operator.
-   * @param[in] rhs The resource request to copy.
-   */
-  ResourceTypePath& operator=(const ResourceTypePath& rhs);
-
-public:
-
-  const Integration::ResourceType* type;
-  const std::string path;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_TYPE_PATH_H__
index 8eeb572..422b028 100644 (file)
@@ -82,9 +82,6 @@ internal_src_files = \
   $(internal_src_dir)/event/rendering/renderer-impl.cpp \
   $(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-ticket.cpp \
-  $(internal_src_dir)/event/resources/resource-type-path.cpp \
   $(internal_src_dir)/event/size-negotiation/memory-pool-relayout-container.cpp \
   $(internal_src_dir)/event/size-negotiation/relayout-controller-impl.cpp \
   \
@@ -96,17 +93,10 @@ internal_src_files = \
   $(internal_src_dir)/render/common/render-tracker.cpp \
   $(internal_src_dir)/render/common/render-manager.cpp \
   $(internal_src_dir)/render/data-providers/render-data-provider.cpp \
-  $(internal_src_dir)/render/gl-resources/bitmap-texture.cpp \
   $(internal_src_dir)/render/gl-resources/context.cpp \
   $(internal_src_dir)/render/gl-resources/frame-buffer-state-cache.cpp \
-  $(internal_src_dir)/render/gl-resources/compressed-bitmap-texture.cpp \
-  $(internal_src_dir)/render/gl-resources/frame-buffer-texture.cpp \
   $(internal_src_dir)/render/gl-resources/gl-call-debug.cpp \
   $(internal_src_dir)/render/gl-resources/gpu-buffer.cpp \
-  $(internal_src_dir)/render/gl-resources/native-texture.cpp \
-  $(internal_src_dir)/render/gl-resources/gl-texture.cpp \
-  $(internal_src_dir)/render/gl-resources/texture-factory.cpp \
-  $(internal_src_dir)/render/gl-resources/texture-cache.cpp \
   $(internal_src_dir)/render/queue/render-queue.cpp \
   $(internal_src_dir)/render/renderers/render-frame-buffer.cpp \
   $(internal_src_dir)/render/renderers/render-geometry.cpp \
@@ -129,7 +119,6 @@ internal_src_files = \
   $(internal_src_dir)/update/common/scene-graph-buffers.cpp \
   $(internal_src_dir)/update/common/scene-graph-connection-change-propagator.cpp \
   $(internal_src_dir)/update/common/scene-graph-property-notification.cpp \
-  $(internal_src_dir)/update/common/texture-cache-dispatcher.cpp \
   $(internal_src_dir)/update/common/uniform-map.cpp \
   $(internal_src_dir)/update/controllers/render-message-dispatcher.cpp \
   $(internal_src_dir)/update/controllers/scene-controller-impl.cpp \
@@ -149,5 +138,4 @@ internal_src_files = \
   $(internal_src_dir)/update/render-tasks/scene-graph-render-task.cpp \
   $(internal_src_dir)/update/render-tasks/scene-graph-render-task-list.cpp \
   $(internal_src_dir)/update/rendering/scene-graph-texture-set.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-renderer.cpp \
-  $(internal_src_dir)/update/resources/resource-manager.cpp
+  $(internal_src_dir)/update/rendering/scene-graph-renderer.cpp
index ce8b89f..f85097e 100644 (file)
@@ -301,7 +301,6 @@ inline void SetupDepthBuffer( const RenderItem& item, Context& context, bool dep
 inline void ProcessRenderList(
   const RenderList& renderList,
   Context& context,
-  SceneGraph::TextureCache& textureCache,
   SceneGraph::Shader& defaultShader,
   BufferIndex bufferIndex,
   const Matrix& viewMatrix,
@@ -338,7 +337,6 @@ inline void ProcessRenderList(
 
     // Render the item
     item.mRenderer->Render( context,
-                            textureCache,
                             bufferIndex,
                             *item.mNode,
                             defaultShader,
@@ -353,7 +351,6 @@ inline void ProcessRenderList(
 
 void ProcessRenderInstruction( const RenderInstruction& instruction,
                                Context& context,
-                               SceneGraph::TextureCache& textureCache,
                                SceneGraph::Shader& defaultShader,
                                BufferIndex bufferIndex )
 {
@@ -379,7 +376,6 @@ void ProcessRenderInstruction( const RenderInstruction& instruction,
       {
         ProcessRenderList( *renderList,
                            context,
-                           textureCache,
                            defaultShader,
                            bufferIndex,
                            *viewMatrix,
index a2e4c57..b258dd6 100644 (file)
@@ -41,13 +41,11 @@ namespace Render
  * Process a render-instruction.
  * @param[in] instruction The render-instruction to process.
  * @param[in] context The GL context.
- * @param[in] textureCache The texture cache used to get textures.
  * @param[in] defaultShader The default shader.
  * @param[in] bufferIndex The current render buffer index (previous update buffer)
  */
 void ProcessRenderInstruction( const SceneGraph::RenderInstruction& instruction,
                                Context& context,
-                               SceneGraph::TextureCache& textureCache,
                                SceneGraph::Shader& defaultShader,
                                BufferIndex bufferIndex );
 
index 4a8c4d9..e9f7b93 100644 (file)
@@ -32,8 +32,6 @@
 #include <dali/internal/render/common/render-instruction-container.h>
 #include <dali/internal/render/common/render-instruction.h>
 #include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/gl-resources/frame-buffer-texture.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
 #include <dali/internal/render/queue/render-queue.h>
 #include <dali/internal/render/renderers/render-frame-buffer.h>
 #include <dali/internal/render/renderers/render-geometry.h>
@@ -59,7 +57,7 @@ typedef GeometryOwnerContainer::Iterator       GeometryOwnerIter;
 typedef OwnerContainer< Render::Sampler* >    SamplerOwnerContainer;
 typedef SamplerOwnerContainer::Iterator       SamplerOwnerIter;
 
-typedef OwnerContainer< Render::NewTexture* >   TextureOwnerContainer;
+typedef OwnerContainer< Render::Texture* >   TextureOwnerContainer;
 typedef TextureOwnerContainer::Iterator         TextureOwnerIter;
 
 typedef OwnerContainer< Render::FrameBuffer* >  FrameBufferOwnerContainer;
@@ -78,14 +76,10 @@ typedef RenderTrackerContainer::ConstIterator    RenderTrackerConstIter;
 struct RenderManager::Impl
 {
   Impl( Integration::GlAbstraction& glAbstraction,
-        Integration::GlSyncAbstraction& glSyncAbstraction,
-        LockedResourceQueue& textureUploadedQ,
-        TextureUploadedDispatcher& postProcessDispatcher )
+        Integration::GlSyncAbstraction& glSyncAbstraction )
   : context( glAbstraction ),
     glSyncAbstraction( glSyncAbstraction ),
     renderQueue(),
-    textureCache( renderQueue, postProcessDispatcher, context ),
-    textureUploadedQueue( textureUploadedQ ),
     instructions(),
     backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
     frameCount( 0 ),
@@ -138,8 +132,6 @@ struct RenderManager::Impl
   Context                       context;                  ///< holds the GL state
   Integration::GlSyncAbstraction& glSyncAbstraction;      ///< GL sync abstraction
   RenderQueue                   renderQueue;              ///< A message queue for receiving messages from the update-thread.
-  TextureCache                  textureCache;             ///< Cache for all GL textures
-  LockedResourceQueue&          textureUploadedQueue;     ///< A queue for requesting resource post processing in update thread
 
   // Render instructions describe what should be rendered during RenderManager::Render()
   // Owned by RenderManager. Update manager updates instructions for the next frame while we render the current one
@@ -170,14 +162,11 @@ struct RenderManager::Impl
 };
 
 RenderManager* RenderManager::New( Integration::GlAbstraction& glAbstraction,
-                                   Integration::GlSyncAbstraction& glSyncAbstraction,
-                                   LockedResourceQueue& textureUploadedQ )
+                                   Integration::GlSyncAbstraction& glSyncAbstraction )
 {
   RenderManager* manager = new RenderManager;
   manager->mImpl = new Impl( glAbstraction,
-                             glSyncAbstraction,
-                             textureUploadedQ,
-                             *manager );
+                             glSyncAbstraction );
   return manager;
 }
 
@@ -196,11 +185,6 @@ RenderQueue& RenderManager::GetRenderQueue()
   return mImpl->renderQueue;
 }
 
-TextureCache& RenderManager::GetTextureCache()
-{
-  return mImpl->textureCache;
-}
-
 void RenderManager::ContextCreated()
 {
   mImpl->context.GlContextCreated();
@@ -215,9 +199,6 @@ void RenderManager::ContextDestroyed()
   mImpl->context.GlContextDestroyed();
   mImpl->programController.GlContextDestroyed();
 
-  // inform texture cache
-  mImpl->textureCache.GlContextDestroyed(); // Clears gl texture ids
-
   //Inform textures
   for( TextureOwnerIter iter = mImpl->textureContainer.Begin(); iter != mImpl->textureContainer.End(); ++iter )
   {
@@ -240,11 +221,6 @@ void RenderManager::ContextDestroyed()
   }
 }
 
-void RenderManager::DispatchTextureUploaded(ResourceId request)
-{
-  mImpl->textureUploadedQueue.PushBack( request );
-}
-
 void RenderManager::SetShaderSaver( ShaderSaver& upstream )
 {
   mImpl->programController.SetShaderSaver( upstream );
@@ -268,7 +244,7 @@ void RenderManager::SetDefaultSurfaceRect(const Rect<int>& rect)
 void RenderManager::AddRenderer( Render::Renderer* renderer )
 {
   // Initialize the renderer as we are now in render thread
-  renderer->Initialize( mImpl->context, mImpl->textureCache );
+  renderer->Initialize( mImpl->context );
 
   mImpl->rendererContainer.PushBack( renderer );
 
@@ -317,13 +293,13 @@ void RenderManager::RemoveSampler( Render::Sampler* sampler )
   }
 }
 
-void RenderManager::AddTexture( Render::NewTexture* texture )
+void RenderManager::AddTexture( Render::Texture* texture )
 {
   mImpl->textureContainer.PushBack( texture );
   texture->Initialize(mImpl->context);
 }
 
-void RenderManager::RemoveTexture( Render::NewTexture* texture )
+void RenderManager::RemoveTexture( Render::Texture* texture )
 {
   DALI_ASSERT_DEBUG( NULL != texture );
 
@@ -341,12 +317,12 @@ void RenderManager::RemoveTexture( Render::NewTexture* texture )
   }
 }
 
-void RenderManager::UploadTexture( Render::NewTexture* texture, PixelDataPtr pixelData, const NewTexture::UploadParams& params )
+void RenderManager::UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
 {
   texture->Upload( mImpl->context, pixelData, params );
 }
 
-void RenderManager::GenerateMipmaps( Render::NewTexture* texture )
+void RenderManager::GenerateMipmaps( Render::Texture* texture )
 {
   texture->GenerateMipmaps( mImpl->context );
 }
@@ -388,7 +364,7 @@ void RenderManager::RemoveFrameBuffer( Render::FrameBuffer* frameBuffer )
   }
 }
 
-void RenderManager::AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int layer )
+void RenderManager::AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer )
 {
   frameBuffer->AttachColorTexture( mImpl->context, texture, mipmapLevel, layer );
 }
@@ -590,8 +566,7 @@ bool RenderManager::Render( Integration::RenderStatus& status )
 
   DALI_PRINT_RENDER_END();
 
-  // check if anything has been posted to the update thread, if IsEmpty then no update required.
-  return !mImpl->textureUploadedQueue.IsEmpty();
+  return false;
 }
 
 void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultShader )
@@ -608,8 +583,6 @@ void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultSha
     clearColor = Dali::RenderTask::DEFAULT_CLEAR_COLOR;
   }
 
-  FrameBufferTexture* offscreen = NULL;
-
   if( instruction.mFrameBuffer != 0 )
   {
     instruction.mFrameBuffer->Bind( mImpl->context );
@@ -661,11 +634,10 @@ void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultSha
 
   Render::ProcessRenderInstruction( instruction,
                                     mImpl->context,
-                                    mImpl->textureCache,
                                     defaultShader,
                                     mImpl->renderBufferIndex );
 
-  if( instruction.mRenderTracker && ( offscreen != NULL || instruction.mFrameBuffer != NULL ) )
+  if( instruction.mRenderTracker && ( instruction.mFrameBuffer != NULL ) )
   {
     // This will create a sync object every frame this render tracker
     // is alive (though it should be now be created only for
index e27d508..60c58f8 100644 (file)
@@ -21,8 +21,6 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/math/rect.h>
 #include <dali/internal/common/shader-saver.h>
-#include <dali/internal/update/resources/resource-manager-declarations.h>
-#include <dali/internal/render/common/texture-uploaded-dispatcher.h>
 #include <dali/internal/render/gl-resources/gpu-buffer.h>
 #include <dali/internal/render/renderers/render-property-buffer.h>
 #include <dali/internal/event/rendering/texture-impl.h>
@@ -52,13 +50,12 @@ class Renderer;
 struct Sampler;
 class RenderTracker;
 class Geometry;
-class NewTexture;
+class Texture;
 }
 
 namespace SceneGraph
 {
 class RenderQueue;
-class TextureCache;
 class RenderInstruction;
 class RenderInstructionContainer;
 class Shader;
@@ -68,7 +65,7 @@ class PropertyBufferDataProvider;
  * RenderManager is responsible for rendering the result of the previous "update", which
  * is provided in a RenderCommand during UpdateManager::Update().
  */
-class RenderManager : public TextureUploadedDispatcher
+class RenderManager
 {
 public:
 
@@ -79,8 +76,7 @@ public:
    * @param[out] resourcePostProcessQueue A queue for sending rendered texture ids to the update-thread.*
    */
   static RenderManager* New( Integration::GlAbstraction& glAbstraction,
-                             Integration::GlSyncAbstraction& glSyncAbstraction,
-                             LockedResourceQueue& resourcePostProcessQueue );
+                             Integration::GlSyncAbstraction& glSyncAbstraction );
 
   /**
    * Non-virtual destructor; not intended as a base class
@@ -94,13 +90,6 @@ public:
   RenderQueue& GetRenderQueue();
 
   /**
-   * Retrieve the texture cache. Messages should only be sent to this from the update thread,
-   * accessor methods should only be used from the render thread.
-   * @return The texture cache
-   */
-  TextureCache& GetTextureCache();
-
-  /**
    * @copydoc Dali::Integration::Core::ContextCreated()
    */
   void ContextCreated();
@@ -111,12 +100,6 @@ public:
   void ContextDestroyed();
 
   /**
-   * Dispatch requests onto the postProcessResourcesQueue
-   * @param[in] resource The Id of the resource to dispatch
-   */
-  virtual void DispatchTextureUploaded( ResourceId resource );
-
-  /**
    * Set the upstream interface for compiled shader binaries to be sent back to for eventual
    * caching and saving.
    * @param[in] upstream The abstract interface to send any received ShaderDatas onwards to..
@@ -269,13 +252,13 @@ public:
    * Adds a texture to the render manager
    * @param[in] texture The texture to add
    */
-  void AddTexture( Render::NewTexture* texture );
+  void AddTexture( Render::Texture* texture );
 
   /**
    * Removes a texture from the render manager
    * @param[in] texture The texture to remove
    */
-  void RemoveTexture( Render::NewTexture* texture );
+  void RemoveTexture( Render::Texture* texture );
 
   /**
    * Uploads data to an existing texture
@@ -283,13 +266,13 @@ public:
    * @param[in] pixelData The pixel data object
    * @param[in] params The parameters for the upload
    */
-  void UploadTexture( Render::NewTexture* texture, PixelDataPtr pixelData, const NewTexture::UploadParams& params );
+  void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
 
   /**
    * Generates mipmaps for a given texture
    * @param[in] texture The texture
    */
-  void GenerateMipmaps( Render::NewTexture* texture );
+  void GenerateMipmaps( Render::Texture* texture );
 
   /**
    * Adds a framebuffer to the render manager
@@ -310,7 +293,7 @@ public:
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
    */
-  void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int layer );
+  void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer );
 
   /**
    * Adds a render tracker to the RenderManager. RenderManager takes ownership of the
diff --git a/dali/internal/render/common/texture-uploaded-dispatcher.h b/dali/internal/render/common/texture-uploaded-dispatcher.h
deleted file mode 100644 (file)
index 5c9c622..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_POST_PROCESS_RESOURCE_DISPATCHER_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_POST_PROCESS_RESOURCE_DISPATCHER_H__
-
-/*
- * 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 <dali/integration-api/resource-declarations.h>
-
-namespace Dali
-{
-namespace Internal
-{
-typedef Integration::ResourceId ResourceId;
-
-namespace SceneGraph
-{
-
-/**
- * Interface which offers a dispatch mechanism for uploaded notifications on textures
- * Should be offered by a Render Thread object
- */
-class TextureUploadedDispatcher
-{
-public:
-  /**
-   * Dispatch a post process resource uploaded request to the Update thread
-   * @param[in] resource A post process request
-   */
-  virtual void DispatchTextureUploaded( ResourceId resource ) = 0;
-
-protected:
-  /**
-   * Virtual destructor
-   */
-  virtual ~TextureUploadedDispatcher(){}
-};
-
-
-} // namespaces
-}
-}
-
-
-#endif // __DALI_INTERNAL_SCENE_GRAPH_POST_PROCESS_RESOURCE_DISPATCHER_H__
index 96d1d0c..037e9c7 100644 (file)
@@ -59,9 +59,9 @@ RenderDataProvider::Samplers& RenderDataProvider::GetSamplers()
   return mSamplers;
 }
 
-std::vector<Render::NewTexture*>& RenderDataProvider::GetNewTextures()
+std::vector<Render::Texture*>& RenderDataProvider::GetTextures()
 {
-  return mNewTextures;
+  return mTextures;
 }
 
 } // SceneGraph
index 3e3f5e2..596b72e 100644 (file)
@@ -95,16 +95,16 @@ public:
   Samplers& GetSamplers();
 
   /**
-   * Returns the list of NewTextures
-   * @return The list of NewTextures
+   * Returns the list of Textures
+   * @return The list of Textures
    */
-  std::vector<Render::NewTexture*>& GetNewTextures();
+  std::vector<Render::Texture*>& GetTextures();
 
 private:
 
   const UniformMapDataProvider*       mUniformMapDataProvider;
   Shader*                             mShader;
-  std::vector<Render::NewTexture*>    mNewTextures;
+  std::vector<Render::Texture*>    mTextures;
   Samplers                            mSamplers;
 
   // Give Renderer access to our private data to reduce copying vectors on construction.
diff --git a/dali/internal/render/gl-resources/bitmap-texture.cpp b/dali/internal/render/gl-resources/bitmap-texture.cpp
deleted file mode 100644 (file)
index 58d80c2..0000000
+++ /dev/null
@@ -1,441 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/render/gl-resources/bitmap-texture.h>
-
-// EXTERNAL INCLUDES
-#include <cstring>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/images/buffer-image.h> // For PixelBuffer
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/common/performance-monitor.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-BitmapTexture::BitmapTexture(
-  Integration::Bitmap* const bitmap,
-  const Integration::Bitmap::PackedPixelsProfile * const bitmapPackedPixelsProfile,
-  Context& context,
-  ResourcePolicy::Discardable policy)
-: Texture( context,
-           bitmapPackedPixelsProfile->GetBufferWidth(),
-           bitmapPackedPixelsProfile->GetBufferHeight(),
-           bitmap->GetImageWidth(),
-           bitmap->GetImageHeight()),
-  mBitmap(bitmap),
-  mPixelFormat(bitmap->GetPixelFormat()),
-  mDiscardPolicy(policy),
-  mClearPixels(false)
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  DALI_LOG_SET_OBJECT_STRING(this, DALI_LOG_GET_OBJECT_STRING(bitmap));
-}
-
-BitmapTexture::BitmapTexture(
-  unsigned int width,
-  unsigned int height,
-  Pixel::Format pixelFormat,
-  bool clearPixels,
-  Context& context,
-  ResourcePolicy::Discardable policy)
-: Texture( context,
-           width, height,
-           width, height),
-  mBitmap(NULL),
-  mPixelFormat( pixelFormat ),
-  mDiscardPolicy(policy),
-  mClearPixels(clearPixels)
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-}
-
-BitmapTexture::~BitmapTexture()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-
-  // GlCleanup() should already have been called by TextureCache ensuring the resource is destroyed
-  // on the render thread. (And avoiding a potentially problematic virtual call in the destructor)
-}
-
-bool BitmapTexture::HasAlphaChannel() const
-{
-  return Pixel::HasAlpha(mPixelFormat);
-}
-
-bool BitmapTexture::IsFullyOpaque() const
-{
-  if( mBitmap )
-  {
-    return mBitmap->IsFullyOpaque();
-  }
-  else
-  {
-    return ! HasAlphaChannel(); // Todo: amalgamate updated bitmap's IsFullyOpaque()
-  }
-}
-
-// Bitmap buffer has been changed. Upload changes to GPU.
-void BitmapTexture::AreaUpdated( const RectArea& updateArea, const unsigned char* pixels )
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::Verbose, "BitmapTexture::AreaUpdated()\n");
-
-  GLenum pixelFormat   = GL_RGBA;
-  GLenum pixelDataType = GL_UNSIGNED_BYTE;
-  Integration::ConvertToGlFormat(mPixelFormat, pixelDataType, pixelFormat);
-
-  mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );
-
-  mContext.Bind2dTexture(mId);
-
-  if( ! updateArea.IsEmpty() )
-  {
-    mContext.PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); // We always use tightly packed data
-    DALI_LOG_INFO( Debug::Filter::gImage, Debug::General, "Update x:%d y:%d w:%d h:%d\n",
-                   updateArea.x, updateArea.y, updateArea.width ,updateArea.height );
-
-    const unsigned int pitchPixels = mWidth;
-    const unsigned int pixelDepth = Dali::Pixel::GetBytesPerPixel( mPixelFormat );
-
-    // If the width of the source update area is the same as the pitch, then can
-    // copy the contents in a single contiguous TexSubImage call.
-    if(updateArea.x == 0 && updateArea.width == pitchPixels)
-    {
-      pixels += updateArea.y * pitchPixels * pixelDepth;
-      mContext.TexSubImage2D( GL_TEXTURE_2D,0, updateArea.x, updateArea.y,
-                              updateArea.width, updateArea.height,
-                              pixelFormat, pixelDataType, pixels );
-    }
-    else
-    {
-      // Otherwise the source buffer needs to be copied line at a time, as OpenGL ES
-      // does not support source strides. (no GL_UNPACK_ROW_LENGTH supported)
-      unsigned int yBottom = updateArea.y + updateArea.height;
-      pixels += (updateArea.y * pitchPixels + updateArea.x) * pixelDepth;
-
-      for(unsigned int y = updateArea.y; y < yBottom; y++)
-      {
-        mContext.TexSubImage2D( GL_TEXTURE_2D,0, updateArea.x, y,
-                                updateArea.width, 1,
-                                pixelFormat, pixelDataType, pixels );
-        pixels += pitchPixels * pixelDepth;
-      }
-    }
-
-    INCREASE_BY( PerformanceMonitor::TEXTURE_DATA_UPLOADED,
-                 updateArea.Area()* GetBytesPerPixel( mPixelFormat ));
-  }
-}
-
-void BitmapTexture::AssignBitmap( bool generateTexture, const unsigned char* pixels )
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::Verbose, "BitmapTexture::AssignBitmap()\n");
-
-  GLenum pixelFormat = GL_RGBA;
-  GLenum pixelDataType = GL_UNSIGNED_BYTE;
-
-  if( generateTexture )
-  {
-    mContext.GenTextures(1, &mId);
-  }
-  DALI_ASSERT_DEBUG( mId != 0 );
-
-  mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );
-  mContext.Bind2dTexture(mId);
-  Integration::ConvertToGlFormat(mPixelFormat, pixelDataType, pixelFormat);
-
-  mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1); // We always use tightly packed data
-  mContext.TexImage2D(GL_TEXTURE_2D, 0, pixelFormat, mWidth, mHeight, 0, pixelFormat, pixelDataType, pixels);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
-  // If the resource policy is to discard on upload then release buffer
-  DiscardBitmapBuffer();
-
-  if( pixels != NULL )
-  {
-    INCREASE_BY( PerformanceMonitor::TEXTURE_DATA_UPLOADED, GetBytesPerPixel(mPixelFormat) * mWidth * mHeight );
-  }
-}
-
-void BitmapTexture::Update( Integration::Bitmap* bitmap )
-{
-  DALI_LOG_INFO( Debug::Filter::gGLResource, Debug::General, "BitmapTexture::Update(bitmap:%p )\n", bitmap );
-  DALI_ASSERT_DEBUG( bitmap != 0 );
-  if( !bitmap )
-  {
-    DALI_LOG_ERROR( "Passed a null bitmap to update this bitmap texture.\n" );
-    return;
-  }
-
-  // Only Packed-pixel bitmaps are ever associated with BitmapTextures, so we should never be passed any other kind:
-  const Integration::Bitmap::PackedPixelsProfile * const bitmapPackedPixels = bitmap->GetPackedPixelsProfile();
-  DALI_ASSERT_DEBUG(bitmapPackedPixels);
-  if( !bitmapPackedPixels )
-  {
-    ///! This should never happen.
-    DALI_LOG_ERROR("Passed an incompatible bitmap type to update this bitmap texture.\n");
-    return;
-  }
-  mBitmap = bitmap;
-
-  const unsigned char* pixels = mBitmap->GetBuffer();
-
-  // We should never have null pixel data here - resource manager has deliberately loaded/reloaded data
-
-  DALI_ASSERT_DEBUG( pixels != NULL );
-
-  if( NULL == pixels )
-  {
-    DALI_LOG_ERROR("BitmapTexture::Upload() - Bitmap has no pixel data.\n");
-  }
-  else if( mId != 0 )
-  {
-    if( mImageWidth == mBitmap->GetImageWidth() &&
-        mImageHeight == mBitmap->GetImageHeight() &&
-        mWidth  == bitmapPackedPixels->GetBufferWidth() &&
-        mHeight == bitmapPackedPixels->GetBufferHeight() &&
-        mPixelFormat == mBitmap->GetPixelFormat() ) // and size hasn't changed
-    {
-      RectArea area(0, 0, mImageWidth, mImageHeight);  // just update whole texture
-      AreaUpdated( area, pixels );
-      DiscardBitmapBuffer();
-    }
-    else // Otherwise, reload the pixel data
-    {
-      mImageWidth  = mBitmap->GetImageWidth();
-      mImageHeight = mBitmap->GetImageHeight();
-      mWidth       = bitmapPackedPixels->GetBufferWidth();
-      mHeight      = bitmapPackedPixels->GetBufferHeight();
-      mPixelFormat = mBitmap->GetPixelFormat();
-
-      AssignBitmap( false, pixels );
-    }
-  }
-}
-
-void BitmapTexture::Update( Integration::Bitmap* srcBitmap, std::size_t xOffset, std::size_t yOffset )
-{
-  if( NULL != srcBitmap )
-  {
-    Update( srcBitmap->GetBuffer(), srcBitmap->GetImageWidth(), srcBitmap->GetImageHeight(),
-            srcBitmap->GetPixelFormat(), xOffset, yOffset);
-  }
-}
-
-void BitmapTexture::Update( PixelData* srcPixelData, std::size_t xOffset, std::size_t yOffset )
-{
-  if( NULL != srcPixelData )
-  {
-    Update( srcPixelData->GetBuffer(), srcPixelData->GetWidth(), srcPixelData->GetHeight(),
-            srcPixelData->GetPixelFormat(), xOffset, yOffset);
-  }
-}
-
-void BitmapTexture::Update( const unsigned char* pixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat, std::size_t xOffset, std::size_t yOffset )
-{
-
-  GLenum pixelGLFormat = GL_RGBA;
-  GLenum pixelDataType = GL_UNSIGNED_BYTE;
-  Integration::ConvertToGlFormat( mPixelFormat, pixelDataType, pixelGLFormat );
-
-  if( !mId )
-  {
-    mContext.GenTextures( 1, &mId );
-
-    mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );
-    mContext.Bind2dTexture( mId );
-    mContext.PixelStorei( GL_UNPACK_ALIGNMENT, 1 );
-
-    mContext.TexImage2D( GL_TEXTURE_2D, 0, pixelGLFormat, mWidth, mHeight, 0, pixelGLFormat, pixelDataType, NULL );
-    mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-    mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
-  }
-  else
-  {
-    mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );
-    mContext.Bind2dTexture( mId );
-    mContext.PixelStorei( GL_UNPACK_ALIGNMENT, 1 );
-  }
-
-#if DALI_GLES_VERSION >= 30
-  // For GLES 3.0, uploading sub-image with different format is a valid operation.
-  Integration::ConvertToGlFormat( pixelFormat, pixelDataType, pixelGLFormat );
-#else
-  // Allows RGB888 source bitmap to be added to RGBA8888 texture, need to convert the bitmap format manually.
-  if(pixelFormat == Pixel::RGB888 && mPixelFormat == Pixel::RGBA8888 )
-  {
-    std::size_t size = width * height;
-
-    Vector<PixelBuffer> tempBuffer;
-    tempBuffer.Reserve( size*4u );
-    PixelBuffer* data = tempBuffer.Begin();
-
-    for( std::size_t i=0u; i<size; i++ )
-    {
-      data[i*4u] = pixels[i*3u];
-      data[i*4u+1] = pixels[i*3u+1];
-      data[i*4u+2] = pixels[i*3u+2];
-      data[i*4u+3] = 0xFF;
-    }
-
-    mContext.TexSubImage2D( GL_TEXTURE_2D, 0,
-                            xOffset, yOffset,
-                            width, height,
-                            pixelGLFormat, pixelDataType,
-                            data );
-
-    return;
-  }
-#endif
-
-  mContext.TexSubImage2D( GL_TEXTURE_2D, 0,
-                          xOffset, yOffset,
-                          width, height,
-                          pixelGLFormat, pixelDataType,
-                          pixels );
-}
-
-void BitmapTexture::UpdateArea( const RectArea& updateArea )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "BitmapTexture::UpdateArea()\n");
-
-  if( mBitmap != 0 )
-  {
-    const unsigned char* pixels = mBitmap->GetBuffer();
-
-    // Pixel data could be null if we've uploaded to GL and discarded the data.
-
-    if( NULL != pixels )
-    {
-      if( mId ) // If the texture is already bound
-      {
-        if( updateArea.IsEmpty() )
-        {
-          RectArea area;
-          area.x = 0;
-          area.y = 0;
-          area.width = mImageWidth;
-          area.height = mImageHeight;
-          AreaUpdated( area, pixels );
-        }
-        else
-        {
-          AreaUpdated( updateArea, pixels );
-        }
-      }
-    }
-  }
-}
-
-bool BitmapTexture::UpdateOnCreate()
-{
-  return true;
-}
-
-bool BitmapTexture::CreateGlTexture()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  DALI_LOG_INFO(Debug::Filter::gImage, Debug::Verbose, "BitmapTexture::CreateGlTexture() Bitmap: %s\n", DALI_LOG_GET_OBJECT_C_STR(this));
-
-  if( mBitmap )
-  {
-    const unsigned char* pixels = mBitmap->GetBuffer();
-
-    // pixel data could be NULL here if we've had a context loss and we previously discarded
-    // the pixel data on the previous upload. If it is null, then we shouldn't generate a
-    // new GL Texture; leaving mId as zero. Eventually, the bitmap will get reloaded,
-    // and pixels will become non-null.
-
-    if( NULL != pixels )
-    {
-      AssignBitmap( true, pixels );
-      DiscardBitmapBuffer();
-    }
-  }
-  else
-  {
-    const unsigned char* pixels = NULL;
-    Dali::Vector<unsigned char> pixelData; // Okay to create outside branch as empty vector has no heap allocation.
-    if( true == mClearPixels )
-    {
-      unsigned int size = mWidth * mHeight * Pixel::GetBytesPerPixel( mPixelFormat );
-      pixelData.Resize( size, 0 );
-      pixels = &pixelData[0];
-    }
-    AssignBitmap( true, pixels );
-  }
-
-  return mId != 0;
-}
-
-bool BitmapTexture::Init()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  // mBitmap should be initialized by now
-  return (mBitmap != 0);
-}
-
-unsigned int BitmapTexture::GetWidth() const
-{
-  unsigned int width = mWidth;
-  if( mBitmap )
-  {
-    width = mBitmap->GetImageWidth();
-  }
-  return width;
-}
-
-unsigned int BitmapTexture::GetHeight() const
-{
-  unsigned int height = mHeight;
-  if( mBitmap )
-  {
-    height = mBitmap->GetImageHeight();
-  }
-  return height;
-}
-
-void BitmapTexture::DiscardBitmapBuffer()
-{
-  DALI_LOG_INFO(Debug::Filter::gImage, Debug::General, "BitmapTexture::DiscardBitmapBuffer() DiscardPolicy: %s\n", mDiscardPolicy == ResourcePolicy::OWNED_DISCARD?"DISCARD":"RETAIN");
-
-  if( ResourcePolicy::OWNED_DISCARD == mDiscardPolicy )
-  {
-    DALI_LOG_INFO(Debug::Filter::gImage, Debug::General, "  Discarding bitmap\n");
-    if ( mBitmap )
-    {
-      mBitmap->DiscardBuffer();
-    }
-  }
-}
-
-
-} //namespace Internal
-
-} //namespace Dali
diff --git a/dali/internal/render/gl-resources/bitmap-texture.h b/dali/internal/render/gl-resources/bitmap-texture.h
deleted file mode 100644 (file)
index 2a65bf4..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-#ifndef __DALI_INTERNAL_BITMAP_TEXTURE_H__
-#define __DALI_INTERNAL_BITMAP_TEXTURE_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 <stdint.h> // for uint32_t
-
-// INTERNAL INCLUDES
-#include <dali/internal/common/message.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class BitmapTexture;
-typedef IntrusivePtr<BitmapTexture> BitmapTexturePointer;
-
-/**
- *
- * Texture class.
- * If you want to load a file to a BitmapTexture use
- * TextureManager::GetTexture()
- *
- */
-class BitmapTexture : public Texture
-{
-public:
-  /**
-   * Constructor
-   * Creates a new texture object from a Bitmap
-   * @param[in] bitmap The Bitmap
-   * @param[in] bitmapPackedPixelsProfile The Bitmap features related to an addressable array of raw pixel data
-   * @param     context The GL context
-   */
-  BitmapTexture(Integration::Bitmap* const bitmap, const Integration::Bitmap::PackedPixelsProfile * const bitmapPackedPixelsProfile, Context& context, ResourcePolicy::Discardable discardPolicy);
-
-  /**
-   * Constructor
-   * Creates a new texture object
-   * @param[in] width width in pixels
-   * @param[in] height height in pixels
-   * @param[in] pixelFormat pixel format
-   * @param[in] clearPixels True if the pixel data should be cleared before gl texture creation
-   * @param[in] context Dali context
-   */
-  BitmapTexture( unsigned int width, unsigned int height, Pixel::Format pixelFormat,
-                 bool clearPixels, Context& context, ResourcePolicy::Discardable discardPolicy );
-
-  /**
-   * Destructor.
-   */
-  virtual ~BitmapTexture();
-
-  /**
-   * Retrieve the bitmap
-   * @return The bitmap or NULL if already discarded
-   */
-  Integration::Bitmap* GetBitmap() { return mBitmap.Get(); }
-
-public:
-
-  /**
-   * @copydoc Texture::Init
-   */
-  virtual bool Init();
-
-  /**
-   * @copydoc Texture::GetWidth
-   */
-  virtual unsigned int GetWidth() const;
-
-  /**
-   * @copydoc Texture::GetHeight
-   */
-  virtual unsigned int GetHeight() const;
-
-  /**
-   * @copydoc Texture::HasAlphaChannel
-   */
-  virtual bool HasAlphaChannel() const;
-
-  /**
-   * @copydoc Texture::IsFullyOpaque
-   */
-  virtual bool IsFullyOpaque() const;
-
-  /**
-   * Replace current bitmap with a fresh one, for instance after a Bitmap has
-   * been reloaded.
-   * @param[in] bitmap The new bitmap
-   */
-  virtual void Update( Integration::Bitmap* bitmap );
-
-  /**
-   * Update part of the texture with a different bitmap
-   * @param[in] srcBitmap The bitmap to copy from
-   * @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
-   */
-  virtual void Update( Integration::Bitmap* srcBitmap, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Update part of the texture with a pixel buffer
-   * @param[in] srcPixelData The pixel data to copy from
-   * @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
-   */
-  virtual void Update( PixelData* srcPixelData, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Bitmap area has been modified - update the texture appropriately.
-   * @pre The bitmap hasn't been discarded (should be external type)
-   * @param[in] area The updated area
-   */
-  virtual void UpdateArea( const RectArea& area );
-
-  /**
-   * @return Return true if the texture should be updated on GL texture creation.
-   */
-  virtual bool UpdateOnCreate();
-
-protected:
-  /**
-   * @copydoc Texture::CreateGlTexture
-   */
-  virtual bool CreateGlTexture();
-
-private:
-
-  /**
-   * Uploads changes to GPU after Bitmap buffer has changed.
-   * @param [in] updateArea area which changed
-   * @param[in] pixels The pixel data
-   */
-  void AreaUpdated( const RectArea& updateArea, const unsigned char* pixels );
-
-  /**
-   * Assigns the bitmap data to an OpenGL texture
-   * Creates a new texture object and copies
-   * the image data held in the pixels parameter
-   * @pre The texture has to have a width/height that is a power of 2.
-   * @param[in] generateTexture True if we should generate a GL texture id
-   * @param[in] pixels The pixel data
-   */
-  void AssignBitmap( bool generateTexture, const unsigned char* pixels );
-
-  /**
-   * If the discard policy is not RETAIN, then discards the bitmap's pixel buffer
-   */
-  void DiscardBitmapBuffer();
-
-  /**
-   * Update part of the texture.
-   * @param [in] pixels The pixel buffer.
-   * @param [in] width  The buffer width in pixels
-   * @param [in] height The buffer height in pixels
-   * @param [in] pixelFormat The pixel format
-   * @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 Update( const unsigned char* pixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat, std::size_t xOffset, std::size_t yOffset );
-
-private:
-  Integration::BitmapPtr      mBitmap;            ///< The Bitmap the Texture was created from (may be NULL)
-  Pixel::Format               mPixelFormat;       ///< Pack pixel format into bitfield
-  ResourcePolicy::Discardable mDiscardPolicy;     ///< The bitmap discard policy
-  bool                        mClearPixels;       ///< true if initial texture should be cleared on creation
-
-  // Changes scope, should be at end of class
-  DALI_LOG_OBJECT_STRING_DECLARATION;
-};
-
-}  //namespace Internal
-
-} //namespace Dali
-
-#endif //__DALI_INTERNAL_BITMAP_TEXTURE_H__
diff --git a/dali/internal/render/gl-resources/compressed-bitmap-texture.cpp b/dali/internal/render/gl-resources/compressed-bitmap-texture.cpp
deleted file mode 100644 (file)
index 3ec72db..0000000
+++ /dev/null
@@ -1,198 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/render/gl-resources/compressed-bitmap-texture.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/common/performance-monitor.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-CompressedBitmapTexture::CompressedBitmapTexture(Internal::BitmapCompressed* const bitmap, Context& context, ResourcePolicy::Discardable /*discardPolicy*/)
-: Texture(context,
-          bitmap->GetImageWidth(),
-          bitmap->GetImageHeight(),
-          bitmap->GetImageWidth(),
-          bitmap->GetImageHeight()),
-  mBitmap(bitmap),
-  mPixelFormat( bitmap->GetPixelFormat() )
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  DALI_LOG_SET_OBJECT_STRING(this, DALI_LOG_GET_OBJECT_STRING(bitmap));
-}
-
-CompressedBitmapTexture::~CompressedBitmapTexture()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  // GlCleanup() should already have been called by TextureCache ensuring the resource is destroyed
-  // on the render thread. (And avoiding a potentially problematic virtual call in the destructor)
-}
-
-bool CompressedBitmapTexture::HasAlphaChannel() const
-{
-  return Pixel::HasAlpha(mPixelFormat);
-}
-
-bool CompressedBitmapTexture::IsFullyOpaque() const
-{
-  if( mBitmap )
-  {
-    return mBitmap->IsFullyOpaque();
-  }
-  else
-  {
-    return ! HasAlphaChannel(); // Todo: amalgamate updated bitmap's IsFullyOpaque()
-  }
-}
-
-
-void CompressedBitmapTexture::AssignBitmap( bool generateTexture, const unsigned char* const pixels, const size_t bufferSize )
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::Verbose, "CompressedBitmapTexture::AssignBitmap()\n");
-
-  if( generateTexture )
-  {
-    mContext.GenTextures(1, &mId);
-  }
-  DALI_ASSERT_DEBUG( mId != 0 );
-
-  mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );
-  mContext.Bind2dTexture(mId);
-
-  GLenum pixelFormat = GL_RGBA;
-  GLenum pixelDataType = GL_UNSIGNED_BYTE;
-  Integration::ConvertToGlFormat(mPixelFormat, pixelDataType, pixelFormat);
-
-  mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1); // We always use tightly packed data
-  mContext.CompressedTexImage2D(GL_TEXTURE_2D, 0, pixelFormat, mWidth, mHeight, 0, bufferSize, pixels);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
-}
-
-void CompressedBitmapTexture::Update( Integration::Bitmap* bitmap )
-{
-  DALI_ASSERT_DEBUG(bitmap);
-  DALI_ASSERT_DEBUG(mImageWidth == mWidth && mImageHeight == mHeight);
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "CompressedBitmapTexture::Update(bitmap:%p )\n", bitmap);
-
-  if( !bitmap )
-  {
-    DALI_LOG_ERROR( "Passed a null bitmap to update this compressed bitmap texture.\n" );
-    return;
-  }
-
-  Internal::BitmapCompressed * const compressedBitmap = dynamic_cast<Dali::Internal::BitmapCompressed*>( bitmap );
-  if( compressedBitmap == 0 )
-  {
-    DALI_LOG_ERROR("CompressedBitmapTexture was passed a non-compressed bitmap to update with.\n");
-    return;
-  }
-  mBitmap = compressedBitmap;
-
-  const unsigned char * const pixels = mBitmap->GetBuffer();
-
-  DALI_ASSERT_DEBUG(pixels != NULL);
-
-  if ( NULL == pixels )
-  {
-    DALI_LOG_ERROR("Bitmap has no data\n");
-  }
-  else
-  {
-    mImageWidth  = mBitmap->GetImageWidth();
-    mImageHeight = mBitmap->GetImageHeight();
-    mWidth       = mImageWidth;
-    mHeight      = mImageHeight;
-    mPixelFormat = mBitmap->GetPixelFormat();
-
-    if ( mId ) // If the texture is already bound
-    {
-      AssignBitmap( false, pixels, mBitmap->GetBufferSize() );
-    }
-  }
-}
-
-bool CompressedBitmapTexture::UpdateOnCreate()
-{
-  return true;
-}
-
-bool CompressedBitmapTexture::CreateGlTexture()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  DALI_LOG_INFO(Debug::Filter::gImage, Debug::Verbose, "Bitmap: %s\n", DALI_LOG_GET_OBJECT_C_STR(this));
-
-  if( mBitmap )
-  {
-    const unsigned char* pixels = mBitmap->GetBuffer();
-
-    DALI_ASSERT_DEBUG(pixels != NULL);
-
-    if( NULL != pixels )
-    {
-      AssignBitmap( true, pixels, mBitmap->GetBufferSize() );
-      mBitmap->DiscardBuffer();
-    }
-  }
-  else
-  {
-    AssignBitmap( true, NULL, 0 );
-  }
-
-  return mId != 0;
-}
-
-bool CompressedBitmapTexture::Init()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  // mBitmap should be initialized by now
-  return (mBitmap != 0);
-}
-
-unsigned int CompressedBitmapTexture::GetWidth() const
-{
-  unsigned int width = mWidth;
-  if( mBitmap )
-  {
-    width = mBitmap->GetImageWidth();
-  }
-  return width;
-}
-
-unsigned int CompressedBitmapTexture::GetHeight() const
-{
-  unsigned int height = mHeight;
-  if( mBitmap )
-  {
-    height = mBitmap->GetImageHeight();
-  }
-  return height;
-}
-
-} //namespace Internal
-
-} //namespace Dali
diff --git a/dali/internal/render/gl-resources/compressed-bitmap-texture.h b/dali/internal/render/gl-resources/compressed-bitmap-texture.h
deleted file mode 100644 (file)
index f9ea9c5..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef __DALI_INTERNAL_COMPRESSED_BITMAP_TEXTURE_H__
-#define __DALI_INTERNAL_COMPRESSED_BITMAP_TEXTURE_H__
-
-/*
- * 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-#include <stdint.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/buffer-image.h>
-#include <dali/internal/common/message.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/internal/event/images/bitmap-compressed.h>
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class CompressedBitmapTexture;
-typedef IntrusivePtr<CompressedBitmapTexture> CompressedBitmapTexturePointer;
-
-/**
- * Compressed Texture class.
- * If you want to load a file to a CompressedBitmapTexture use
- * TextureManager::GetTexture()
- * Compressed textures differ from ordinary ones in that their in-memory
- * representation cannot be inspected at a pixel level by simple pointer
- * arithmetic and in that they cannot be partially updated.
- */
-class CompressedBitmapTexture : public Texture
-{
-public:
-  /**
-   * Constructor
-   * Creates a new texture object from a Bitmap
-   * @param[in] bitmap The Bitmap
-   * @param[in] context The GL context
-   * @param[in] discardPolicy The discard policy
-   */
-  CompressedBitmapTexture( Internal::BitmapCompressed* const bitmap, Context& context, ResourcePolicy::Discardable discardPolicy );
-
-  /**
-   * Destructor.
-   */
-  virtual ~CompressedBitmapTexture();
-
-public:
-  /**
-   * @copydoc Texture::Init
-   */
-  virtual bool Init();
-
-  /**
-   * @copydoc Texture::GetWidth
-   */
-  virtual unsigned int GetWidth() const;
-
-  /**
-   * @copydoc Texture::GetHeight
-   */
-  virtual unsigned int GetHeight() const;
-
-  /**
-   * @copydoc Texture::HasAlphaChannel
-   */
-  virtual bool HasAlphaChannel() const;
-
-  /**
-   * @copydoc Texture::IsFullyOpaque
-   * Always returns false as we can't know what is going on inside the encoded pixel data. ///!Todo: Revise this decision: Paul, didn't you want the opposite assumption?
-   */
-  virtual bool IsFullyOpaque() const;
-
-  /**
-   * Bitmap has been reloaded - update the texture appropriately.
-   * @param[in] bitmap The new bitmap
-   */
-  virtual void Update( Integration::Bitmap* bitmap );
-
-  /**
-   * @return Return true if the texture should be updated on GL texture creation.
-   */
-  virtual bool UpdateOnCreate();
-
-protected:
-  /**
-   * @copydoc Texture::CreateGlTexture
-   */
-  virtual bool CreateGlTexture();
-
-private:
-
-  /**
-   * Assigns the bitmap data to an OpenGL texture
-   * Creates a new texture object and copies
-   * the image data held in the pixels parameter
-   * @param[in] generateTexture True if we should generate a GL texture id
-   * @param[in] pixels The pixel data
-   */
-  void AssignBitmap( bool generateTexture, const unsigned char* pixels, const size_t bufferSize );
-
-private:
-  Internal::BitmapCompressedPtr mBitmap;      ///< The Bitmap the Texture was created from (may be NULL)
-  Pixel::Format  mPixelFormat;
-
-  // Changes scope, should be at end of class
-  DALI_LOG_OBJECT_STRING_DECLARATION;
-};
-} //namespace Internal
-} //namespace Dali
-
-#endif //__DALI_INTERNAL_COMPRESSED_BITMAP_TEXTURE_H__
diff --git a/dali/internal/render/gl-resources/frame-buffer-texture.cpp b/dali/internal/render/gl-resources/frame-buffer-texture.cpp
deleted file mode 100644 (file)
index 5a4a5f4..0000000
+++ /dev/null
@@ -1,258 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/render/gl-resources/frame-buffer-texture.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/native-image-interface.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
-#include <dali/integration-api/debug.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-FrameBufferTexture::FrameBufferTexture(unsigned int width, unsigned int height, Context& context)
-: Texture( context,
-           width, height ),
-  mFrameBufferName(0),
-  mRenderBufferName(0),
-  mStencilBufferName(0),
-  mPixelFormat(Pixel::RGBA8888),
-  mBufferFormat(RenderBuffer::COLOR),
-  mNativeImage(NULL)
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-
-}
-
-FrameBufferTexture::FrameBufferTexture(unsigned int width, unsigned int height, Pixel::Format pixelFormat, Context& context)
-: Texture( context,
-           width, height ),
-  mFrameBufferName(0),
-  mRenderBufferName(0),
-  mStencilBufferName(0),
-  mPixelFormat( pixelFormat ),
-  mBufferFormat(RenderBuffer::COLOR),
-  mNativeImage(NULL)
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-
-}
-
-FrameBufferTexture::FrameBufferTexture(unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat, Context& context)
-: Texture( context,
-           width, height ),
-  mFrameBufferName(0),
-  mRenderBufferName(0),
-  mStencilBufferName(0),
-  mPixelFormat( pixelFormat ),
-  mBufferFormat( bufferFormat ),
-  mNativeImage(NULL)
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-}
-
-FrameBufferTexture::FrameBufferTexture( NativeImageInterfacePtr nativeImage, Context& context )
-: Texture( context,
-           nativeImage->GetWidth(), nativeImage->GetHeight() ),
-  mFrameBufferName(0),
-  mRenderBufferName(0),
-  mStencilBufferName(0),
-  mPixelFormat( Pixel::RGBA8888 ), // Not really used for nativeImage
-  mBufferFormat(RenderBuffer::COLOR_DEPTH),
-  mNativeImage( nativeImage )
-{
-  DALI_LOG_INFO( Debug::Filter::gImage, Debug::General, "NativeFrameBufferTexture created 0x%x\n", &nativeImage );
-}
-
-FrameBufferTexture::~FrameBufferTexture()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  // GlCleanup() should already have been called by TextureCache ensuring the resource is destroyed
-  // on the render thread. (And avoiding a potentially problematic virtual call in the destructor)
-}
-
-bool FrameBufferTexture::IsFullyOpaque() const
-{
-  return !HasAlphaChannel();
-}
-
-bool FrameBufferTexture::HasAlphaChannel() const
-{
-  if( mNativeImage )
-  {
-    return mNativeImage->RequiresBlending();
-  }
-
-  return false;
-}
-
-bool FrameBufferTexture::Init()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-  return true;
-}
-
-bool FrameBufferTexture::Prepare()
-{
-  // bind texture
-  Bind( GL_TEXTURE_2D, TEXTURE_UNIT_FRAMEBUFFER );
-
-  if( 0 != mId )
-  {
-    // bind frame buffer
-    mContext.BindFramebuffer(GL_FRAMEBUFFER, mFrameBufferName);
-
-    return true;
-  }
-
-  // Texture could not be bound
-  return false;
-}
-
-bool FrameBufferTexture::CreateGlTexture()
-{
-  DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
-
-  if( mNativeImage &&
-      !mNativeImage->GlExtensionCreate() )
-  {
-    DALI_LOG_ERROR( "Error creating native image!\n" );
-    return false;
-  }
-
-  mContext.GenTextures(1, &mId);
-  mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );  // bind in unused unit so rebind works the first time
-  mContext.Bind2dTexture(mId);
-
-  // set texture parameters
-  mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
-  if( mNativeImage )
-  {
-    // platform specific implementation decides on what GL extension to use
-    mNativeImage->TargetTexture();
-  }
-  else
-  {
-    // Assign memory for texture in GL memory space
-    GLenum pixelFormat = GL_RGBA;
-    GLenum pixelDataType = GL_UNSIGNED_BYTE;
-    Integration::ConvertToGlFormat(mPixelFormat, pixelDataType, pixelFormat);
-
-    mContext.TexImage2D(GL_TEXTURE_2D, 0, pixelFormat, mWidth, mHeight, 0, pixelFormat, pixelDataType, NULL);
-  }
-
-  // generate frame and render buffer names
-  mContext.GenFramebuffers(1, &mFrameBufferName);
-
-  /* WE ALWAYS HAVE COLOR COMPONENT */
-
-  // bind frame buffer
-  mContext.BindFramebuffer(GL_FRAMEBUFFER, mFrameBufferName);
-  // attach texture to the color attachment point
-  mContext.FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mId, 0);
-
-  if (mBufferFormat == RenderBuffer::COLOR_DEPTH_STENCIL)
-  {
-    mContext.GenRenderbuffers(1, &mRenderBufferName);
-    mContext.GenRenderbuffers(1, &mStencilBufferName);
-
-    // Bind render buffer and create 16 depth buffer
-    mContext.BindRenderbuffer(GL_RENDERBUFFER, mRenderBufferName);
-    mContext.RenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, mWidth, mHeight);
-
-    // Bind render buffer and create 8 stencil buffer
-    mContext.BindRenderbuffer(GL_RENDERBUFFER, mStencilBufferName);
-    mContext.RenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, mWidth, mHeight);
-
-    // attach render buffer to the depth buffer attachment point
-    mContext.FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mRenderBufferName);
-    // attach render buffer to the stencil buffer attachment point
-    mContext.FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mStencilBufferName);
-  }
-  else if (mBufferFormat == RenderBuffer::COLOR_DEPTH)
-  {
-    mContext.GenRenderbuffers(1, &mRenderBufferName);
-
-    // Bind render buffer and create 8 stencil buffer
-    mContext.BindRenderbuffer(GL_RENDERBUFFER, mRenderBufferName);
-    mContext.RenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, mWidth, mHeight);
-
-    // attach render buffer to the depth buffer attachment point
-    mContext.FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mRenderBufferName);
-  }
-  else if (mBufferFormat == RenderBuffer::COLOR_STENCIL)
-  {
-    mContext.GenRenderbuffers(1, &mStencilBufferName);
-
-    // Bind render buffer and create 8 stencil buffer
-    mContext.BindRenderbuffer(GL_RENDERBUFFER, mStencilBufferName);
-    mContext.RenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, mWidth, mHeight);
-
-    // attach render buffer to the depth buffer attachment point
-    mContext.FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mStencilBufferName);
-  }
-
-  int status = mContext.CheckFramebufferStatus(GL_FRAMEBUFFER);
-  if ( GL_FRAMEBUFFER_COMPLETE != status )
-  {
-    DALI_LOG_ERROR( "status (0x%x), glError (0x%x)\n", status, mContext.GetError() );
-  }
-
-  return mId != 0;
-}
-
-void FrameBufferTexture::GlCleanup()
-{
-  Texture::GlCleanup();
-
-  if (mFrameBufferName != 0)
-  {
-    mContext.DeleteFramebuffers(1, &mFrameBufferName );
-    mFrameBufferName = 0;
-  }
-
-  if (mRenderBufferName != 0)
-  {
-    mContext.DeleteRenderbuffers(1, &mRenderBufferName );
-    mRenderBufferName = 0;
-  }
-
-  if (mStencilBufferName != 0)
-  {
-    mContext.DeleteRenderbuffers(1, &mStencilBufferName );
-    mStencilBufferName = 0;
-  }
-
-  if( mNativeImage )
-  {
-    mNativeImage->GlExtensionDestroy();
-    mNativeImage.Reset();
-  }
-}
-
-} //namespace Internal
-
-} //namespace Dali
diff --git a/dali/internal/render/gl-resources/frame-buffer-texture.h b/dali/internal/render/gl-resources/frame-buffer-texture.h
deleted file mode 100644 (file)
index 13ceb4c..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef __DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
-#define __DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
-
-/*
- * 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/frame-buffer-image.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-/**
- * Texture class.
- * Used as a frame buffer for RenderTask
- */
-class FrameBufferTexture : public Texture
-{
-public:
-
-  /**
-   * Creates a new texture object
-   * @param[in] width       The width (pixels)
-   * @param[in] height      The height (pixels)
-   * @param[in] context The GL context
-   */
-  FrameBufferTexture(unsigned int width, unsigned int height, Context& context);
-
-  /**
-   * Creates a new texture object
-   * @param[in] width       The width (pixels)
-   * @param[in] height      The height (pixels)
-   * @param[in] pixelFormat The pixel format
-   * @param[in] context The GL context
-   */
-  FrameBufferTexture(unsigned int width, unsigned int height, Pixel::Format pixelFormat, Context& context);
-
-  /**
-   * Creates a new texture object
-   * @param[in] width         The width (pixels)
-   * @param[in] height        The height (pixels)
-   * @param[in] pixelFormat   The pixel format
-   * @param[in] bufferFormat  The buffer formats to be attached in the FBO
-   * @param[in] context The GL context
-   */
-  FrameBufferTexture(unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat, Context& context);
-
-  /**
-   * Creates a new texture object
-   * @param[in] nativeImage The NativeImage
-   * @param     context The GL context
-   */
-  FrameBufferTexture( NativeImageInterfacePtr nativeImage, Context& context );
-
-  /**
-   * Destructor.
-   */
-  virtual ~FrameBufferTexture();
-
-  /**
-   * @copydoc Texture::IsFullyOpaque
-   */
-  virtual bool IsFullyOpaque() const;
-
-  /**
-   * @copydoc Texture::HasAlphaChannel
-   */
-  virtual bool HasAlphaChannel() const;
-
-  /**
-   * @copydoc Texture::Init
-   */
-  virtual bool Init();
-
-  /**
-   * Prepare FBO for rendering.
-   * @return true if the FBO is prepared and its status is GL_FRAMEBUFFER_COMPLETE, otherwise false.
-   */
-  virtual bool Prepare();
-
-protected:
-  unsigned int mFrameBufferName;
-  unsigned int mRenderBufferName;
-  unsigned int mStencilBufferName;
-  Pixel::Format mPixelFormat;
-  RenderBuffer::Format mBufferFormat;
-  NativeImageInterfacePtr mNativeImage; ///< For native FBOs only
-
-  /**
-   * @copydoc Texture::CreateGlTexture
-   */
-  virtual bool CreateGlTexture();
-
-  /**
-   * @copydoc Texture::GlCleanup
-   */
-  virtual void GlCleanup();
-
-}; // class FrameBufferTexture
-
-}  //namespace Internal
-
-} //namespace Dali
-#endif //__DALI_INTERNAL_FRAME_BUFFER_TEXTURE_H__
-
diff --git a/dali/internal/render/gl-resources/gl-texture.cpp b/dali/internal/render/gl-resources/gl-texture.cpp
deleted file mode 100644 (file)
index fc6c15c..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/render/gl-resources/gl-texture.h>
-
-// EXTERNAL INCLUDES
-#include <math.h>
-#include <memory.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/common/image-sampler.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-// These match the GL specification
-const GLint SYSTEM_MINIFY_DEFAULT  = GL_NEAREST_MIPMAP_LINEAR;
-const GLint SYSTEM_MAGNIFY_DEFAULT = GL_LINEAR;
-const GLint SYSTEM_WRAP_DEFAULT  = GL_CLAMP_TO_EDGE;
-
-// These are the Dali defaults
-const GLint DALI_MINIFY_DEFAULT  = GL_LINEAR;
-const GLint DALI_MAGNIFY_DEFAULT = GL_LINEAR;
-
-} // namespace
-
-/**
- * @brief Convert a FilterMode to it's corresponding GL type.
- *
- * @param[in] filterMode The FilterMode type.
- * @param[in] defaultfilterMode The filter mode to use if filterMode is DEFAULT.
- * @param[in] defaultSystemFilterMode The filter mode to use if filterMode is NONE.
- * @return Return the equivalent GL type.
- */
-GLint FilterModeToGL( FilterMode::Type filterMode, GLint defaultfilterMode, GLint defaultSystemFilterMode )
-{
-  switch( filterMode )
-  {
-    case FilterMode::NEAREST:
-    {
-      return GL_NEAREST;
-    }
-    case FilterMode::LINEAR:
-    {
-      return GL_LINEAR;
-    }
-    case FilterMode::NONE:
-    {
-      return defaultSystemFilterMode;
-    }
-    case FilterMode::NEAREST_MIPMAP_NEAREST:
-    {
-      return GL_NEAREST_MIPMAP_NEAREST;
-    }
-    case FilterMode::LINEAR_MIPMAP_NEAREST:
-    {
-      return GL_LINEAR_MIPMAP_NEAREST;
-    }
-    case FilterMode::NEAREST_MIPMAP_LINEAR:
-    {
-      return GL_NEAREST_MIPMAP_LINEAR;
-    }
-    case FilterMode::LINEAR_MIPMAP_LINEAR:
-    {
-      return GL_LINEAR_MIPMAP_LINEAR;
-    }
-    case FilterMode::DEFAULT:
-    {
-      return defaultfilterMode;
-    }
-  }
-
-  return defaultfilterMode;
-}
-
-GLint WrapModeToGL( WrapMode::Type wrapMode, GLint defaultWrapMode )
-{
-  switch( wrapMode )
-  {
-    case WrapMode::DEFAULT:
-    {
-      return defaultWrapMode;
-    }
-    case WrapMode::CLAMP_TO_EDGE:
-    {
-      return GL_CLAMP_TO_EDGE;
-    }
-    case WrapMode::REPEAT:
-    {
-      return GL_REPEAT;
-    }
-    case WrapMode::MIRRORED_REPEAT:
-    {
-      return GL_MIRRORED_REPEAT;
-    }
-  }
-
-  return defaultWrapMode;
-}
-
-using Dali::Internal::Vertex2D;
-
-using namespace Dali::Pixel;
-
-Texture::Texture(Context&      context,
-                 unsigned int  width,
-                 unsigned int  height,
-                 unsigned int  imageWidth,
-                 unsigned int  imageHeight)
-: mContext(context),
-  mId(0),
-  mSamplerBitfield( 0 ),
-  mWidth(width),
-  mHeight(height),
-  mImageWidth(imageWidth),
-  mImageHeight(imageHeight)
-{
-}
-
-Texture::Texture(Context&      context,
-                 unsigned int  width,
-                 unsigned int  height)
-: mContext(context),
-  mId(0),
-  mSamplerBitfield( 0 ),
-  mWidth(width),
-  mHeight(height),
-  mImageWidth(width),
-  mImageHeight(height)
-{
-}
-
-Texture::~Texture()
-{
-  // GlCleanup() should already have been called by TextureCache ensuring the resource is destroyed
-  // on the render thread. (And avoiding a potentially problematic virtual call in the destructor)
-}
-
-void Texture::SetTextureId(GLuint id)
-{
-  mId=id;
-}
-
-void Texture::Update(Integration::Bitmap* bitmap)
-{
-  DALI_ASSERT_DEBUG( "Updating incorrect texture type" == NULL );
-}
-
-void Texture::UpdateArea( const RectArea& area )
-{
-  DALI_ASSERT_DEBUG( "Updating incorrect texture type" == NULL );
-}
-
-bool Texture::UpdateOnCreate()
-{
-  return false;
-}
-
-bool Texture::Bind(GLenum target, TextureUnit textureunit )
-{
-  // This is the only supported type at the moment
-  DALI_ASSERT_DEBUG( target == GL_TEXTURE_2D );
-  bool result = true;
-
-  if( mId == 0 )
-  {
-    result = CreateGlTexture();
-  }
-
-  // Bind the texture id
-  mContext.BindTextureForUnit(textureunit, mId );
-
-  return result;
-}
-
-void Texture::GlContextDestroyed()
-{
-  // texture is gone
-  mId = 0;
-  // reset sampler state as well
-  mSamplerBitfield = 0;
-}
-
-void Texture::GlCleanup()
-{
-  // delete the gl texture
-  if (mId != 0)
-  {
-    mContext.DeleteTextures(1,&mId);
-    mId = 0;
-  }
-}
-
-unsigned int Texture::GetWidth() const
-{
-  return mWidth;
-}
-
-unsigned int Texture::GetHeight() const
-{
-  return mHeight;
-}
-
-void Texture::ApplyFilterModeParameter( TextureUnit unit, GLint filterType, FilterMode::Type currentFilterMode, FilterMode::Type newFilterMode, GLint daliDefault, GLint systemDefault )
-{
-  GLint newFilterModeGL = FilterModeToGL( newFilterMode, daliDefault, systemDefault );
-  GLint currentFilterModeGL = FilterModeToGL( currentFilterMode, daliDefault, systemDefault );
-
-  if( newFilterModeGL != currentFilterModeGL )
-  {
-    mContext.ActiveTexture( unit );
-    mContext.TexParameteri( GL_TEXTURE_2D, filterType, newFilterModeGL );
-  }
-}
-
-void Texture::ApplyWrapModeParameter( TextureUnit unit, GLint wrapType, WrapMode::Type currentWrapMode, WrapMode::Type newWrapMode )
-{
-  GLint newWrapModeGL = WrapModeToGL( newWrapMode, SYSTEM_WRAP_DEFAULT );
-  GLint currentWrapModeGL = WrapModeToGL( currentWrapMode, SYSTEM_WRAP_DEFAULT );
-
-  if( newWrapModeGL != currentWrapModeGL )
-  {
-    mContext.ActiveTexture( unit );
-    mContext.TexParameteri( GL_TEXTURE_2D, wrapType, newWrapModeGL );
-  }
-}
-
-void Texture::ApplySampler( TextureUnit unit, unsigned int samplerBitfield )
-{
-  if( mSamplerBitfield != samplerBitfield && mId != 0 )
-  {
-    ApplyFilterModeParameter( unit,
-                           GL_TEXTURE_MIN_FILTER,
-                           ImageSampler::GetMinifyFilterMode( mSamplerBitfield ),
-                           ImageSampler::GetMinifyFilterMode( samplerBitfield ),
-                           DALI_MINIFY_DEFAULT,
-                           SYSTEM_MINIFY_DEFAULT );
-
-    ApplyFilterModeParameter( unit,
-                              GL_TEXTURE_MAG_FILTER,
-                              ImageSampler::GetMagnifyFilterMode( mSamplerBitfield ),
-                              ImageSampler::GetMagnifyFilterMode( samplerBitfield ),
-                              DALI_MAGNIFY_DEFAULT,
-                              SYSTEM_MAGNIFY_DEFAULT );
-
-    ApplyWrapModeParameter( unit,
-                            GL_TEXTURE_WRAP_S,
-                            ImageSampler::GetUWrapMode( mSamplerBitfield ),
-                            ImageSampler::GetUWrapMode( samplerBitfield ));
-
-    ApplyWrapModeParameter( unit,
-                            GL_TEXTURE_WRAP_T,
-                            ImageSampler::GetVWrapMode( mSamplerBitfield ),
-                            ImageSampler::GetVWrapMode( samplerBitfield ));
-
-
-
-    mSamplerBitfield = samplerBitfield;
-  }
-}
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/render/gl-resources/gl-texture.h b/dali/internal/render/gl-resources/gl-texture.h
deleted file mode 100644 (file)
index 0504dad..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-#ifndef __DALI_INTERNAL_TEXTURE_H__
-#define __DALI_INTERNAL_TEXTURE_H__
-
-/*
- * Copyright (c) 2015 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 <dali/public-api/actors/sampling.h>
-#include <dali/public-api/images/image.h>
-#include <dali/public-api/images/pixel.h>
-#include <dali/public-api/images/native-image.h>
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/object/ref-object.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/integration-api/gl-abstraction.h>
-#include <dali/internal/event/images/pixel-data-impl.h>
-#include <dali/internal/render/gl-resources/gl-resource-owner.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
-
-
-namespace Dali
-{
-
-class NativeImage;
-
-namespace Internal
-{
-
-class Context;
-struct Vertex2D;
-
-/**
- * Texture class.
- */
-class Texture: public RefObject,
-               public GlResourceOwner
-{
-public:
-
-  /**
-   * Used to define the area of the texture to display
-   */
-  typedef Rect<int> PixelArea;
-
-  /**
-   * Used to define a region of a bitmap.
-   */
-  typedef Rect<unsigned int>    RectArea;     ///< rectangular area (x,y,w,h)
-
-  /**
-   * Initialization method for Texture.
-   * Might or might not be needed in specific implementations.
-   * @return true if successful, false otherwise
-   */
-  virtual bool Init() = 0;
-
-  /**
-   * Update the texture with the bitmap.
-   */
-  virtual void Update(Integration::Bitmap* bitmap);
-
-  /**
-   * Update the texture from the modified bitmap.
-   * @param area to update
-   */
-  virtual void UpdateArea( const RectArea& area );
-
-  /**
-   * Update part of the texture with a different bitmap
-   * @param[in] srcBitmap The bitmap to copy from
-   * @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
-   */
-  virtual void Update( Integration::Bitmap* srcBitmap, std::size_t xOffset, std::size_t yOffset ) {}
-
-  /**
-   * Update part of the texture with a pixel buffer
-   * @param[in] srcPixelData The pixel data to copy from
-   * @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
-   */
-  virtual void Update( PixelData* srcPixelData, std::size_t xOffset, std::size_t yOffset ) {}
-
-  /**
-   * @return Return true if the texture should be updated on GL texture creation.
-   */
-  virtual bool UpdateOnCreate();
-
-  /**
-   * Binds the texture for use.
-   * If there is no GL texture yet, it tries to create one.
-   *
-   * @param target (e.g. GL_TEXTURE_2D)
-   * @param textureunit to bind to
-   *
-   * @return true if the bind succeeded, or false if either the create or bind failed
-   */
-  virtual bool Bind(GLenum target, TextureUnit textureunit);
-
-  /**
-   * Returns GL texture ID
-   * @return texture id
-   */
-  unsigned int GetTextureId()
-  {
-    return mId;
-  }
-
-  /**
-   * Return the width of image in pixels.
-   * @return width
-   */
-  virtual unsigned int GetWidth() const;
-
-  /**
-   * Return the height of image in pixels.
-   * @return height
-   */
-  virtual unsigned int GetHeight() const;
-
-  /**
-   * Query whether the texture data has an alpha channel.
-   * @return True if the texture data has an alpha channel.
-   */
-  virtual bool HasAlphaChannel() const = 0;
-
-  /**
-   * Query whether the texture is completely opaque
-   * @return True if all pixels of the texture data are opaque
-   */
-  virtual bool IsFullyOpaque() const = 0;
-
-  /**
-   * Sets the texture id.
-   * @param id OpenGL texture id
-   */
-  void SetTextureId(GLuint id);
-
-  /**
-   * @brief Apply the given sampler to the texture.
-   *
-   * @param[in] texture unit to use
-   * @param[in] samplerBitfield A bitfield with packed sampler options.
-   */
-  void ApplySampler( TextureUnit unit, unsigned int samplerBitfield );
-
-protected:
-
-  /**
-   * Constructor.
-   * @param[in] context The GL context
-   * @param[in] width       The buffer width
-   * @param[in] height      The buffer height
-   * @param[in] imageWidth  The image width
-   * @param[in] imageHeight The image height
-   */
-  Texture( Context&      context,
-           unsigned int  width,
-           unsigned int  height,
-           unsigned int  imageWidth,
-           unsigned int  imageHeight );
-  /**
-   * Constructor.
-   * @param[in] context The GL context
-   * @param[in] width       Both the buffer width and the image width (they are equal)
-   * @param[in] height      Both the buffer height and the image height.
-   */
-  Texture( Context&      context,
-           unsigned int  width,
-           unsigned int  height );
-public:
-  /**
-   * Initialize texture for rendering.
-   * @return true on success
-   */
-  virtual bool CreateGlTexture() = 0;
-
-  /**
-   * Destructor.
-   * Delete the GL texture associated with it.
-   */
-  virtual ~Texture();
-
-public: // From GlResourceOwner
-
-  /**
-   * @copydoc Dali::Internal::GlResourceOwner::GlContextDestroyed()
-   */
-  virtual void GlContextDestroyed();
-
-  /**
-   * @copydoc Dali::Internal::GlResourceOwner::GlCleanup()
-   */
-  virtual void GlCleanup();
-
-private:
-
-  // Undefined
-  Texture(const Texture&);
-
-  // Undefined
-  Texture& operator=(const Texture& rhs);
-
-  /**
-   * @brief Apply the given texture filtering parameters.
-   *
-   * @param[in] texture unit to use
-   * @param[in] filterType Minification or magnification.
-   * @param[in] currentFilterMode The current filter mode.
-   * @param[in] newFilterMode The new filter mode.
-   * @param[in] daliDefault The default dali filter mode for the given filterType.
-   * @param[in] systemDefault The default system filter mode for the given filterType.
-   */
-  void ApplyFilterModeParameter( TextureUnit unit, GLint filterType, FilterMode::Type currentFilterMode, FilterMode::Type newFilterMode, GLint daliDefault, GLint systemDefault );
-
-  /**
-   * @brief Apply the given texture wrap mode.
-   *
-   * @param[in] texture unit to use
-   * @param[in] wrapType UWrap or VWrap
-   * @param[in] currentWrapMode The current wrap mode.
-   * @param[in] newWrapMode The new wrap mode.
-   */
-  void ApplyWrapModeParameter( TextureUnit unit, GLint wrapType, WrapMode::Type currentWrapMode, WrapMode::Type newWrapMode );
-
-protected:
-
-  Context&      mContext;      ///< The GL Context
-
-  GLuint        mId;           ///< Texture id
-
-  unsigned int  mSamplerBitfield;    ///< The packed bitfield of the current sampler
-
-  unsigned int  mWidth;        ///< texture width, may be scaled power of 2 (if not in an atlas)
-  unsigned int  mHeight;       ///< texture width, may be scaled power of 2 (if not in an atlas)
-
-  unsigned int  mImageWidth;   ///< width of the original image (may be smaller than texture width)
-  unsigned int  mImageHeight;  ///< height of the original image (may be smaller than texture height)
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_TEXTURE_H__
diff --git a/dali/internal/render/gl-resources/native-texture.cpp b/dali/internal/render/gl-resources/native-texture.cpp
deleted file mode 100644 (file)
index 11a62ce..0000000
+++ /dev/null
@@ -1,146 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/render/gl-resources/native-texture.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-NativeTexture::NativeTexture(NativeImageInterface* nativeImg, Context& context)
-: Texture(context,
-          nativeImg->GetWidth(),
-          nativeImg->GetHeight(),
-          nativeImg->GetWidth(),
-          nativeImg->GetHeight()),
-          mNativeImage(nativeImg)
-{
-  DALI_LOG_INFO( Debug::Filter::gImage, Debug::General, "NativeTexture created 0x%x\n", &nativeImg );
-}
-
-NativeTexture::~NativeTexture()
-{
-  DALI_LOG_INFO (Debug::Filter::gImage, Debug::General, "NativeTexture destroyed\n");
-
-  // GlCleanup() should already have been called by TextureCache ensuring the resource is destroyed
-  // on the render thread. (And avoiding a potentially problematic virtual call in the destructor)
-}
-
-bool NativeTexture::Bind( GLenum target, TextureUnit textureunit )
-{
-  bool result = true;
-
-  if( mId == 0 )
-  {
-    result = CreateGlTexture();
-  }
-
-  if( result )
-  {
-    // Bind the texture id
-    mContext.ActiveTexture( textureunit );
-
-    int textureTarget = GL_TEXTURE_2D;
-    NativeImageInterface::Extension* extension = mNativeImage->GetExtension();
-    if( extension )
-    {
-      textureTarget = extension->GetEglImageTextureTarget();
-    }
-
-    mContext.BindTexture( textureTarget, mId );
-    mNativeImage->PrepareTexture();
-  }
-
-  return result;
-}
-
-bool NativeTexture::IsFullyOpaque() const
-{
-  return !HasAlphaChannel();
-}
-
-bool NativeTexture::HasAlphaChannel() const
-{
-  return mNativeImage->RequiresBlending();
-}
-
-bool NativeTexture::CreateGlTexture()
-{
-  if( mId != 0 )
-  {
-    DALI_LOG_INFO( Debug::Filter::gImage, Debug::General, "GL texture creation duplicate for GL id: %d\n", &mId );
-    return true;
-  }
-
-  if( mNativeImage->GlExtensionCreate() )
-  {
-    mContext.GenTextures( 1, &mId );
-    mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );  // bind in unused unit so rebind works the first time
-
-    int textureTarget = GL_TEXTURE_2D;
-    NativeImageInterface::Extension* extension = mNativeImage->GetExtension();
-    if( extension )
-    {
-      textureTarget = extension->GetEglImageTextureTarget();
-    }
-
-    mContext.BindTexture( textureTarget, mId );
-
-    mContext.PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); // We always use tightly packed data
-
-    mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-    mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
-
-    // platform specific implementation decides on what GL extension to use
-    mNativeImage->TargetTexture();
-  }
-  else
-  {
-    DALI_LOG_ERROR( "Error creating native image!\n" );
-  }
-
-  return mId != 0;
-}
-
-void NativeTexture::GlCleanup()
-{
-  Texture::GlCleanup();
-
-  DALI_ASSERT_DEBUG( mNativeImage );
-
-  mNativeImage->GlExtensionDestroy();
-  mNativeImage.Reset();
-}
-
-bool NativeTexture::Init()
-{
-  return true;
-}
-
-} //namespace Internal
-
-} //namespace Dali
diff --git a/dali/internal/render/gl-resources/native-texture.h b/dali/internal/render/gl-resources/native-texture.h
deleted file mode 100644 (file)
index 29e43b2..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef __DALI_INTERNAL_NATIVE_TEXTURE_H__
-#define __DALI_INTERNAL_NATIVE_TEXTURE_H__
-
-/*
- * 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 <dali/integration-api/gl-defines.h>
-#include <dali/public-api/images/native-image-interface.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class Texture;
-
-/**
- *
- * Native texture class.
- * Used for handing already loaded image data to Dali.
- *
- */
-class NativeTexture : public Texture
-{
-public:
-  /**
-   * Constructor.
-   * @pre nativeImg has to be initialized. (GLTexture is already created)
-   * @param nativeImg         the NativeImage to be used
-   * @param context           the GL context
-   */
-  NativeTexture(NativeImageInterface* nativeImg, Context& context);
-
-  /**
-   * Destructor.
-   */
-  virtual ~NativeTexture();
-
-  /**
-   * @copydoc Texture::Bind
-   */
-  virtual bool Bind( GLenum target, TextureUnit textureunit );
-
-  /**
-   * @copydoc Texture::IsFullyOpaque
-   */
-  virtual bool IsFullyOpaque() const;
-
-  /**
-   * @copydoc Texture::HasAlphaChannel
-   */
-  virtual bool HasAlphaChannel() const;
-
-  /**
-   * @copydoc Texture::Init
-   */
-  virtual bool Init();
-
-protected:
-  /**
-   * @copydoc Texture::CreateGlTexture
-   */
-  virtual bool CreateGlTexture();
-
-  /**
-   * @copydoc Texture::GlCleanup
-   */
-  virtual void GlCleanup();
-
-
-private:
-
-  NativeImageInterfacePtr mNativeImage; ///< reference to NativeImage the Texture was created from
-};
-
-}  //namespace Internal
-
-}  //namespace Dali
-
-#endif //__DALI_INTERNAL_NATIVE_TEXTURE_H__
diff --git a/dali/internal/render/gl-resources/texture-cache.cpp b/dali/internal/render/gl-resources/texture-cache.cpp
deleted file mode 100644 (file)
index 9682d6c..0000000
+++ /dev/null
@@ -1,449 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/render/gl-resources/texture-cache.h>
-
-// INTERNAL HEADERS
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/internal/render/common/texture-uploaded-dispatcher.h>
-#include <dali/internal/render/queue/render-queue.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/gl-resources/texture-factory.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
-#include <dali/internal/render/gl-resources/texture-observer.h>
-#include <dali/internal/render/gl-resources/bitmap-texture.h>
-#include <dali/internal/render/gl-resources/native-texture.h>
-#include <dali/internal/render/gl-resources/frame-buffer-texture.h>
-#include <dali/internal/update/resources/resource-manager-declarations.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
-
-using Dali::Internal::Texture;
-using Dali::Internal::FrameBufferTexture;
-using Dali::Integration::Bitmap;
-
-namespace
-{
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gTextureCacheFilter = Debug::Filter::New(Debug::Concise, false, "LOG_TEXTURE_CACHE");
-#endif
-}
-
-
-namespace Dali
-{
-namespace Internal
-{
-
-
-namespace SceneGraph
-{
-
-namespace
-{
-
-/**
- * @brief Forward to all textures in container the news that the GL Context is down.
- */
-void GlContextDestroyed( TextureContainer& textures )
-{
-  TextureIter end = textures.end();
-  TextureIter iter = textures.begin();
-  for( ; iter != end; ++iter )
-  {
-    (*iter->second).GlContextDestroyed();
-  }
-}
-
-}
-
-TextureCache::TextureCache( RenderQueue& renderQueue,
-                            TextureUploadedDispatcher& postProcessResourceDispatcher,
-                            Context& context)
-: mTextureUploadedDispatcher(postProcessResourceDispatcher),
-  mContext(context),
-  mDiscardBitmapsPolicy(ResourcePolicy::OWNED_DISCARD)
-{
-}
-
-TextureCache::~TextureCache()
-{
-}
-
-void TextureCache::CreateTexture( ResourceId        id,
-                                  unsigned int      width,
-                                  unsigned int      height,
-                                  Pixel::Format     pixelFormat,
-                                  bool              clearPixels )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::CreateTexture(id=%i width:%u height:%u)\n", id, width, height);
-
-  Texture* texture = TextureFactory::NewBitmapTexture(width, height, pixelFormat, clearPixels, mContext, GetDiscardBitmapsPolicy() );
-  mTextures.insert(TexturePair(id, texture));
-}
-
-void TextureCache::AddBitmap(ResourceId id, Integration::BitmapPtr bitmap)
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::AddBitmap(id=%i Bitmap:%p)\n", id, bitmap.Get());
-
-  Texture* texture = TextureFactory::NewBitmapTexture(bitmap.Get(), mContext, GetDiscardBitmapsPolicy());
-  mTextures.insert(TexturePair(id, texture));
-}
-
-void TextureCache::AddNativeImage(ResourceId id, NativeImageInterfacePtr nativeImage)
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::AddNativeImage(id=%i NativeImg:%p)\n", id, nativeImage.Get());
-
-  /// WARNING - currently a new Texture is created even if we reuse the same NativeImage
-  Texture* texture = TextureFactory::NewNativeImageTexture(*nativeImage, mContext);
-  mTextures.insert(TexturePair(id, texture));
-}
-
-void TextureCache::AddFrameBuffer( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::AddFrameBuffer(id=%i width:%u height:%u)\n", id, width, height);
-
-  // Note: Do not throttle framebuffer generation - a request for a framebuffer should always be honoured
-  // as soon as possible.
-  Texture* texture = TextureFactory::NewFrameBufferTexture( width, height, pixelFormat, bufferFormat, mContext );
-  mFramebufferTextures.insert(TexturePair(id, texture));
-}
-
-void TextureCache::AddFrameBuffer( ResourceId id, NativeImageInterfacePtr nativeImage )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::AddFrameBuffer(id=%i width:%u height:%u)\n", id, nativeImage->GetWidth(), nativeImage->GetHeight());
-
-  // Note: Do not throttle framebuffer generation - a request for a framebuffer should always be honoured
-  // as soon as possible.
-  Texture* texture = TextureFactory::NewFrameBufferTexture( nativeImage, mContext );
-  mFramebufferTextures.insert(TexturePair(id, texture));
-}
-
-void TextureCache::CreateGlTexture( ResourceId id )
-{
-  TextureIter textureIter = mTextures.find(id);
-  // If we found a non-null texture object pointer for the resource id, force it
-  // to eagerly allocate a backing GL texture:
-  if( textureIter != mTextures.end() )
-  {
-    TexturePointer texturePtr = textureIter->second;
-    if( texturePtr )
-    {
-      texturePtr->CreateGlTexture();
-    }
-  }
-}
-
-void TextureCache::UpdateTexture( ResourceId id, Integration::BitmapPtr bitmap )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::UpdateTexture(id=%i bitmap:%p )\n", id, bitmap.Get());
-
-  TextureIter textureIter = mTextures.find(id);
-  if( textureIter != mTextures.end() )
-  {
-    // we have reloaded the image from file, update texture
-    TexturePointer texturePtr = textureIter->second;
-    if( texturePtr )
-    {
-      texturePtr->Update( bitmap.Get() );
-
-      ResourceId ppRequest( id );
-      mTextureUploadedDispatcher.DispatchTextureUploaded(ppRequest);
-    }
-  }
-}
-
-void TextureCache::UpdateTexture( ResourceId id, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::UpdateTexture(id=%i bitmap:%p )\n", id, bitmap.Get());
-
-  TextureIter textureIter = mTextures.find(id);
-  if( textureIter != mTextures.end() )
-  {
-    TexturePointer texturePtr = textureIter->second;
-    if( texturePtr )
-    {
-      texturePtr->Update( bitmap.Get(), xOffset, yOffset );
-
-      ResourceId ppRequest( id  );
-      mTextureUploadedDispatcher.DispatchTextureUploaded(ppRequest);
-    }
-  }
-}
-
-void TextureCache::UpdateTexture( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::UpdateTexture(destId=%i srcId=%i )\n", destId, srcId );
-
-  BitmapTexture* srcTexture = TextureCache::GetBitmapTexture( srcId );
-  Integration::BitmapPtr srcBitmap = ( srcTexture != NULL ) ? srcTexture->GetBitmap() : NULL;
-
-  if( srcBitmap )
-  {
-    UpdateTexture( destId, srcBitmap, xOffset, yOffset );
-  }
-}
-
-void TextureCache::UpdateTexture( ResourceId id, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::UpdateTexture(id=%i pixel data:%p )\n", id, pixelData.Get());
-
-  TextureIter textureIter = mTextures.find(id);
-  if( textureIter != mTextures.end() )
-  {
-    TexturePointer texturePtr = textureIter->second;
-    if( texturePtr )
-    {
-      texturePtr->Update( pixelData.Get(), xOffset, yOffset );
-
-      ResourceId ppRequest( id );
-      mTextureUploadedDispatcher.DispatchTextureUploaded(ppRequest);
-    }
-  }
-}
-
-void TextureCache::UpdateTextureArea( ResourceId id, const RectArea& area )
-{
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::UpdateTextureArea(id=%i)\n", id );
-
-  TextureIter textureIter = mTextures.find(id);
-  if( textureIter != mTextures.end() )
-  {
-    TexturePointer texturePtr = textureIter->second;
-    if( texturePtr )
-    {
-      texturePtr->UpdateArea( area );
-
-      ResourceId ppRequest( id );
-      mTextureUploadedDispatcher.DispatchTextureUploaded(ppRequest);
-    }
-  }
-}
-
-void TextureCache::DiscardTexture( ResourceId id )
-{
-  bool deleted = false;
-
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::DiscardTexture(id:%u)\n", id);
-
-  if( mTextures.size() > 0)
-  {
-    TextureIter iter = mTextures.find(id);
-    if( iter != mTextures.end() )
-    {
-      TexturePointer texturePtr = iter->second;
-      if( texturePtr )
-      {
-        // if valid texture pointer, cleanup GL resources
-        texturePtr->GlCleanup();
-      }
-      mTextures.erase(iter);
-      deleted = true;
-    }
-  }
-
-  if( mFramebufferTextures.size() > 0)
-  {
-    TextureIter iter = mFramebufferTextures.find(id);
-    if( iter != mFramebufferTextures.end() )
-    {
-      TexturePointer texturePtr = iter->second;
-      if( texturePtr )
-      {
-        // if valid texture pointer, cleanup GL resources
-        texturePtr->GlCleanup();
-      }
-      mFramebufferTextures.erase(iter);
-      deleted = true;
-    }
-  }
-
-  if(deleted)
-  {
-    if( mObservers.size() > 0 )
-    {
-      TextureResourceObserversIter observersIter = mObservers.find(id);
-      if( observersIter != mObservers.end() )
-      {
-        TextureObservers observers = observersIter->second;
-        for( TextureObserversIter iter = observers.begin(); iter != observers.end(); ++iter )
-        {
-          TextureObserver* observer = *iter;
-          observer->TextureDiscarded( id );
-        }
-
-        mObservers.erase( observersIter );
-      }
-    }
-  }
-}
-
-bool TextureCache::BindTexture( Texture *texture, ResourceId id, GLenum target, TextureUnit textureunit )
-{
-  unsigned int glTextureId = texture->GetTextureId();
-
-  bool success = texture->Bind(target, textureunit);
-  bool created = ( glTextureId == 0 ) && ( texture->GetTextureId() != 0 );
-
-  if( created && texture->UpdateOnCreate() ) // i.e. the pixel data was sent to GL
-  {
-    ResourceId ppRequest( id );
-    mTextureUploadedDispatcher.DispatchTextureUploaded(ppRequest);
-  }
-  return success;
-}
-
-Texture* TextureCache::GetTexture(ResourceId id)
-{
-  Texture* texture = NULL;
-  TextureIter iter = mTextures.find(id);
-
-  if( iter != mTextures.end() )
-  {
-    TexturePointer texturePtr = iter->second;
-    if( texturePtr )
-    {
-      texture = texturePtr.Get();
-    }
-  }
-
-  if( texture == NULL )
-  {
-    TextureIter iter = mFramebufferTextures.find(id);
-    if( iter != mFramebufferTextures.end() )
-    {
-      TexturePointer texturePtr = iter->second;
-      if( texturePtr )
-      {
-        texture = texturePtr.Get();
-      }
-    }
-  }
-
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::GetTexture(id:%u) : %p\n", id, texture);
-
-  return texture;
-}
-
-BitmapTexture* TextureCache::GetBitmapTexture(ResourceId id)
-{
-  BitmapTexture* texture = NULL;
-  TextureIter iter = mTextures.find( id );
-
-  if( iter != mTextures.end() )
-  {
-    TexturePointer texturePtr = iter->second;
-    if( texturePtr )
-    {
-      texture = dynamic_cast< BitmapTexture* >( texturePtr.Get() );
-    }
-  }
-
-  return texture;
-}
-
-FrameBufferTexture* TextureCache::GetFramebuffer(ResourceId id)
-{
-  FrameBufferTexture* offscreen = NULL;
-  TextureIter iter = mFramebufferTextures.find(id);
-
-  DALI_ASSERT_DEBUG( iter != mFramebufferTextures.end() );
-
-  if( iter != mFramebufferTextures.end() )
-  {
-    TexturePointer texturePtr = iter->second;
-    if( texturePtr )
-    {
-      offscreen = dynamic_cast< FrameBufferTexture* >( texturePtr.Get() );
-    }
-  }
-  DALI_ASSERT_DEBUG( offscreen );
-
-  DALI_LOG_INFO(Debug::Filter::gGLResource, Debug::General, "TextureCache::GetFramebuffer(id:%u) : %p\n", id, offscreen);
-
-  return offscreen;
-}
-
-void TextureCache::AddObserver( ResourceId id, TextureObserver* observer )
-{
-  TextureResourceObserversIter observersIter = mObservers.find(id);
-  if( observersIter != mObservers.end() )
-  {
-    TextureObservers& observers = observersIter->second;
-    bool foundObserver = false;
-    for( TextureObserversIter iter = observers.begin(); iter != observers.end(); ++iter )
-    {
-      if( *iter == observer )
-      {
-        foundObserver = true;
-        break;
-      }
-    }
-    if( ! foundObserver )
-    {
-      observers.push_back(observer);
-    }
-  }
-  else
-  {
-    TextureObservers observers;
-    observers.push_back(observer);
-    mObservers.insert(std::pair<ResourceId, TextureObservers>(id, observers));
-  }
-}
-
-void TextureCache::RemoveObserver( ResourceId id, TextureObserver* observer )
-{
-  TextureResourceObserversIter observersIter = mObservers.find(id);
-  if( observersIter != mObservers.end() )
-  {
-    TextureObservers& observers = observersIter->second;
-    for( TextureObserversIter iter = observers.begin(); iter != observers.end(); ++iter )
-    {
-      if(*iter == observer)
-      {
-        observers.erase(iter);
-        break;
-      }
-    }
-  }
-}
-
-void TextureCache::GlContextDestroyed()
-{
-  SceneGraph::GlContextDestroyed( mTextures );
-  SceneGraph::GlContextDestroyed( mFramebufferTextures );
-}
-
-void TextureCache::SetDiscardBitmapsPolicy( ResourcePolicy::Discardable policy )
-{
-  DALI_LOG_INFO( gTextureCacheFilter, Debug::General, "TextureCache::SetDiscardBitmapsPolicy(%s)\n",
-                 policy==ResourcePolicy::OWNED_DISCARD?"DISCARD":"RETAIN" );
-  mDiscardBitmapsPolicy = policy;
-}
-
-ResourcePolicy::Discardable TextureCache::GetDiscardBitmapsPolicy()
-{
-  return mDiscardBitmapsPolicy;
-}
-
-} // SceneGraph
-
-} // Internal
-
-} // Dali
diff --git a/dali/internal/render/gl-resources/texture-cache.h b/dali/internal/render/gl-resources/texture-cache.h
deleted file mode 100644 (file)
index 4af5f1f..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_TEXTURE_CACHE_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_TEXTURE_CACHE_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 <stdint.h>
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/common/map-wrapper.h>
-#include <dali/public-api/common/intrusive-ptr.h>
-#include <dali/public-api/images/frame-buffer-image.h>
-#include <dali/public-api/images/native-image.h>
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/math/vector4.h>
-#include <dali/integration-api/platform-abstraction.h>
-#include <dali/integration-api/resource-policies.h>
-#include <dali/integration-api/gl-abstraction.h>
-#include <dali/internal/common/owner-pointer.h>
-#include <dali/internal/event/images/pixel-data-impl.h>
-#include <dali/internal/event/resources/resource-client-declarations.h> // For RectArea
-#include <dali/internal/update/common/scene-graph-buffers.h>
-#include <dali/internal/render/gl-resources/texture-declarations.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
-
-namespace Dali
-{
-class NativeImageInterface;
-
-
-namespace Integration
-{
-class Bitmap;
-typedef IntrusivePtr<Bitmap>   BitmapPtr;
-}
-
-
-namespace Internal
-{
-class Context;
-class Texture;
-class BitmapTexture;
-class FrameBufferTexture;
-class TextureObserver;
-
-namespace SceneGraph
-{
-class RenderQueue;
-class TextureUploadedDispatcher;
-
-typedef std::map<ResourceId, TexturePointer >   TextureContainer;
-typedef std::pair<ResourceId, TexturePointer >  TexturePair;
-typedef TextureContainer::iterator              TextureIter;
-typedef TextureContainer::const_iterator        TextureConstIter;
-
-/**
- * Caches textures. Owned by Render Thread
- */
-class TextureCache
-{
-public:
- /**
-   * Constructor
-   * @param[in] renderQueue Queue to use for dispatching messages to this object
-   * @param[in] postProcessDispatcher Dispatcher for resource post processing requests
-   * @param[in] context GL Context
-   */
-  TextureCache( RenderQueue& renderQueue,
-                TextureUploadedDispatcher& postProcessDispatcher,
-                Context& context );
-
-  /**
-   * Destructor
-   */
-  ~TextureCache();
-
-  /**
-   * Creates a new empty texture object with the given dimensions.
-   * @param[in] width       The width (pixels)
-   * @param[in] height      The height (pixels)
-   * @param[in] pixelFormat The pixel format
-   * @param[in] clearPixels True if the pixel data should be cleared first
-   */
-  void CreateTexture( ResourceId        id,
-                      unsigned int      width,
-                      unsigned int      height,
-                      Pixel::Format     pixelFormat,
-                      bool              clearPixels );
-
-  /**
-   * Add a bitmap to the texture cache
-   * @param[in] id Resource Id of the bitmap
-   * @param[in] bitmap The bitmap
-   */
-  void AddBitmap( ResourceId id, Integration::BitmapPtr bitmap );
-
-  /**
-   * Add a native image to the texture cache
-   * @param[in] id Resource Id of the native image
-   * @param[in] nativeImage The native image
-   */
-  void AddNativeImage( ResourceId id, NativeImageInterfacePtr nativeImage );
-
-  /**
-   * Create a framebuffer texture and add it to the texture cache
-   * @param[in] id Resource Id of the native image
-   * @param[in] width Width of the framebuffer
-   * @param[in] height Height of the framebuffer
-   * @param[in] pixelFormat Pixel format of the framebuffer
-   * @param[in] bufferFormat Renderbuffer format of the framebuffer
-   */
-  void AddFrameBuffer( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat );
-
-  /**
-   * Create a framebuffer texture and add it to the texture cache
-   * @param[in] id Resource Id of the native image
-   * @param[in] nativeImage The NativeImage
-   */
-  void AddFrameBuffer( ResourceId id, NativeImageInterfacePtr nativeImage );
-
-  /**
-   * Create GL texture eagerly right now instead of waiting for first use.
-   * @param[in] id The resource id corresponding to the texture.
-   */
-  void CreateGlTexture( ResourceId id );
-
-  /**
-   * Update the texture with a newly loaded bitmap
-   * @param[in] id Resource Id of the bitmap
-   * @param[in] bitmap The bitmap
-   */
-  void UpdateTexture( ResourceId id, Integration::BitmapPtr bitmap );
-
-  /**
-   * Update the texture with a newly loaded bitmap
-   * @param[in] id Resource Id of the bitmap
-   * @param[in] bitmap The bitmap
-   * @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 UpdateTexture( ResourceId id, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Update the part of a texture with a newly loaded bitmap
-   * May be called from Update thread
-   * @param[in] destId The ID of the texture to update
-   * @param[in] srcId The resource ID of the source bitmap
-   * @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 UpdateTexture( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Update the texture with a pixel buffer
-   * @param[in] id Resource Id of the bitmap
-   * @param[in] pixelData 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 UpdateTexture( ResourceId id, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Update the area of the texture from the associated bitmap
-   * @param[in] id Resource Id of the bitmap
-   * @param[in] area The area of the bitmap that has changed
-   */
-  void UpdateTextureArea( ResourceId id, const RectArea& area );
-
-  /**
-   * Discard texture associated with resource ID
-   * @param[in] id Resource Id of the texture
-   */
-  void DiscardTexture( ResourceId id );
-
-  /**
-   * Bind a texture. On the first call, the texture will copy it's
-   * pixel data to an OpenGL texture.  If it's a BitmapTexture, then
-   * it will also trigger SignalUpdated to be sent on the event thread
-   * object.
-   *
-   * @param[in] texture pointer to the  texture
-   * @param[in] id Resource id of texture
-   * @param[in] target (e.g. GL_TEXTURE_2D)
-   * @param[in] textureunit to use
-   *
-   * @return true if the bind succeeded, false if either the create or bind failed.
-   */
-  bool BindTexture( Texture* texture, ResourceId id, GLenum target, TextureUnit textureunit );
-
-  /**
-   * Get the texture associated with the resource ID
-   * May be a texture or a framebuffer
-   * @param[in] id Resource Id of the texture
-   * @return NULL if the GL resource hasn't yet been created,
-   * or a valid pointer if it has.
-   */
-  Texture* GetTexture( ResourceId id );
-
-  /**
-   * Get the bitmaptexture associated with the resource ID
-   * @param[in] id Resource Id of the texture
-   * @return The texture or NULL
-   */
-  BitmapTexture* GetBitmapTexture(ResourceId id);
-
-  /**
-   * Get the framebuffer texture associated with the resource ID
-   * Used for writing to the framebuffer
-   * @param[in] id Resource Id of the framebuffer
-   * @return the framebuffer
-   */
-  FrameBufferTexture* GetFramebuffer(ResourceId id);
-
-  /**
-   * Add a texture observer. Should be called in render thread
-   * @param[in] id The resource id to watch
-   * @param[in] observer The observer to add
-   */
-  void AddObserver( ResourceId id, TextureObserver* observer );
-
-  /**
-   * Remove a texture observer. Should be called in render thread
-   * @param[in] id The resource id to stop watching
-   * @param[in] observer The observer to remove
-   */
-  void RemoveObserver( ResourceId id, TextureObserver* observer );
-
-  /**
-   * Reset all textures.
-   * This method is called when context is or has been deleted.
-   */
-  void GlContextDestroyed();
-
-  /**
-   * Set whether textures should retain or discard their bitmaps after upload to GL
-   * @param[in] policy Whether to retain or discard bitmaps
-   */
-  void SetDiscardBitmapsPolicy( ResourcePolicy::Discardable policy );
-
-  /**
-   * Get the discard policy.
-   * @return The discard policy.
-   */
-  ResourcePolicy::Discardable GetDiscardBitmapsPolicy();
-
-private:
-
-  TextureUploadedDispatcher& mTextureUploadedDispatcher;
-  Context&         mContext;
-  TextureContainer mTextures;
-  TextureContainer mFramebufferTextures;
-
-  typedef std::vector< TextureObserver* > TextureObservers;
-  typedef TextureObservers::iterator      TextureObserversIter;
-
-  typedef std::map< ResourceId, TextureObservers > TextureResourceObservers;
-  typedef TextureResourceObservers::iterator       TextureResourceObserversIter;
-
-  TextureResourceObservers mObservers;
-  ResourcePolicy::Discardable mDiscardBitmapsPolicy;
-};
-
-
-
-} // SceneGraph
-} // Internal
-} // Dali
-
-#endif //__DALI_INTERNAL_SCENE_GRAPH_TEXTURE_CACHE_H__
diff --git a/dali/internal/render/gl-resources/texture-declarations.h b/dali/internal/render/gl-resources/texture-declarations.h
deleted file mode 100644 (file)
index 26e6f56..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __DALI_INTERNAL_TEXTURE_DECLARATIONS_H__
-#define __DALI_INTERNAL_TEXTURE_DECLARATIONS_H__
-
-/*
- * 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 <dali/public-api/object/ref-object.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class Texture;
-typedef IntrusivePtr<Texture> TexturePointer;
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_TEXTURE_DECLARATIONS_H__
diff --git a/dali/internal/render/gl-resources/texture-factory.cpp b/dali/internal/render/gl-resources/texture-factory.cpp
deleted file mode 100644 (file)
index 0037e82..0000000
+++ /dev/null
@@ -1,122 +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.
- *
- */
-
-#include "texture-factory.h"
-
-#include <dali/integration-api/bitmap.h>
-#include <dali/integration-api/gl-defines.h>
-#include <dali/internal/render/gl-resources/bitmap-texture.h>
-#include <dali/internal/render/gl-resources/compressed-bitmap-texture.h>
-#include <dali/internal/render/gl-resources/native-texture.h>
-#include <dali/internal/render/gl-resources/frame-buffer-texture.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
-
-
-namespace Dali
-{
-class NativeImageInterface;
-
-namespace Internal
-{
-
-namespace TextureFactory
-{
-
-Internal::Texture* NewBitmapTexture( Integration::Bitmap* const bitmap, Context& context, ResourcePolicy::Discardable discardPolicy )
-{
-  DALI_ASSERT_DEBUG( bitmap );
-  Texture * texture = 0;
-  Integration::Bitmap::PackedPixelsProfile * const  packedPixelBitmapView = bitmap->GetPackedPixelsProfile();
-  if( packedPixelBitmapView )
-  {
-    texture = new BitmapTexture( bitmap, packedPixelBitmapView, context, discardPolicy );
-  }
-  else
-  {
-    Internal::BitmapCompressed * const compressedBitmap = dynamic_cast<Dali::Internal::BitmapCompressed*>( bitmap );
-    if( compressedBitmap != 0 )
-    {
-      texture = new CompressedBitmapTexture( compressedBitmap, context, discardPolicy );
-    }
-  }
-  if( texture )
-  {
-    if( !texture->Init() )
-    {
-      delete texture;
-      return NULL;
-    }
-  }
-  return texture;
-}
-
-Internal::Texture* NewBitmapTexture( unsigned int      width,
-                                     unsigned int      height,
-                                     Pixel::Format     pixelFormat,
-                                     bool              clearPixels,
-                                     Context&          context,
-                                     ResourcePolicy::Discardable discardPolicy )
-{
-  Texture *texture=new BitmapTexture(width, height, pixelFormat, clearPixels, context, discardPolicy);
-
-  return texture;
-}
-
-
-Internal::Texture* NewNativeImageTexture( NativeImageInterface& nativeImg, Context& context )
-{
-  NativeTexture* texture = new NativeTexture(&nativeImg, context);
-  if (!texture->Init())
-  {
-    delete texture;
-    return NULL;
-  }
-  return texture;
-}
-
-Internal::Texture* NewFrameBufferTexture( unsigned int width,
-                                          unsigned int height,
-                                          Pixel::Format pixelFormat,
-                                          RenderBuffer::Format bufferFormat,
-                                          Context& context )
-{
-  FrameBufferTexture* texture = new FrameBufferTexture(width, height, pixelFormat, bufferFormat, context);
-  if (!texture->Init())
-  {
-    delete texture;
-    return NULL;
-  }
-  return texture;
-}
-
-Internal::Texture* NewFrameBufferTexture( NativeImageInterfacePtr nativeImage,
-                                          Context& context )
-{
-  FrameBufferTexture* texture = new FrameBufferTexture(nativeImage, context);
-  if (!texture->Init())
-  {
-    delete texture;
-    return NULL;
-  }
-  return texture;
-}
-
-
-
-} // TextureFactory
-} // Internal
-} // Dali
diff --git a/dali/internal/render/gl-resources/texture-factory.h b/dali/internal/render/gl-resources/texture-factory.h
deleted file mode 100644 (file)
index a493cde..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef __DALI_INTERNAL_TEXTURE_FACTORY_H__
-#define __DALI_INTERNAL_TEXTURE_FACTORY_H__
-
-/*
- * 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 <dali/public-api/object/ref-object.h>
-#include <dali/public-api/images/native-image-interface.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
-
-namespace Dali
-{
-class NativeImageInterface;
-
-namespace Integration
-{
-class Bitmap;
-}
-
-namespace Internal
-{
-class Context;
-class Texture;
-
-namespace TextureFactory
-{
-/**
- * Creates a new texture object from a Bitmap
- * @param[in] bitmap The Bitmap
- * @param[in] context The GL context
- * @return A newly allocated texture
- */
-Internal::Texture* NewBitmapTexture( Integration::Bitmap* const bitmap,
-                                     Context& context,
-                                     ResourcePolicy::Discardable discardPolicy );
-
-/**
- * Creates a new bitmap texture object of the given dimensions.
- * @param[in] width       The width (pixels)
- * @param[in] height      The height (pixels)
- * @param[in] pixelFormat The pixel format
- * @param[in] clearPixels True if the pixel data should be cleared first
- * @param[in] context The GL context
- */
-Internal::Texture* NewBitmapTexture( unsigned int      width,
-                                     unsigned int      height,
-                                     Pixel::Format     pixelFormat,
-                                     bool              clearPixels,
-                                     Context&          context,
-                                     ResourcePolicy::Discardable discardPolicy );
-
-/**
- * Creates a texture object from a native image (eg.: EGLImage).
- * @param[in] nativeImage The native image to load
- * @param[in] context The GL context
- * @return A newly allocated texture
- */
-Internal::Texture* NewNativeImageTexture( NativeImageInterface& nativeImage, Context& context );
-
-/**
- * @copydoc FrameBufferTexture::FrameBufferTexture
- * @return A newly allocated texture
- */
-Internal::Texture* NewFrameBufferTexture( unsigned int width,
-                                          unsigned int height,
-                                          Pixel::Format pixelFormat,
-                                          RenderBuffer::Format bufferFormat,
-                                          Context& context );
-
-/**
- * @copydoc FrameBufferTexture::FrameBufferTexture
- * @return A newly allocated texture
- */
-Internal::Texture* NewFrameBufferTexture( NativeImageInterfacePtr nativeImage, Context& context );
-
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_TEXTURE_FACTORY_H__
diff --git a/dali/internal/render/gl-resources/texture-observer.h b/dali/internal/render/gl-resources/texture-observer.h
deleted file mode 100644 (file)
index 0c8d6a9..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef __DALI_INTERNAL_TEXTURE_OBSERVER_H__
-#define __DALI_INTERNAL_TEXTURE_OBSERVER_H__
-
-/*
- * 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.
- *
- */
-
-namespace Dali
-{
-namespace Internal
-{
-
-/**
- * The TextureObserver observes texture lifetime
- */
-class TextureObserver
-{
-public:
-  /**
-   * Called when a texture is discarded. This occurs in the render thread.
-   * @param[in] textureId The resource id of the discarded texture
-   */
-  virtual void TextureDiscarded( unsigned int textureId ) = 0;
-
-protected:
-  /**
-   * Virtual destructor
-   */
-  virtual ~TextureObserver(){}
-};
-
-}//Internal
-}//Dali
-
-#endif // __DALI_INTERNAL_TEXTURE_OBSERVER_H__
index 2799893..6281d9b 100644 (file)
@@ -78,7 +78,7 @@ void FrameBuffer::Initialize(Context& context)
   context.BindFramebuffer( GL_FRAMEBUFFER, 0 );
 }
 
-void FrameBuffer::AttachColorTexture( Context& context, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int layer )
+void FrameBuffer::AttachColorTexture( Context& context, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer )
 {
   context.BindFramebuffer( GL_FRAMEBUFFER, mId );
 
index 9240c69..00d2996 100644 (file)
@@ -30,7 +30,7 @@ namespace Internal
 {
 namespace Render
 {
-class NewTexture;
+class Texture;
 
 class FrameBuffer
 {
@@ -73,7 +73,7 @@ public:
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
    */
-  void AttachColorTexture( Context& context, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int layer );
+  void AttachColorTexture( Context& context, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer );
 
   /**
    * @brief Bind the framebuffer
index d271c71..c353daf 100644 (file)
@@ -25,8 +25,6 @@
 #include <dali/internal/render/shaders/scene-graph-shader.h>
 #include <dali/internal/render/shaders/program.h>
 #include <dali/internal/render/data-providers/node-data-provider.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
-#include <dali/internal/render/gl-resources/gl-texture.h>
 
 namespace Dali
 {
@@ -135,7 +133,6 @@ Renderer::Renderer( SceneGraph::RenderDataProvider* dataProvider,
                     StencilParameters& stencilParameters )
 : mRenderDataProvider( dataProvider ),
   mContext( NULL),
-  mTextureCache( NULL ),
   mGeometry( geometry ),
   mUniformIndexMap(),
   mAttributesLocation(),
@@ -161,10 +158,9 @@ Renderer::Renderer( SceneGraph::RenderDataProvider* dataProvider,
   }
 }
 
-void Renderer::Initialize( Context& context, SceneGraph::TextureCache& textureCache )
+void Renderer::Initialize( Context& context )
 {
   mContext = &context;
-  mTextureCache = &textureCache;
 }
 
 Renderer::~Renderer()
@@ -177,7 +173,7 @@ void Renderer::SetRenderDataProvider( SceneGraph::RenderDataProvider* dataProvid
   mUpdateAttributesLocation = true;
 
   //Check that the number of textures match the number of samplers in the shader
-  size_t textureCount =  dataProvider->GetNewTextures().size();
+  size_t textureCount =  dataProvider->GetTextures().size();
   Program* program = dataProvider->GetShader().GetProgram();
   if( program && program->GetActiveSamplerCount() != textureCount )
   {
@@ -364,19 +360,19 @@ void Renderer::SetUniformFromProperty( BufferIndex bufferIndex, Program& program
   }
 }
 
-bool Renderer::BindTextures( Context& context, SceneGraph::TextureCache& textureCache, Program& program )
+bool Renderer::BindTextures( Context& context, Program& program )
 {
   unsigned int textureUnit = 0;
   bool result = true;
 
   GLint uniformLocation(-1);
   std::vector<Render::Sampler*>& samplers( mRenderDataProvider->GetSamplers() );
-  std::vector<Render::NewTexture*>& newTextures( mRenderDataProvider->GetNewTextures() );
-  for( size_t i(0); i<newTextures.size() && result; ++i )
+  std::vector<Render::Texture*>& textures( mRenderDataProvider->GetTextures() );
+  for( size_t i(0); i<textures.size() && result; ++i )
   {
-    if( newTextures[i] )
+    if( textures[i] )
     {
-      result = newTextures[i]->Bind(context, textureUnit, samplers[i] );
+      result = textures[i]->Bind(context, textureUnit, samplers[i] );
       if( result && program.GetSamplerUniformLocation( i, uniformLocation ) )
       {
         program.SetUniform1i( uniformLocation, textureUnit );
@@ -529,7 +525,6 @@ StencilOperation::Type Renderer::GetStencilOperationOnZPass() const
 }
 
 void Renderer::Render( Context& context,
-                       SceneGraph::TextureCache& textureCache,
                        BufferIndex bufferIndex,
                        const SceneGraph::NodeDataProvider& node,
                        SceneGraph::Shader& defaultShader,
@@ -563,7 +558,7 @@ void Renderer::Render( Context& context,
   // Take the program into use so we can send uniforms to it
   program->Use();
 
-  if( DALI_LIKELY( BindTextures( context, textureCache, *program ) ) )
+  if( DALI_LIKELY( BindTextures( context, *program ) ) )
   {
     // Only set up and draw if we have textures and they are all valid
 
index 2ce3538..4a3ef30 100644 (file)
@@ -45,7 +45,6 @@ namespace SceneGraph
 {
 class SceneController;
 class Shader;
-class TextureCache;
 class NodeDataProvider;
 }
 
@@ -164,9 +163,8 @@ public:
    * Second-phase construction.
    * This is called when the renderer is inside render thread
    * @param[in] context Context used by the renderer
-   * @param[in] textureCache The texture cache to use
    */
-  void Initialize( Context& context, SceneGraph::TextureCache& textureCache );
+  void Initialize( Context& context );
 
   /**
    * Destructor
@@ -345,7 +343,6 @@ public:
   /**
    * Called to render during RenderManager::Render().
    * @param[in] context The context used for rendering
-   * @param[in] textureCache The texture cache used to get textures
    * @param[in] bufferIndex The index of the previous update buffer.
    * @param[in] node The node using this renderer
    * @param[in] defaultShader in case there is no custom shader
@@ -356,7 +353,6 @@ public:
    * @param[in] blend If true, blending is enabled
    */
   void Render( Context& context,
-               SceneGraph::TextureCache& textureCache,
                BufferIndex bufferIndex,
                const SceneGraph::NodeDataProvider& node,
                SceneGraph::Shader& defaultShader,
@@ -412,18 +408,16 @@ private:
   /**
    * Bind the textures and setup the samplers
    * @param[in] context The GL context
-   * @param[in] textureCache The texture cache
    * @param[in] program The shader program
    * @return False if create or bind failed, true if success.
    */
-  bool BindTextures( Context& context, SceneGraph::TextureCache& textureCache, Program& program );
+  bool BindTextures( Context& context, Program& program );
 
 private:
 
   OwnerPointer< SceneGraph::RenderDataProvider > mRenderDataProvider;
 
   Context*                     mContext;
-  SceneGraph::TextureCache*    mTextureCache;
   Render::Geometry*            mGeometry;
 
   struct UniformIndexMap
index e612537..e6e262b 100644 (file)
@@ -589,7 +589,7 @@ bool IsCompressedFormat(Pixel::Format pixelFormat)
 } //Unnamed namespace
 
 
-NewTexture::NewTexture( Type type, Pixel::Format format, unsigned int width, unsigned int height )
+Texture::Texture( Type type, Pixel::Format format, unsigned int width, unsigned int height )
 :mId( 0 ),
  mTarget( (type == TextureType::TEXTURE_2D)? GL_TEXTURE_2D : GL_TEXTURE_CUBE_MAP ),
  mType( type ),
@@ -605,7 +605,7 @@ NewTexture::NewTexture( Type type, Pixel::Format format, unsigned int width, uns
   PixelFormatToGl( format, mPixelDataType, mInternalFormat );
 }
 
-NewTexture::NewTexture( NativeImageInterfacePtr nativeImageInterface )
+Texture::Texture( NativeImageInterfacePtr nativeImageInterface )
 :mId( 0 ),
  mTarget( GL_TEXTURE_2D ),
  mType( TextureType::TEXTURE_2D ),
@@ -620,10 +620,10 @@ NewTexture::NewTexture( NativeImageInterfacePtr nativeImageInterface )
 {
 }
 
-NewTexture::~NewTexture()
+Texture::~Texture()
 {}
 
-void NewTexture::Destroy( Context& context )
+void Texture::Destroy( Context& context )
 {
   if( mId )
   {
@@ -636,12 +636,12 @@ void NewTexture::Destroy( Context& context )
   }
 }
 
-void NewTexture::GlContextDestroyed()
+void Texture::GlContextDestroyed()
 {
   mId = 0u;
 }
 
-void NewTexture::Initialize(Context& context)
+void Texture::Initialize(Context& context)
 {
   if( mNativeImage )
   {
@@ -717,7 +717,7 @@ void NewTexture::Initialize(Context& context)
   }
 }
 
-void NewTexture::Upload( Context& context, PixelDataPtr pixelData, const Internal::NewTexture::UploadParams& params  )
+void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::Texture::UploadParams& params  )
 {
   DALI_ASSERT_ALWAYS( mNativeImage == NULL );
 
@@ -797,7 +797,7 @@ void NewTexture::Upload( Context& context, PixelDataPtr pixelData, const Interna
   delete[] tempBuffer;
 }
 
-bool NewTexture::Bind( Context& context, unsigned int textureUnit, Render::Sampler* sampler )
+bool Texture::Bind( Context& context, unsigned int textureUnit, Render::Sampler* sampler )
 {
   if( mNativeImage && mId == 0 )
   {
@@ -821,7 +821,7 @@ bool NewTexture::Bind( Context& context, unsigned int textureUnit, Render::Sampl
   return false;
 }
 
-void NewTexture::ApplySampler( Context& context, Render::Sampler* sampler )
+void Texture::ApplySampler( Context& context, Render::Sampler* sampler )
 {
   Render::Sampler oldSampler = mSampler;
   mSampler = sampler ? *sampler : Sampler();
@@ -863,12 +863,12 @@ void NewTexture::ApplySampler( Context& context, Render::Sampler* sampler )
   }
 }
 
-bool NewTexture::HasAlphaChannel()
+bool Texture::HasAlphaChannel()
 {
   return mHasAlpha;
 }
 
-void NewTexture::GenerateMipmaps( Context& context )
+void Texture::GenerateMipmaps( Context& context )
 {
   context.BindTexture( mTarget, mId );
   context.GenerateMipmap( mTarget );
index 2833a4d..db5988b 100644 (file)
@@ -27,7 +27,6 @@
 #include <dali/internal/render/gl-resources/context.h>
 #include <dali/internal/render/renderers/render-sampler.h>
 #include <dali/integration-api/gl-defines.h>
-#include <dali/integration-api/resource-declarations.h>
 
 namespace Dali
 {
@@ -37,67 +36,10 @@ namespace Render
 {
 struct Sampler;
 
-/**
- * This class is the mapping between texture id, sampler and sampler uniform name
- */
 class Texture
 {
 public:
 
-  /**
-   * Constructor
-   */
-  Texture()
-  : mSampler( 0 ),
-    mTextureId( Integration::InvalidResourceId )
-  {}
-
-  /**
-   * Constructor
-   */
-  Texture( Integration::ResourceId textureId, Render::Sampler* sampler )
-  : mSampler( sampler ),
-    mTextureId( textureId)
-  {}
-
-  /**
-   * Destructor
-   */
-  ~Texture()
-  {}
-
-  /*
-   * Get the Render::Sampler used by the texture
-   * @Return The Render::Sampler being used or 0 if using the default
-   */
-  inline const Render::Sampler* GetSampler() const
-  {
-    return mSampler;
-  }
-
-public: // called from RenderThread
-
-  /**
-   * Get the texture ID
-   * @return the id of the associated texture
-   */
-  inline Integration::ResourceId GetTextureId() const
-  {
-    return mTextureId;
-  }
-
-private:
-
-  Render::Sampler*        mSampler;
-  Integration::ResourceId mTextureId;
-};
-
-
-//TODO : Remove the old Render::Texture class (see above) once it is no longer needed by Image
-class NewTexture
-{
-public:
-
   typedef Dali::TextureType::Type Type;
 
   /**
@@ -107,18 +49,18 @@ public:
    * @param[in] width The width of the texture
    * @param[in] height The height of the texture
    */
-  NewTexture( Type type, Pixel::Format format, unsigned int width, unsigned int height );
+  Texture( Type type, Pixel::Format format, unsigned int width, unsigned int height );
 
   /**
    * Constructor from native image
    * @param[in] nativeImageInterface The native image
    */
-  NewTexture( NativeImageInterfacePtr nativeImageInterface );
+  Texture( NativeImageInterfacePtr nativeImageInterface );
 
   /**
    * Destructor
    */
-  ~NewTexture();
+  ~Texture();
 
   /**
    * Creates the texture in the GPU.
@@ -144,7 +86,7 @@ public:
    * @param[in] pixelData A pixel data object
    * @param[in] params Upload parameters. See UploadParams
    */
-  void Upload( Context& context, PixelDataPtr pixelData, const Internal::NewTexture::UploadParams& params );
+  void Upload( Context& context, PixelDataPtr pixelData, const Internal::Texture::UploadParams& params );
 
   /**
    * Bind the texture to the given texture unit and applies the given sampler
index d365753..85230ba 100644 (file)
 // INTERNAL INCLUDES
 #include <dali/integration-api/gl-defines.h>
 #include <dali/internal/common/shader-saver.h>
-#include <dali/internal/render/common/texture-uploaded-dispatcher.h>
 #include <dali/internal/render/gl-resources/gl-call-debug.h>
 #include <dali/internal/render/shaders/program.h>
-#include <dali/internal/update/resources/resource-manager-declarations.h>
 
 namespace Dali
 {
diff --git a/dali/internal/update/common/texture-cache-dispatcher.cpp b/dali/internal/update/common/texture-cache-dispatcher.cpp
deleted file mode 100644 (file)
index bf17c06..0000000
+++ /dev/null
@@ -1,246 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/update/common/texture-cache-dispatcher.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/render/queue/render-queue.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-// value types used by messages
-template <> struct ParameterType< Pixel::Format > : public BasicType< Pixel::Format > {};
-template <> struct ParameterType< RenderBuffer::Format > : public BasicType< RenderBuffer::Format > {};
-
-namespace SceneGraph
-{
-
-TextureCacheDispatcher::TextureCacheDispatcher( RenderQueue& renderQueue, TextureCache& textureCache )
-: mRenderQueue( renderQueue ),
-  mTextureCache( textureCache ),
-  mSceneGraphBuffers(NULL)
-{
-}
-
-TextureCacheDispatcher::~TextureCacheDispatcher()
-{
-}
-
-void TextureCacheDispatcher::SetBufferIndices( const SceneGraphBuffers* bufferIndices )
-{
-  mSceneGraphBuffers = bufferIndices;
-}
-
-/********************************************************************************
- **********************  Implements TextureCacheDispatcher  *********************
- ********************************************************************************/
-
-void TextureCacheDispatcher::DispatchCreateTexture( ResourceId        id,
-                                                    unsigned int      width,
-                                                    unsigned int      height,
-                                                    Pixel::Format     pixelFormat,
-                                                    bool              clearPixels )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue5< TextureCache, ResourceId, unsigned int, unsigned int, Pixel::Format, bool > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::CreateTexture, id, width, height, pixelFormat, clearPixels );
-  }
-}
-
-void TextureCacheDispatcher::DispatchCreateTextureForBitmap( ResourceId id, Integration::Bitmap* bitmap )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue2< TextureCache, ResourceId, Integration::BitmapPtr > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::AddBitmap, id, bitmap );
-  }
-}
-
-void TextureCacheDispatcher::DispatchCreateTextureForNativeImage( ResourceId id, NativeImageInterfacePtr nativeImage )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue2< TextureCache, ResourceId, NativeImageInterfacePtr > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::AddNativeImage, id, nativeImage );
-  }
-}
-
-void TextureCacheDispatcher::DispatchCreateGlTexture( ResourceId id )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue1< TextureCache, ResourceId > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::CreateGlTexture, id );
-  }
-}
-
-void TextureCacheDispatcher::DispatchCreateTextureForFrameBuffer( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue5< TextureCache, ResourceId, unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::AddFrameBuffer, id, width, height, pixelFormat, bufferFormat );
-  }
-}
-
-void TextureCacheDispatcher::DispatchCreateTextureForFrameBuffer( ResourceId id, NativeImageInterfacePtr nativeImage )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue2< TextureCache, ResourceId, NativeImageInterfacePtr > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::AddFrameBuffer, id, nativeImage );
-  }
-}
-
-void TextureCacheDispatcher::DispatchUpdateTexture( ResourceId id, Integration::Bitmap* bitmap )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue2< TextureCache, ResourceId, Integration::BitmapPtr > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::UpdateTexture, id, bitmap );
-  }
-}
-
-void TextureCacheDispatcher::DispatchUpdateTexture( ResourceId id, Integration::BitmapPtr bitmap , std::size_t xOffset, std::size_t yOffset)
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue4< TextureCache, ResourceId, Integration::BitmapPtr, std::size_t, std::size_t > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::UpdateTexture, id, bitmap, xOffset, yOffset );
-  }
-}
-
-void TextureCacheDispatcher::DispatchUpdateTexture( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue4< TextureCache, ResourceId, ResourceId, std::size_t, std::size_t > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::UpdateTexture, destId, srcId, xOffset, yOffset );
-  }
-}
-
-void TextureCacheDispatcher::DispatchUpdateTexture( ResourceId id, PixelDataPtr pixelData , std::size_t xOffset, std::size_t yOffset)
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue4< TextureCache, ResourceId, PixelDataPtr, std::size_t, std::size_t > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::UpdateTexture, id, pixelData, xOffset, yOffset );
-  }
-}
-
-void TextureCacheDispatcher::DispatchUpdateTextureArea( ResourceId id, const Dali::RectArea& area )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue2< TextureCache, ResourceId, Dali::RectArea > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::UpdateTextureArea, id, area );
-  }
-}
-
-void TextureCacheDispatcher::DispatchDiscardTexture( ResourceId id )
-{
-  // NULL, means being shutdown, so ignore msgs
-  if( mSceneGraphBuffers != NULL )
-  {
-    typedef MessageValue1< TextureCache, ResourceId > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mRenderQueue.ReserveMessageSlot( mSceneGraphBuffers->GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &mTextureCache, &TextureCache::DiscardTexture, id );
-  }
-}
-
-} // SceneGraph
-
-} // Internal
-
-} // Dali
diff --git a/dali/internal/update/common/texture-cache-dispatcher.h b/dali/internal/update/common/texture-cache-dispatcher.h
deleted file mode 100644 (file)
index d77d40c..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-#ifndef __DALI_INTERNAL_TEXTURE_CACHE_DISPATCHER_H__
-#define __DALI_INTERNAL_TEXTURE_CACHE_DISPATCHER_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 <stdint.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/buffer-image.h>
-#include <dali/public-api/images/frame-buffer-image.h>
-#include <dali/public-api/images/native-image-interface.h>
-#include <dali/public-api/images/pixel.h>
-#include <dali/internal/common/message.h>
-#include <dali/internal/event/images/pixel-data-impl.h>
-#include <dali/internal/update/common/scene-graph-buffers.h>
-#include <dali/integration-api/resource-declarations.h>
-#include <dali/integration-api/bitmap.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-typedef Integration::ResourceId ResourceId;
-
-namespace SceneGraph
-{
-
-class RenderQueue;
-class TextureCache;
-
-class TextureCacheDispatcher
-{
-public:
-
-  /**
-   * Constructor
-   * @param[in] renderQueue The queue on which to send messages
-   * @param[in] textureCache The Texture Cache object to which to send messages
-   */
-  TextureCacheDispatcher( RenderQueue& renderQueue, TextureCache& textureCache );
-
-  /**
-   * Destructor.
-   */
-  ~TextureCacheDispatcher();
-
-  /**
-   * mRenderQueue needs the update buffer index when any of the dispatch methods are
-   * called. Should really store a functor to get this index, but existing functors
-   * use references. Could heap allocate the functor, but that seems overly wasteful.
-   * Instead, store a pointer to the SceneGraphBuffers object, and call the relevant
-   * function when required. (increases coupling, requires object lifetime management :/ )
-   *
-   * @param[in] bufferIndices Pointer to SceneGraphBuffers object that can query
-   * the current RenderQueue buffer index.
-   */
-  void SetBufferIndices( const SceneGraphBuffers* bufferIndices );
-
-  /**
-   * Dispatch a message to create an empty texture and add it to the texture cache.
-   * May be called from Update thread
-   * @param[in] id Resource Id of the texture
-   * @param[in] width Width of the texture
-   * @param[in] height Height of the texture
-   * @param[in] pixelFormat Pixel format of the texture
-   * @param[in] clearPixels True if the data should be cleared to 0 on creation
-   */
-  void DispatchCreateTexture( ResourceId        id,
-                              unsigned int      width,
-                              unsigned int      height,
-                              Pixel::Format     pixelFormat,
-                              bool              clearPixels );
-
-  /**
-   * Dispatch a message to add a texture for bitmap.
-   * May be called from Update thread
-   * @param[in] id Resource Id of the bitmap
-   * @param[in] bitmap The bitmap
-   */
-  void DispatchCreateTextureForBitmap( ResourceId id, Integration::Bitmap* bitmap );
-
-  /**
-   * Dispatch a message to add a native image to the texture cache
-   * May be called from Update thread
-   * @param[in] id Resource Id of the native image
-   * @param[in] nativeImage The native image
-   */
-  void DispatchCreateTextureForNativeImage( ResourceId id, NativeImageInterfacePtr nativeImage );
-
-  /**
-   * Dispatch a message to create a framebuffer texture and add it to the texture cache
-   * May be called from Update thread
-   * @param[in] id Resource Id of the framebuffer
-   * @param[in] width Width of the framebuffer
-   * @param[in] height Height of the framebuffer
-   * @param[in] pixelFormat Pixel format of the framebuffer
-   */
-  void DispatchCreateTextureForFrameBuffer( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat );
-
-  /**
-   * Dispatch a message to create a framebuffer texture and add it to the texture cache
-   * May be called from Update thread
-   * @param[in] id Resource Id of the framebuffer
-   * @param[in] nativeImage The NativeImage
-   */
-  void DispatchCreateTextureForFrameBuffer( ResourceId id, NativeImageInterfacePtr nativeImage );
-
-  /**
-   * @brief Create GL texture for native image resource.
-   * @param[in] id The resource id.
-   */
-  void DispatchCreateGlTexture( ResourceId id );
-
-  /**
-   * Dispatch a message to update the texture.
-   * May be called from Update thread
-   * @param[in] id Resource Id of the texture
-   * @param[in] bitmap The updated bitmap
-   */
-  void DispatchUpdateTexture( ResourceId id, Integration::Bitmap* bitmap );
-
-  /**
-   * Dispatch a message to update the part of a texture with the bitmap data.
-   * May be called from Update thread
-   * @param[in] destId The ID of the texture to update
-   * @param[in] bitmap The pointer pointing to the source bitmap 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 DispatchUpdateTexture( ResourceId id, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Dispatch a message to update the part of a texture with a newly loaded bitmap
-   * May be called from Update thread
-   * @param[in] destId The ID of the texture to update
-   * @param[in] srcId The resource ID of the source bitmap
-   * @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 DispatchUpdateTexture( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Dispatch a message to update the part of a texture with the pixel data.
-   * May be called from Update thread
-   * @param[in] destId The ID of the texture to update
-   * @param[in] pixelData The pointer pointing to the pixel data 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 DispatchUpdateTexture( ResourceId id, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Dispatch a message to update the texture area
-   * May be called from the Update thread
-   * @param[in] id Resource Id of the texture
-   * @param[in] area The area of the bitmap that has changed
-   */
-  void DispatchUpdateTextureArea( ResourceId id, const RectArea& area );
-
-  /**
-   * Dispatch a message to discard a texture
-   * May be called from Update thread
-   * @param[in] id Resource Id of the texture
-   */
-  void DispatchDiscardTexture( ResourceId id );
-
-protected:
-
-  RenderQueue&             mRenderQueue;
-  TextureCache&            mTextureCache;
-  const SceneGraphBuffers* mSceneGraphBuffers;
-};
-
-} // SceneGraph
-
-} // Internal
-
-} // Dali
-
-#endif // __DALI_INTERNAL_TEXTURE_CACHE_DISPATCHER_H__
index f69b9c5..3cc4027 100644 (file)
@@ -25,7 +25,6 @@
 #include <dali/internal/update/manager/sorted-layers.h>
 #include <dali/internal/update/render-tasks/scene-graph-render-task.h>
 #include <dali/internal/update/rendering/scene-graph-texture-set.h>
-#include <dali/internal/update/resources/resource-manager-declarations.h>
 #include <dali/internal/render/common/render-item.h>
 #include <dali/internal/render/common/render-tracker.h>
 #include <dali/internal/render/common/render-instruction.h>
index 3e2b524..ecdb451 100644 (file)
@@ -91,7 +91,7 @@ public:
    * Whilst iterating through each layer, update the RenderItems ModelView matrices
    *
    * The opaque and transparent render lists are sorted first by depth
-   * index, then by Z (for transparent only), then by shader, texture
+   * index, then by Z (for transparent only), then by shader
    * and geometry. The render algorithm should then work through both
    * lists simultaneously, working through opaque then transparent
    * items at each depth index, resetting the flags appropriately.
index 405d76a..d7f9759 100644 (file)
@@ -25,7 +25,6 @@
 #include <dali/public-api/actors/draw-mode.h>
 #include <dali/public-api/math/matrix.h>
 #include <dali/public-api/math/vector3.h>
-#include <dali/internal/update/resources/resource-manager.h>
 #include <dali/internal/update/nodes/node.h>
 #include <dali/internal/update/animation/scene-graph-constraint-base.h>
 #include <dali/internal/update/nodes/scene-graph-layer.h>
@@ -106,7 +105,6 @@ inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updat
 inline int UpdateNodes( Node& node,
                         int parentFlags,
                         BufferIndex updateBufferIndex,
-                        ResourceManager& resourceManager,
                         RenderQueue& renderQueue,
                         Layer& currentLayer,
                         int inheritedDrawMode )
@@ -171,7 +169,6 @@ inline int UpdateNodes( Node& node,
     cumulativeDirtyFlags |=UpdateNodes( child,
                                         nodeDirtyFlags,
                                         updateBufferIndex,
-                                        resourceManager,
                                         renderQueue,
                                         *layer,
                                         inheritedDrawMode );
@@ -185,7 +182,6 @@ inline int UpdateNodes( Node& node,
  */
 int UpdateNodeTree( Layer& rootNode,
                     BufferIndex updateBufferIndex,
-                    ResourceManager& resourceManager,
                     RenderQueue& renderQueue )
 {
   DALI_ASSERT_DEBUG( rootNode.IsRoot() );
@@ -221,7 +217,6 @@ int UpdateNodeTree( Layer& rootNode,
     cumulativeDirtyFlags |= UpdateNodes( child,
                                          nodeDirtyFlags,
                                          updateBufferIndex,
-                                         resourceManager,
                                          renderQueue,
                                          rootNode,
                                          drawMode );
index 731da13..62f2411 100644 (file)
@@ -27,8 +27,6 @@ namespace Dali
 namespace Internal
 {
 
-class ResourceManager;
-
 namespace SceneGraph
 {
 
@@ -49,13 +47,11 @@ void ConstrainPropertyOwner( PropertyOwner& propertyOwner, BufferIndex updateBuf
  * The inherited properties of each node are recalculated if necessary.
  * @param[in] rootNode The root of a tree of nodes.
  * @param[in] updateBufferIndex The current update buffer index.
- * @param[in] resourceManager The resource manager.
  * @param[in] renderQueue Used to query messages for the next Render.
  * @return The cumulative (ORed) dirty flags for the updated nodes
  */
 int UpdateNodeTree( Layer& rootNode,
                     BufferIndex updateBufferIndex,
-                    ResourceManager& resourceManager,
                     RenderQueue& renderQueue );
 
 } // namespace SceneGraph
index e453fe7..8725481 100644 (file)
@@ -41,7 +41,6 @@
 #include <dali/internal/update/animation/scene-graph-animation.h>
 #include <dali/internal/update/common/discard-queue.h>
 #include <dali/internal/update/common/scene-graph-buffers.h>
-#include <dali/internal/update/common/texture-cache-dispatcher.h>
 #include <dali/internal/update/controllers/render-message-dispatcher.h>
 #include <dali/internal/update/controllers/scene-controller-impl.h>
 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
 #include <dali/internal/update/render-tasks/scene-graph-render-task.h>
 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
 #include <dali/internal/update/rendering/scene-graph-texture-set.h>
-#include <dali/internal/update/resources/resource-manager.h>
 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
 
 #include <dali/internal/render/common/render-instruction-container.h>
 #include <dali/internal/render/common/render-manager.h>
 #include <dali/internal/render/queue/render-queue.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
 #include <dali/internal/render/shaders/scene-graph-shader.h>
 
 // Un-comment to enable node tree debug logging
@@ -124,7 +121,6 @@ struct UpdateManager::Impl
   Impl( NotificationManager& notificationManager,
         CompleteNotificationInterface& animationFinishedNotifier,
         PropertyNotifier& propertyNotifier,
-        ResourceManager& resourceManager,
         DiscardQueue& discardQueue,
         RenderController& renderController,
         RenderManager& renderManager,
@@ -137,7 +133,6 @@ struct UpdateManager::Impl
     animationFinishedNotifier( animationFinishedNotifier ),
     propertyNotifier( propertyNotifier ),
     shaderSaver( NULL ),
-    resourceManager( resourceManager ),
     discardQueue( discardQueue ),
     renderController( renderController ),
     sceneController( NULL ),
@@ -146,8 +141,8 @@ struct UpdateManager::Impl
     renderInstructions( renderManager.GetRenderInstructionContainer() ),
     renderTaskProcessor( renderTaskProcessor ),
     backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
-    taskList( renderMessageDispatcher, resourceManager ),
-    systemLevelTaskList( renderMessageDispatcher, resourceManager ),
+    taskList( renderMessageDispatcher ),
+    systemLevelTaskList( renderMessageDispatcher ),
     root( NULL ),
     systemLevelRoot( NULL ),
     renderers( sceneGraphBuffers, discardQueue ),
@@ -219,7 +214,6 @@ struct UpdateManager::Impl
   CompleteNotificationInterface&      animationFinishedNotifier;     ///< Provides notification to applications when animations are finished.
   PropertyNotifier&                   propertyNotifier;              ///< Provides notification to applications when properties are modified.
   ShaderSaver*                        shaderSaver;                   ///< Saves shader binaries.
-  ResourceManager&                    resourceManager;               ///< resource manager
   DiscardQueue&                       discardQueue;                  ///< Nodes are added here when disconnected from the scene-graph.
   RenderController&                   renderController;              ///< render controller
   SceneControllerImpl*                sceneController;               ///< scene controller
@@ -277,19 +271,16 @@ private:
 UpdateManager::UpdateManager( NotificationManager& notificationManager,
                               CompleteNotificationInterface& animationFinishedNotifier,
                               PropertyNotifier& propertyNotifier,
-                              ResourceManager& resourceManager,
                               DiscardQueue& discardQueue,
                               RenderController& controller,
                               RenderManager& renderManager,
                               RenderQueue& renderQueue,
-                              TextureCacheDispatcher& textureCacheDispatcher,
                               RenderTaskProcessor& renderTaskProcessor )
   : mImpl(NULL)
 {
   mImpl = new Impl( notificationManager,
                     animationFinishedNotifier,
                     propertyNotifier,
-                    resourceManager,
                     discardQueue,
                     controller,
                     renderManager,
@@ -297,7 +288,6 @@ UpdateManager::UpdateManager( NotificationManager& notificationManager,
                     mSceneGraphBuffers,
                     renderTaskProcessor );
 
-  textureCacheDispatcher.SetBufferIndices( &mSceneGraphBuffers );
 }
 
 UpdateManager::~UpdateManager()
@@ -880,14 +870,12 @@ void UpdateManager::UpdateNodes( BufferIndex bufferIndex )
   // And add the renderers to the sorted layers. Start from root, which is also a layer
   mImpl->nodeDirtyFlags = UpdateNodeTree( *( mImpl->root ),
                                           bufferIndex,
-                                          mImpl->resourceManager,
                                           mImpl->renderQueue );
 
   if ( mImpl->systemLevelRoot )
   {
     mImpl->nodeDirtyFlags |= UpdateNodeTree( *( mImpl->systemLevelRoot ),
                                              bufferIndex,
-                                             mImpl->resourceManager,
                                              mImpl->renderQueue );
   }
 }
@@ -901,9 +889,6 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
   //Clear nodes/resources which were previously discarded
   mImpl->discardQueue.Clear( bufferIndex );
 
-  //Grab any loaded resources
-  bool resourceChanged = mImpl->resourceManager.UpdateCache( bufferIndex );
-
   //Process Touches & Gestures
   const bool gestureUpdated = ProcessGestures( bufferIndex, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds );
 
@@ -911,7 +896,6 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
       (mImpl->nodeDirtyFlags & RenderableUpdateFlags) ||    // ..nodes were dirty in previous frame OR
       IsAnimationRunning()                            ||    // ..at least one animation is running OR
       mImpl->messageQueue.IsSceneUpdateRequired()     ||    // ..a message that modifies the scene graph node tree is queued OR
-      resourceChanged                                 ||    // ..one or more resources were updated/changed OR
       gestureUpdated;                                       // ..a gesture property was updated
 
 
@@ -1275,9 +1259,9 @@ void UpdateManager::AddVertexBuffer( Render::Geometry* geometry, Render::Propert
   new (slot) DerivedType( &mImpl->renderManager,  &RenderManager::AddVertexBuffer, geometry, propertyBuffer );
 }
 
-void UpdateManager::AddTexture( Render::NewTexture* texture )
+void UpdateManager::AddTexture( Render::Texture* texture )
 {
-  typedef MessageValue1< RenderManager, Render::NewTexture* > DerivedType;
+  typedef MessageValue1< RenderManager, Render::Texture* > DerivedType;
 
   // Reserve some memory inside the render queue
   unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
@@ -1286,9 +1270,9 @@ void UpdateManager::AddTexture( Render::NewTexture* texture )
   new (slot) DerivedType( &mImpl->renderManager,  &RenderManager::AddTexture, texture );
 }
 
-void UpdateManager::RemoveTexture( Render::NewTexture* texture)
+void UpdateManager::RemoveTexture( Render::Texture* texture)
 {
-  typedef MessageValue1< RenderManager, Render::NewTexture* > DerivedType;
+  typedef MessageValue1< RenderManager, Render::Texture* > DerivedType;
 
   // Reserve some memory inside the render queue
   unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
@@ -1297,9 +1281,9 @@ void UpdateManager::RemoveTexture( Render::NewTexture* texture)
   new (slot) DerivedType( &mImpl->renderManager,  &RenderManager::RemoveTexture, texture );
 }
 
-void UpdateManager::UploadTexture( Render::NewTexture* texture, PixelDataPtr pixelData, const NewTexture::UploadParams& params )
+void UpdateManager::UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
 {
-  typedef MessageValue3< RenderManager, Render::NewTexture*, PixelDataPtr, NewTexture::UploadParams > DerivedType;
+  typedef MessageValue3< RenderManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > DerivedType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
@@ -1308,9 +1292,9 @@ void UpdateManager::UploadTexture( Render::NewTexture* texture, PixelDataPtr pix
   new (slot) DerivedType( &mImpl->renderManager, &RenderManager::UploadTexture, texture, pixelData, params );
 }
 
-void UpdateManager::GenerateMipmaps( Render::NewTexture* texture )
+void UpdateManager::GenerateMipmaps( Render::Texture* texture )
 {
-  typedef MessageValue1< RenderManager, Render::NewTexture* > DerivedType;
+  typedef MessageValue1< RenderManager, Render::Texture* > DerivedType;
 
   // Reserve some memory inside the render queue
   unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
@@ -1341,9 +1325,9 @@ void UpdateManager::RemoveFrameBuffer( Render::FrameBuffer* frameBuffer)
   new (slot) DerivedType( &mImpl->renderManager,  &RenderManager::RemoveFrameBuffer, frameBuffer );
 }
 
-void UpdateManager::AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int layer )
+void UpdateManager::AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer )
 {
-  typedef MessageValue4< RenderManager, Render::FrameBuffer*, Render::NewTexture*, unsigned int, unsigned int > DerivedType;
+  typedef MessageValue4< RenderManager, Render::FrameBuffer*, Render::Texture*, unsigned int, unsigned int > DerivedType;
 
   // Reserve some memory inside the render queue
   unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
index 63ac097..0d91cf3 100644 (file)
@@ -55,7 +55,6 @@ namespace Internal
 class PropertyNotifier;
 class NotificationManager;
 class CompleteNotificationInterface;
-class ResourceManager;
 class TouchResampler;
 
 namespace Render
@@ -77,7 +76,6 @@ class RenderManager;
 class RenderTaskList;
 class RenderTaskProcessor;
 class RenderQueue;
-class TextureCacheDispatcher;
 class PropertyBuffer;
 class TextureSet;
 class Camera;
@@ -99,23 +97,19 @@ public:
    * @param[in] notificationManager This should be notified when animations have finished.
    * @param[in] animationFinishedNotifier The CompleteNotificationInterface that handles animation completions
    * @param[in] propertyNotifier The PropertyNotifier
-   * @param[in] resourceManager The resource manager used to load textures etc.
    * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
    * @param[in] controller After messages are flushed, we request a render from the RenderController.
    * @param[in] renderManager This is responsible for rendering the results of each "update".
    * @param[in] renderQueue Used to queue messages for the next render.
-   * @param[in] textureCacheDispatcher Used for sending messages to texture cache.
    * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
    */
   UpdateManager( NotificationManager& notificationManager,
                  CompleteNotificationInterface& animationFinishedNotifier,
                  PropertyNotifier& propertyNotifier,
-                 ResourceManager& resourceManager,
                  DiscardQueue& discardQueue,
                  Integration::RenderController& controller,
                  RenderManager& renderManager,
                  RenderQueue& renderQueue,
-                 TextureCacheDispatcher& textureCacheDispatcher,
                  RenderTaskProcessor& renderTaskProcessor );
 
   /**
@@ -482,14 +476,14 @@ public:
    * @param[in] texture The texture to add
    * The texture will be owned by RenderManager
    */
-  void AddTexture( Render::NewTexture* texture );
+  void AddTexture( Render::Texture* texture );
 
   /**
    * Removes a texture from the render manager
    * @param[in] texture The texture to remove
    * @post The texture will be destroyed in the render thread
    */
-  void RemoveTexture( Render::NewTexture* texture );
+  void RemoveTexture( Render::Texture* texture );
 
   /**
    * Uploads data to a texture owned by the RenderManager
@@ -497,13 +491,13 @@ public:
    * @param[in] pixelData The pixel data object
    * @param[in] params The parameters for the upload
    */
-  void UploadTexture( Render::NewTexture* texture, PixelDataPtr pixelData, const NewTexture::UploadParams& params );
+  void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
 
   /**
    * Generates mipmaps for a texture owned by the RenderManager
    * @param[in] texture The texture
    */
-  void GenerateMipmaps( Render::NewTexture* texture );
+  void GenerateMipmaps( Render::Texture* texture );
 
   /**
    * Adds a framebuffer to the render manager
@@ -526,7 +520,7 @@ public:
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
    */
-  void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int face );
+  void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, unsigned int mipmapLevel, unsigned int face );
 
 public:
 
@@ -1198,9 +1192,9 @@ inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& ge
   new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
 }
 
-inline void AddTexture( UpdateManager& manager, Render::NewTexture& texture )
+inline void AddTexture( UpdateManager& manager, Render::Texture& texture )
 {
-  typedef MessageValue1< UpdateManager, Render::NewTexture*  > LocalType;
+  typedef MessageValue1< UpdateManager, Render::Texture*  > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
@@ -1209,9 +1203,9 @@ inline void AddTexture( UpdateManager& manager, Render::NewTexture& texture )
   new (slot) LocalType( &manager, &UpdateManager::AddTexture, &texture );
 }
 
-inline void RemoveTexture( UpdateManager& manager, Render::NewTexture& texture )
+inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
 {
-  typedef MessageValue1< UpdateManager, Render::NewTexture*  > LocalType;
+  typedef MessageValue1< UpdateManager, Render::Texture*  > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
@@ -1220,9 +1214,9 @@ inline void RemoveTexture( UpdateManager& manager, Render::NewTexture& texture )
   new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
 }
 
-inline void UploadTextureMessage( UpdateManager& manager, Render::NewTexture& texture, PixelDataPtr pixelData, const NewTexture::UploadParams& params )
+inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
 {
-  typedef MessageValue3< UpdateManager, Render::NewTexture*, PixelDataPtr, NewTexture::UploadParams > LocalType;
+  typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
@@ -1231,9 +1225,9 @@ inline void UploadTextureMessage( UpdateManager& manager, Render::NewTexture& te
   new (slot) LocalType( &manager, &UpdateManager::UploadTexture, &texture, pixelData, params );
 }
 
-inline void GenerateMipmapsMessage( UpdateManager& manager, Render::NewTexture& texture )
+inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
 {
-  typedef MessageValue1< UpdateManager, Render::NewTexture*  > LocalType;
+  typedef MessageValue1< UpdateManager, Render::Texture*  > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
@@ -1265,9 +1259,9 @@ inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& fram
   new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
 }
 
-inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int layer )
+inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, unsigned int mipmapLevel, unsigned int layer )
 {
-  typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::NewTexture*, unsigned int, unsigned int  > LocalType;
+  typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, unsigned int, unsigned int  > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
index 9338377..6704082 100644 (file)
@@ -30,10 +30,9 @@ namespace Internal
 namespace SceneGraph
 {
 
-RenderTaskList::RenderTaskList( RenderMessageDispatcher& renderMessageDispatcher, ResourceManager& resourceManager )
+RenderTaskList::RenderTaskList( RenderMessageDispatcher& renderMessageDispatcher )
 : mNotificationObject( NULL ),
-  mRenderMessageDispatcher( renderMessageDispatcher ),
-  mResourceManager( resourceManager )
+  mRenderMessageDispatcher( renderMessageDispatcher )
 {
 }
 
@@ -47,7 +46,7 @@ void RenderTaskList::AddTask( RenderTask* newTask )
 
   // mRenderTasks container takes ownership
   mRenderTasks.PushBack( newTask );
-  newTask->Initialize( mRenderMessageDispatcher, mResourceManager );
+  newTask->Initialize( mRenderMessageDispatcher );
 }
 
 void RenderTaskList::RemoveTask( RenderTask* task )
index 711d32f..90b84cf 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 namespace Internal
 {
-class ResourceManager;
+
 class CompleteNotificationInterface;
 
 namespace SceneGraph
@@ -48,9 +48,8 @@ public:
   /**
    * Constructor
    * @param renderMessageDispatcher to send messages
-   * @param resourceManager to pass to render tasks
    */
-  RenderTaskList( RenderMessageDispatcher& renderMessageDispatcher, ResourceManager& resourceManager );
+  RenderTaskList( RenderMessageDispatcher& renderMessageDispatcher );
 
   /**
    * Destructor
@@ -104,7 +103,6 @@ private:
 
   CompleteNotificationInterface* mNotificationObject; ///< object to pass in to the complete notification
   RenderMessageDispatcher& mRenderMessageDispatcher; ///< for sending messages to render thread
-  ResourceManager& mResourceManager; ///< The resource manager (render tasks need this)
   RenderTaskContainer mRenderTasks; ///< A container of owned RenderTasks
 
 };
index e6fd9f8..96dfbc9 100644 (file)
@@ -21,7 +21,6 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/math/matrix.h>
 #include <dali/internal/update/controllers/render-message-dispatcher.h>
-#include <dali/internal/update/resources/resource-manager.h>
 #include <dali/internal/update/nodes/node.h>
 #include <dali/internal/render/common/render-instruction.h>
 #include <dali/internal/render/common/render-tracker.h>
@@ -57,10 +56,9 @@ RenderTask::~RenderTask()
   }
 }
 
-void RenderTask::Initialize( RenderMessageDispatcher& renderMessageDispatcher, ResourceManager& resourceManager )
+void RenderTask::Initialize( RenderMessageDispatcher& renderMessageDispatcher )
 {
   mRenderMessageDispatcher = &renderMessageDispatcher;
-  mResourceManager = &resourceManager;
 }
 
 void RenderTask::SetSourceNode( Node* node )
@@ -481,7 +479,6 @@ RenderTask::RenderTask()
   mViewportSize( Vector2::ZERO),
   mClearColor( Dali::RenderTask::DEFAULT_CLEAR_COLOR ),
   mRenderMessageDispatcher( NULL ),
-  mResourceManager( NULL ),
   mRenderSyncTracker( NULL ),
   mSourceNode( NULL ),
   mCameraNode( NULL ),
index 63b2da3..516d993 100644 (file)
@@ -34,7 +34,6 @@ namespace Dali
 namespace Internal
 {
 class FrameBufferTexture;
-class ResourceManager;
 
 namespace Render
 {
@@ -76,9 +75,8 @@ public:
   /**
    * Initialize the render task. Called in update thread
    * @param[in] renderMessageDispatcher to send messages to render thread
-   * @param[in] resourceManager to check and update status of FBOs
    */
-  void Initialize( RenderMessageDispatcher& renderMessageDispatcher, ResourceManager& resourceManager );
+  void Initialize( RenderMessageDispatcher& renderMessageDispatcher );
 
   /**
    * Set the nodes to be rendered.
@@ -372,7 +370,6 @@ public: // Animatable Properties
 
 private:
   RenderMessageDispatcher* mRenderMessageDispatcher;
-  ResourceManager* mResourceManager;
   Render::RenderTracker* mRenderSyncTracker;
   Node* mSourceNode;
   Node* mCameraNode;
index 72bf134..243635f 100644 (file)
@@ -563,12 +563,12 @@ RenderDataProvider* Renderer::NewRenderDataProvider()
 
   if( mTextureSet )
   {
-    size_t textureCount = mTextureSet->GetNewTextureCount();
-    dataProvider->mNewTextures.resize( textureCount );
+    size_t textureCount = mTextureSet->GetTextureCount();
+    dataProvider->mTextures.resize( textureCount );
     dataProvider->mSamplers.resize( textureCount );
     for( unsigned int i(0); i<textureCount; ++i )
     {
-      dataProvider->mNewTextures[i] = mTextureSet->GetNewTexture(i);
+      dataProvider->mTextures[i] = mTextureSet->GetTexture(i);
       dataProvider->mSamplers[i] = mTextureSet->GetTextureSampler(i);
     }
   }
index 96232be..65aa913 100644 (file)
@@ -74,7 +74,7 @@ void TextureSet::SetSampler( size_t index, Render::Sampler* sampler )
   NotifyChangeToRenderers();
 }
 
-void TextureSet::SetTexture( size_t index, Render::NewTexture* texture )
+void TextureSet::SetTexture( size_t index, Render::Texture* texture )
 {
   const size_t textureCount( mTextures.Size() );
   if( textureCount < index + 1 )
index 3665006..fdb52a5 100644 (file)
@@ -27,12 +27,11 @@ namespace Dali
 {
 namespace Internal
 {
-class ResourceManager;
 
 namespace Render
 {
 struct Sampler;
-class NewTexture;
+class Texture;
 }
 namespace SceneGraph
 {
@@ -70,7 +69,7 @@ public:
    * @param[in] index The index of the texture
    * @param[in] texture The texture
    */
-  void SetTexture( size_t index, Render::NewTexture* texture );
+  void SetTexture( size_t index, Render::Texture* texture );
 
   /**
    * Return whether any texture in the texture set has an alpha channel
@@ -104,20 +103,20 @@ public:
   }
 
   /**
-   * Get the number of NewTextures in the texture set
-   * @return The number of NewTextures
+   * Get the number of Textures in the texture set
+   * @return The number of Textures
    */
-  size_t GetNewTextureCount()
+  size_t GetTextureCount()
   {
     return mTextures.Size();
   }
 
   /**
-   * Get the pointer to  a NewTexture in the TextureSet
+   * Get the pointer to  a Texture in the TextureSet
    * @param[in] index The index of the texture in the textures array
-   * @return the pointer to the NewTexture in that position
+   * @return the pointer to the Texture in that position
    */
-  Render::NewTexture* GetNewTexture( size_t index )
+  Render::Texture* GetTexture( size_t index )
   {
     return mTextures[index];
   }
@@ -138,14 +137,14 @@ private:
 private: // Data
 
   Vector< Render::Sampler* >      mSamplers;                    ///< List of samplers used by each texture. Not owned
-  Vector< Render::NewTexture* >   mTextures;                    ///< List of NewTextures. Not owned
+  Vector< Render::Texture* >   mTextures;                    ///< List of Textures. Not owned
   Vector<Renderer*>               mRenderers;                   ///< List of renderers using the TextureSet
   bool                            mHasAlpha;                    ///< if any of the textures has an alpha channel
 };
 
-inline void SetTextureMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, Render::NewTexture* texture )
+inline void SetTextureMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, Render::Texture* texture )
 {
-  typedef MessageValue2< TextureSet, size_t, Render::NewTexture* > LocalType;
+  typedef MessageValue2< TextureSet, size_t, Render::Texture* > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
diff --git a/dali/internal/update/resources/resource-manager-declarations.h b/dali/internal/update/resources/resource-manager-declarations.h
deleted file mode 100644 (file)
index 5b27d0b..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_MANAGER_DECLARATIONS_H__
-#define __DALI_INTERNAL_RESOURCE_MANAGER_DECLARATIONS_H__
-
-/*
- * 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 <dali/devel-api/threading/mutex.h>
-#include <dali/integration-api/resource-cache.h>
-#include <dali/internal/update/common/double-buffered.h>
-#include <dali/public-api/common/dali-vector.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-typedef Integration::ResourceId ResourceId;
-
-/**
- * Post processing required on the resource after the resource has been modified by the render thread
- * Should only be handled by update thread
- */
-
-typedef Dali::Vector< ResourceId > TextureUploadedQueue;
-
-class LockedResourceQueue
-{
-
-public:
-  void PushBack( ResourceId request )
-  {
-    Dali::Mutex::ScopedLock lock( mMutex );
-    mQueue.PushBack( request );
-  }
-
-  bool IsEmpty() const
-  {
-    Dali::Mutex::ScopedLock lock( mMutex );
-    return mQueue.Empty();
-  }
-
-  void SwapQueue( TextureUploadedQueue& list )
-  {
-    Dali::Mutex::ScopedLock lock( mMutex );
-    list.Clear();
-    mQueue.Swap( list );
-  }
-
-private:
-
-  TextureUploadedQueue mQueue;
-  mutable Dali::Mutex mMutex;
-};
-
-
-} // Internal
-} // Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_MANAGER_DECLARATIONS_H__
diff --git a/dali/internal/update/resources/resource-manager.cpp b/dali/internal/update/resources/resource-manager.cpp
deleted file mode 100644 (file)
index 409e9d9..0000000
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/update/resources/resource-manager.h>
-
-// EXTERNAL INCLUDES
-#include <stdio.h>
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/common/map-wrapper.h>
-#include <dali/devel-api/common/set-wrapper.h>
-
-#include <dali/public-api/math/vector2.h>
-#include <dali/public-api/common/dali-vector.h>
-
-#include <dali/integration-api/debug.h>
-
-#include <dali/internal/common/message.h>
-#include <dali/internal/common/image-attributes.h>
-
-#include <dali/internal/event/common/notification-manager.h>
-#include <dali/internal/event/resources/resource-type-path.h>
-
-#include <dali/internal/update/common/discard-queue.h>
-#include <dali/internal/update/common/texture-cache-dispatcher.h>
-#include <dali/internal/update/resources/texture-metadata.h>
-
-#include <dali/internal/render/queue/render-queue.h>
-
-using namespace Dali::Integration;
-
-using Dali::Internal::SceneGraph::DiscardQueue;
-using Dali::Internal::SceneGraph::RenderQueue;
-using Dali::Internal::SceneGraph::TextureCacheDispatcher;
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-typedef std::set<ResourceId>                    LiveRequestContainer;
-typedef LiveRequestContainer::iterator          LiveRequestIter;
-typedef LiveRequestContainer::size_type         LiveRequestSize;
-
-typedef std::map<ResourceId, ResourceTypeId>    DeadRequestContainer;
-typedef DeadRequestContainer::iterator          DeadRequestIter;
-typedef std::pair<ResourceId, ResourceTypeId>   DeadRequestPair;
-
-typedef std::vector<ResourceId>                 NotifyQueue;
-typedef NotifyQueue::iterator                   NotifyQueueIter;
-
-typedef Dali::Vector<TextureMetadata>           TextureMetadataCache;
-typedef TextureMetadataCache::Iterator          TextureMetadataIter;
-
-static inline bool RemoveId( LiveRequestContainer& container, ResourceId id )
-{
-  return container.erase(id) != 0;
-}
-
-struct ResourceManager::ResourceManagerImpl
-{
-  ResourceManagerImpl( PlatformAbstraction& platformAbstraction,
-                       NotificationManager& notificationManager,
-                       SceneGraph::TextureCacheDispatcher& textureCacheDispatcher,
-                       LockedResourceQueue& textureUploadedQueue,
-                       DiscardQueue& discardQueue,
-                       RenderQueue& renderQueue )
-  : mPlatformAbstraction(platformAbstraction),
-    mNotificationManager(notificationManager),
-    mTextureCacheDispatcher(textureCacheDispatcher),
-    mTextureUploadedQueue(textureUploadedQueue),
-    mTextureUploadedProcessingQueue(),
-    mDiscardQueue(discardQueue),
-    mRenderQueue(renderQueue),
-    mNotificationCount(0),
-    cacheUpdated(false)
-  {
-    mTextureMetadata.Reserve( 256 ); // reserve size for metadata to avoid early re-allocs in application startup
-  }
-
-  ~ResourceManagerImpl()
-  {
-  }
-
-  PlatformAbstraction&        mPlatformAbstraction;
-  NotificationManager&        mNotificationManager;
-  TextureCacheDispatcher&     mTextureCacheDispatcher;
-  LockedResourceQueue&        mTextureUploadedQueue;
-  TextureUploadedQueue        mTextureUploadedProcessingQueue;
-  DiscardQueue&               mDiscardQueue; ///< Unwanted resources are added here during UpdateCache()
-  RenderQueue&                mRenderQueue;
-  unsigned int                mNotificationCount;
-  bool                        cacheUpdated; ///< returned by UpdateCache(). Set true in NotifyTickets to indicate a change in a resource
-
-  /**
-   * These containers are used to processs requests, and ResourceCache callbacks.
-   * The live request containers are simply sets of integer resource ids.
-   * The ID of a new request will be placed in the loading container.
-   * If the Ticket is destroyed during the load, the ID will be removed.
-   * If the load fails, the ID will be moved to the failed container.
-   * When the Ticket is notified of the failure, the ID will be removed.
-   * If the load succeeds, the ID will be moved to the new-completed container.
-   * When the Ticket is notified of the completion, the ID will be moved to the old-completed container.
-   * If a Ticket is destroyed after a successful load, the ID will be moved to the dead container.
-   * When the resources are eventually deleted, the ID will be removed from the dead container.
-   */
-  LiveRequestContainer loadingRequests;
-  LiveRequestContainer newCompleteRequests;
-  LiveRequestContainer oldCompleteRequests;
-  LiveRequestContainer newFailedRequests;
-  LiveRequestContainer oldFailedRequests;
-  DeadRequestContainer deadRequests;
-
-  /**
-   * This is the resource cache; metadata of the textures
-   */
-  TextureMetadataCache mTextureMetadata;
-};
-
-ResourceManager::ResourceManager( PlatformAbstraction& platformAbstraction,
-                                  NotificationManager& notificationManager,
-                                  TextureCacheDispatcher& textureCacheDispatcher,
-                                  LockedResourceQueue& resourcePostProcessQueue,
-                                  DiscardQueue& discardQueue,
-                                  RenderQueue& renderQueue )
-{
-  mImpl = new ResourceManagerImpl( platformAbstraction,
-                                   notificationManager,
-                                   textureCacheDispatcher,
-                                   resourcePostProcessQueue,
-                                   discardQueue,
-                                   renderQueue );
-}
-
-ResourceManager::~ResourceManager()
-{
-  delete mImpl;
-}
-
-/********************************************************************************
- ************************ UpdateManager direct interface  ***********************
- ********************************************************************************/
-
-bool ResourceManager::UpdateCache( BufferIndex updateBufferIndex )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::Verbose, "ResourceManager: UpdateCache(bufferIndex:%u)\n", updateBufferIndex);
-
-  // 1) Move unwanted resources to the DiscardQueue
-
-  DiscardDeadResources( updateBufferIndex );
-
-  // 2) Fill the resource cache
-  mImpl->cacheUpdated = false;
-
-  mImpl->mPlatformAbstraction.GetResources(*this);
-
-  return mImpl->cacheUpdated;
-}
-
-/********************************************************************************
- *************************** CoreImpl direct interface  *************************
- ********************************************************************************/
-
-bool ResourceManager::ResourcesToProcess()
-{
-  bool workTodo = false;
-
-  // need to make sure we have passed all the notifications to the event handling side
-  workTodo |= !mImpl->newCompleteRequests.empty();
-  workTodo |= !mImpl->newFailedRequests.empty();
-  // check if there's something still loading
-  workTodo |= !mImpl->loadingRequests.empty();
-
-  return workTodo;
-}
-
-
-/********************************************************************************
- ********************************* Message handlers *****************************
- ********************************************************************************/
-
-void ResourceManager::HandleLoadResourceRequest( ResourceId id, const ResourceTypePath& typePath, LoadResourcePriority priority )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleLoadResourceRequest(id:%u, path:%s, type.id:%d)\n", id, typePath.path.c_str(), typePath.type->id);
-
-  // Add ID to the loading set
-  mImpl->loadingRequests.insert(id);
-
-  // Make the load request last
-  mImpl->mPlatformAbstraction.LoadResource(ResourceRequest(id, *typePath.type, typePath.path, priority));
-}
-
-void ResourceManager::HandleDecodeResourceRequest(
-  ResourceId id,
-  const ResourceTypePath& typePath,
-  RequestBufferPtr buffer,
-  Integration::LoadResourcePriority priority )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleDecodeResourceRequest(id:%u, buffer.size:%u, type.id:%u)\n", id, buffer->GetVector().Size(), typePath.type->id);
-
-  // Add ID to the loading set
-  mImpl->loadingRequests.insert(id);
-
-  // Make the load request, stuffing the buffer of encoded bytes into the same field used when saving resources:
-  mImpl->mPlatformAbstraction.LoadResource(ResourceRequest(id, *typePath.type, "", buffer, priority));
-}
-
-void ResourceManager::HandleAddBitmapImageRequest( ResourceId id, BitmapPtr bitmap )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddBitmapImageRequest(id:%u)\n", id);
-
-  mImpl->oldCompleteRequests.insert(id);
-  mImpl->mTextureMetadata.PushBack( TextureMetadata::New( id, bitmap.Get() ) );
-  mImpl->mTextureCacheDispatcher.DispatchCreateTextureForBitmap( id, bitmap.Get() );
-}
-
-void ResourceManager::HandleAddNativeImageRequest(ResourceId id, NativeImageInterfacePtr nativeImage)
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddNativeImageRequest(id:%u)\n", id);
-
-  mImpl->oldCompleteRequests.insert(id);
-
-  mImpl->mTextureMetadata.PushBack( TextureMetadata::New( id, nativeImage ) );
-  mImpl->mTextureCacheDispatcher.DispatchCreateTextureForNativeImage( id, nativeImage );
-}
-
-void ResourceManager::HandleAddFrameBufferImageRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddFrameBufferImageRequest(id:%u)\n", id);
-
-  mImpl->oldCompleteRequests.insert(id);
-
-  TextureMetadata bitmapMetadata = TextureMetadata::New( id, width, height, Pixel::HasAlpha(pixelFormat) );
-  bitmapMetadata.SetIsFramebuffer(true);
-  mImpl->mTextureMetadata.PushBack( bitmapMetadata );
-
-  mImpl->mTextureCacheDispatcher.DispatchCreateTextureForFrameBuffer( id, width, height, pixelFormat, bufferFormat );
-}
-
-void ResourceManager::HandleAddFrameBufferImageRequest( ResourceId id, NativeImageInterfacePtr nativeImage )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAddFrameBufferImageRequest(id:%u)\n", id);
-
-  mImpl->oldCompleteRequests.insert(id);
-
-  TextureMetadata bitmapMetadata = TextureMetadata::New(id, nativeImage);
-  bitmapMetadata.SetIsNativeImage(true);
-  bitmapMetadata.SetIsFramebuffer(true);
-  mImpl->mTextureMetadata.PushBack( bitmapMetadata );
-
-  mImpl->mTextureCacheDispatcher.DispatchCreateTextureForFrameBuffer( id, nativeImage );
-}
-
-void ResourceManager::HandleAllocateTextureRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat )
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleAllocateTextureRequest(id:%u)\n", id);
-
-  mImpl->oldCompleteRequests.insert(id);
-  // atlas needs metadata as well
-  TextureMetadata bitmapMetadata = TextureMetadata::New( id, width, height, Pixel::HasAlpha(pixelFormat) );
-  mImpl->mTextureMetadata.PushBack( bitmapMetadata );
-
-  mImpl->mTextureCacheDispatcher.DispatchCreateTexture( id, width, height, pixelFormat, true /* true = clear the texture */ );
-}
-
-void ResourceManager::HandleUpdateBitmapAreaRequest( ResourceId textureId, const RectArea& area )
-{
-  if( textureId )
-  {
-    mImpl->mTextureCacheDispatcher.DispatchUpdateTextureArea( textureId, area );
-  }
-}
-
-void ResourceManager::HandleUploadBitmapRequest( ResourceId destId, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset )
-{
-  if( destId && bitmap )
-  {
-    mImpl->mTextureCacheDispatcher.DispatchUpdateTexture( destId, bitmap, xOffset, yOffset );
-  }
-}
-
-void ResourceManager::HandleUploadBitmapRequest( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset )
-{
-  if( destId && srcId )
-  {
-    mImpl->mTextureCacheDispatcher.DispatchUpdateTexture( destId, srcId, xOffset, yOffset );
-  }
-}
-
-void ResourceManager::HandleUploadBitmapRequest( ResourceId destId, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset )
-{
-  if( destId && pixelData )
-  {
-    mImpl->mTextureCacheDispatcher.DispatchUpdateTexture( destId, pixelData, xOffset, yOffset );
-  }
-}
-
-void ResourceManager::HandleReloadResourceRequest( ResourceId id, const ResourceTypePath& typePath, LoadResourcePriority priority, bool resetFinishedStatus )
-{
-  DALI_LOG_INFO( Debug::Filter::gResource, Debug::General, "ResourceManager: HandleReloadRequest(id:%u, path:%s)\n", id, typePath.path.c_str() );
-
-  if( resetFinishedStatus )
-  {
-    if( ! RemoveId( mImpl->newCompleteRequests, id ) )
-    {
-      RemoveId( mImpl->oldCompleteRequests, id );
-    }
-  }
-
-  // ID might be in the loading set
-  LiveRequestIter iter = mImpl->loadingRequests.find( id );
-  if ( iter == mImpl->loadingRequests.end() )
-  {
-    // Add ID to the loading set
-    mImpl->loadingRequests.insert(id);
-  }
-}
-
-void ResourceManager::HandleDiscardResourceRequest( ResourceId deadId, ResourceTypeId typeId )
-{
-  bool wasComplete = false;
-  bool wasLoading = false;
-
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleDiscardResourceRequest(id:%u)\n", deadId);
-
-  // Search for the ID in one of the live containers
-  // IDs are only briefly held in the new-completed or failed containers; check those last
-  // Try removing from the old-completed requests
-  bool foundLiveRequest = wasComplete = RemoveId(mImpl->oldCompleteRequests, deadId);
-
-  // Try removing from the loading requests
-  if (!foundLiveRequest)
-  {
-    foundLiveRequest = wasLoading = RemoveId(mImpl->loadingRequests, deadId);
-  }
-
-  // Try removing from the new completed requests
-  if (!foundLiveRequest)
-  {
-    foundLiveRequest = wasComplete = RemoveId(mImpl->newCompleteRequests, deadId);
-  }
-
-  // Try removing from the new failed requests
-  if (!foundLiveRequest)
-  {
-    foundLiveRequest = RemoveId(mImpl->newFailedRequests, deadId);
-  }
-
-  // Try removing from the old failed requests
-  if (!foundLiveRequest)
-  {
-    foundLiveRequest = RemoveId(mImpl->oldFailedRequests, deadId);
-  }
-
-  // ID should be in one of the live sets
-  if (!foundLiveRequest)
-  {
-    DALI_LOG_WARNING("HandleDiscardResourceRequest: ID should be in one of the live sets!\n");
-  }
-  DALI_ASSERT_DEBUG(foundLiveRequest);
-
-  if (wasComplete)
-  {
-    if(typeId == ResourceBitmap ||
-       typeId == ResourceNativeImage ||
-       typeId == ResourceTargetImage )
-    {
-      // remove the meta data
-
-      TextureMetadataCache::Iterator iter = mImpl->mTextureMetadata.Begin();
-      const TextureMetadataCache::Iterator end = mImpl->mTextureMetadata.End();
-      for( ; iter != end; ++iter )
-      {
-        if( (*iter).GetId() == deadId )
-        {
-          break;
-        }
-      }
-      if( iter != end )
-      {
-        mImpl->mTextureMetadata.Erase( iter );
-      }
-
-      // destroy the texture
-      mImpl->mTextureCacheDispatcher.DispatchDiscardTexture( deadId );
-    }
-    else
-    {
-      // Move ID from completed to dead set
-      mImpl->deadRequests.insert(DeadRequestPair(deadId, typeId));
-    }
-  }
-
-  if (wasLoading)
-  {
-    mImpl->mPlatformAbstraction.CancelLoad(deadId, typeId);
-  }
-}
-
-void ResourceManager::HandleCreateGlTextureRequest(ResourceId id)
-{
-  mImpl->mTextureCacheDispatcher.DispatchCreateGlTexture( id );
-}
-
-/********************************************************************************
- ******************** Update thread object direct interface  ********************
- ********************************************************************************/
-
-bool ResourceManager::IsResourceLoaded( ResourceId id ) const
-{
-  bool loaded = false;
-
-  if( id > 0 )
-  {
-    LiveRequestIter iter = mImpl->newCompleteRequests.find(id);
-    if( iter != mImpl->newCompleteRequests.end() )
-    {
-      loaded = true;
-    }
-    else
-    {
-      iter = mImpl->oldCompleteRequests.find(id);
-      if( iter != mImpl->oldCompleteRequests.end() )
-      {
-        loaded = true;
-      }
-    }
-  }
-
-  return loaded;
-}
-
-bool ResourceManager::HasResourceLoadFailed( ResourceId id ) const
-{
-  bool loadFailed = false;
-
-  if( id > 0 )
-  {
-    LiveRequestIter iter = mImpl->newFailedRequests.find(id);
-    if( iter != mImpl->newFailedRequests.end() )
-    {
-      loadFailed = true;
-    }
-    else
-    {
-      iter = mImpl->oldFailedRequests.find(id);
-      if( iter != mImpl->oldFailedRequests.end() )
-      {
-        loadFailed = true;
-      }
-    }
-  }
-
-  return loadFailed;
-}
-
-void ResourceManager::SetFrameBufferBeenRenderedTo( ResourceId id, bool value )
-{
-  TextureMetadata* metadata = NULL;
-  if( GetTextureMetadata( id, metadata ) )
-  {
-    metadata->SetFrameBufferBeenRenderedTo( value );
-  }
-}
-
-bool ResourceManager::HasFrameBufferBeenRenderedTo( ResourceId id ) const
-{
-  bool retval( false );
-  TextureMetadata* metadata = NULL;
-  if( GetTextureMetadata( id, metadata ) )
-  {
-    retval = metadata->HasFrameBufferBeenRenderedTo();
-  }
-  return retval;
-}
-
-bool ResourceManager::GetTextureMetadata( ResourceId id, TextureMetadata*& metadata ) const
-{
-  if( id > 0 )
-  {
-    const size_t count = mImpl->mTextureMetadata.Count();
-    for( size_t index = 0; index < count; ++index )
-    {
-      if( id == mImpl->mTextureMetadata[ index ].GetId() )
-      {
-        metadata = &mImpl->mTextureMetadata[ index ];
-        return true;
-      }
-    }
-  }
-
-  return false;
-}
-
-/********************************************************************************
- ************************* ResourceCache Implementation  ************************
- ********************************************************************************/
-
-void ResourceManager::LoadResponse( ResourceId id, ResourceTypeId type, ResourcePointer resource, LoadStatus loadStatus )
-{
-  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
-  LiveRequestIter iter = mImpl->loadingRequests.find(id);
-
-  if ( iter != mImpl->loadingRequests.end() )
-  {
-    if( loadStatus == RESOURCE_COMPLETELY_LOADED )
-    {
-      // Remove from the loading set
-      mImpl->loadingRequests.erase(iter);
-
-      // Add the ID to the new-completed set, and store the resource
-      mImpl->newCompleteRequests.insert(id);
-    }
-
-    switch ( type )
-    {
-      case ResourceBitmap:
-      {
-        DALI_ASSERT_DEBUG( loadStatus == RESOURCE_COMPLETELY_LOADED && "Partial results not handled for image loading.\n" );
-        Bitmap* const bitmap = static_cast<Bitmap*>( resource.Get() );
-        if( !bitmap )
-        {
-          DALI_LOG_ERROR( "Missing bitmap in loaded resource with id %u.\n", id );
-          break;
-        }
-        unsigned int bitmapWidth  = bitmap->GetImageWidth();
-        unsigned int bitmapHeight = bitmap->GetImageHeight();
-
-        if( Bitmap::PackedPixelsProfile * packedBitmap = bitmap->GetPackedPixelsProfile() )
-        {
-          bitmapWidth  = packedBitmap->GetBufferWidth();
-          bitmapHeight = packedBitmap->GetBufferHeight();
-        }
-        ImageAttributes attrs = ImageAttributes::New( bitmapWidth, bitmapHeight ); ///!< Issue #AHC01
-
-        // Check for reloaded bitmap
-        TextureMetadataCache::Iterator iter = mImpl->mTextureMetadata.Begin();
-        const TextureMetadataCache::Iterator end = mImpl->mTextureMetadata.End();
-        for( ; iter != end; ++iter )
-        {
-          if( (*iter).GetId() == id )
-          {
-            break;
-          }
-        }
-        if( iter != end )
-        {
-          iter->Update( bitmap );
-          mImpl->mTextureCacheDispatcher.DispatchUpdateTexture( id, bitmap );
-        }
-        else
-        {
-          mImpl->mTextureCacheDispatcher.DispatchCreateTextureForBitmap( id, bitmap );
-          mImpl->mTextureMetadata.PushBack( TextureMetadata::New( id, bitmap ) );
-        }
-
-        break;
-      }
-
-      case ResourceNativeImage:
-      {
-        NativeImageInterfacePtr nativeImg( static_cast<NativeImageInterface*>(resource.Get()) );
-
-        ImageAttributes attrs = ImageAttributes::New(nativeImg->GetWidth(), nativeImg->GetHeight());
-
-        mImpl->mTextureMetadata.PushBack( TextureMetadata::New( id, nativeImg ) );
-        mImpl->mTextureCacheDispatcher.DispatchCreateTextureForNativeImage( id, nativeImg );
-
-        break;
-      }
-
-      case ResourceTargetImage:
-      {
-        break;
-      }
-    }
-
-    // flag that a load has completed and the cache updated
-    mImpl->cacheUpdated = true;
-  }
-  else
-  {
-    // This warning can fire if a cancelled load is forgotten here while already complete on a resource thread:
-    DALI_LOG_WARNING( "Received a notification for an untracked resource: (id:%u, status=%s)\n", id, loadStatus==RESOURCE_LOADING?"LOADING":loadStatus==RESOURCE_PARTIALLY_LOADED?"PARTIAL":"COMPLETE");
-  }
-}
-
-void ResourceManager::LoadFailed(ResourceId id, ResourceFailure failure)
-{
-  DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: LoadFailed(id:%u)\n", id);
-
-  // ID might be in the loading set
-  LiveRequestIter iter = mImpl->loadingRequests.find(id);
-
-  if (iter != mImpl->loadingRequests.end())
-  {
-    // Remove from the loading set
-    mImpl->loadingRequests.erase(iter);
-
-    // Add the ID to the failed set, this will trigger a notification during UpdateTickets
-    mImpl->newFailedRequests.insert(id);
-
-    mImpl->cacheUpdated = true;
-  }
-}
-
-/********************************************************************************
- ********************************* Private Methods  *****************************
- ********************************************************************************/
-
-void ResourceManager::DiscardDeadResources( BufferIndex updateBufferIndex )
-{
-  for (DeadRequestIter iter = mImpl->deadRequests.begin(); iter != mImpl->deadRequests.end(); )
-  {
-    // Erase the item and increment the iterator
-    mImpl->deadRequests.erase(iter++);
-  }
-}
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/update/resources/resource-manager.h b/dali/internal/update/resources/resource-manager.h
deleted file mode 100644 (file)
index 5fe00b5..0000000
+++ /dev/null
@@ -1,574 +0,0 @@
-#ifndef __DALI_INTERNAL_RESOURCE_MANAGER_H__
-#define __DALI_INTERNAL_RESOURCE_MANAGER_H__
-
-/*
- * Copyright (c) 2015 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 <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/image.h>
-#include <dali/public-api/images/frame-buffer-image.h>
-#include <dali/public-api/images/native-image-interface.h>
-#include <dali/public-api/images/buffer-image.h>
-#include <dali/devel-api/common/ref-counted-dali-vector.h>
-
-#include <dali/integration-api/bitmap.h>
-#include <dali/integration-api/platform-abstraction.h>
-#include <dali/integration-api/resource-cache.h>
-
-#include <dali/internal/common/message.h>
-#include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/images/pixel-data-impl.h>
-#include <dali/internal/event/resources/resource-type-path.h>
-#include <dali/internal/update/resources/resource-manager-declarations.h>
-
-namespace Dali
-{
-
-class NativeImageInterface;
-
-namespace Integration
-{
-struct ResourceType;
-}
-
-namespace Internal
-{
-class TextureMetadata;
-class ImageAttributes;
-
-// value types used by messages
-template <> struct ParameterType< Integration::LoadResourcePriority >
-: public BasicType< Integration::LoadResourcePriority > {};
-template <> struct ParameterType< Pixel::Format >
-: public BasicType< Pixel::Format > {};
-template <> struct ParameterType< RenderBuffer::Format >
-: public BasicType< RenderBuffer::Format > {};
-template <> struct ParameterType< Integration::ResourceTypeId >
-: public BasicType< Integration::ResourceTypeId > {};
-
-namespace SceneGraph
-{
-class DiscardQueue;
-class RenderQueue;
-class TextureCacheDispatcher;
-}
-
-class NotificationManager;
-
-/** Raw bytes of a resource laid out exactly as it wouldbe in a file, but in memory. */
-typedef Dali::RefCountedVector<uint8_t> RequestBuffer;
-/** Counting smart pointer for managing a buffer of raw bytes. */
-typedef IntrusivePtr<RequestBuffer> RequestBufferPtr;
-
-/**
- * ResourceManager keeps track of resource loading requests, and caches resources that are loaded.
- * 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.
- *
- * Multi-threading notes:
- * Resources are received from the PlatformAbstraction API during the Core::Render() method, which
- * may be called from a dedicated rendering thread.
- * Loading requests must be made from the application's main thread e.g. when Dali::Image is created.
- */
-class ResourceManager : public Integration::ResourceCache
-{
-public:
-
-  /**
-   * Create a resource manager.
-   * There should exactly one of these objects per Dali Core.
-   * @param[in] platformAbstraction Used to request resources from the native filesystem.
-   * @param[in] notificationManager Used to send NotifyTickets message.
-   * @param[in] textureUploadedProcessResourcesQueue Used for performing post processing on resources
-   * @param[in] discardQueue Used to cleanup nodes & resources when no longer in use.
-   * @param[in] renderQueue Used to queue resource updates until the next Render.
-   */
-  ResourceManager( Integration::PlatformAbstraction& platformAbstraction,
-                   NotificationManager& notificationManager,
-                   SceneGraph::TextureCacheDispatcher& textureCacheDispatcher,
-                   LockedResourceQueue& textureUploadedProcessResourcesQueue,
-                   SceneGraph::DiscardQueue& discardQueue,
-                   SceneGraph::RenderQueue& renderQueue );
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~ResourceManager();
-
-public:
-
-  /********************************************************************************
-   ************************ UpdateManager direct interface  ***********************
-   ********************************************************************************/
-
-  /**
-   * Called to update the resource cache before rendering.
-   * New resources will be added to the cache using PlatformAbstraction::FillResourceCache().
-   * Unwanted resources will be added to the DiscardQueue.
-   * @param[in] updateBufferIndex The current update buffer index.
-   * @return true, if a resource load was completed or failed
-   */
-  bool UpdateCache( BufferIndex updateBufferIndex );
-
-  /********************************************************************************
-   *************************** CoreImpl direct interface  *************************
-   ********************************************************************************/
-
-  /**
-   * Returns whether the Resource Manager is still processing any resource requests.
-   * @return true if still processing, false otherwise.
-   */
-  bool ResourcesToProcess();
-
-  /********************************************************************************
-   ********************************* Message handlers *****************************
-   ********************************************************************************/
-
-  /**
-   * Request a resource from the native filesystem.
-   * @param[in] id The Id of the requested resource
-   * @param[in] typePath The type & path of requested resource.
-   * @param[in] priority The priority of the request. This is ignored if the resource is already being loaded.
-   */
-  void HandleLoadResourceRequest( ResourceId id,
-                                  const ResourceTypePath& typePath,
-                                  Integration::LoadResourcePriority priority );
-
-  /**
-   * Decode a resource from a memory buffer with the semantics of loading.
-   * Notifications of partial completion, success, and failure will happen via
-   * the same loading notification path used for loading from files: Update()
-   * will retrieve loading events in its main loop and notify listeners to its
-   * own loading events, and forward them, still as loading events, to the event
-   * thread via its update queue.
-   * Resource manager and lower levels make no attempt to detect resource
-   * aliases as is done for multiple requests to load the same resource
-   * file, so the caller is responsible for ensuring that it only requests
-   * the decoding of an in-memory resource once and for doing the sharing of the
-   * resulting object itself. Ultimately this responsibility resides with the
-   * application.
-   * @note ! Only Bitmap resources are supported for decoding from memory !
-   * @param[in] id The Id of the requested resource.
-   * @param[in] typePath The type of the requested resource and a path that is ignored.
-   * @param[in] buffer The raw encoded bytes of the resource as they would appear in a file.
-   * @param[in] priority The priority of the request. This is ignored if the resource is already being loaded.
-   */
-  void HandleDecodeResourceRequest( ResourceId id,
-                                    const ResourceTypePath& typePath,
-                                    RequestBufferPtr buffer,
-                                    Integration::LoadResourcePriority priority );
-
-  /**
-   * Injects a bitmap resource (does not require loading).
-   * @pre bitmap has to be initialized
-   * @param[in] id The resource id
-   * @param[in] bitmap an initialized bitmap
-   */
-  void HandleAddBitmapImageRequest(ResourceId id, Integration::BitmapPtr bitmap);
-
-  /**
-   * Add an existing resource to the resource manager.
-   * @param[in] id The resource id
-   * @param [in] resourceData the NativeImageInterface object
-   * @return A ref-counted request object. Keep a copy until the resource is no longer required.
-   */
-  void HandleAddNativeImageRequest( ResourceId id, NativeImageInterfacePtr resourceData );
-
-  /**
-   * Add an existing resource to the resource manager.
-   * @param[in] id The resource id
-   * @param[in] width       width in pixels
-   * @param[in] height      height in pixels
-   * @param[in] pixelFormat Pixel format
-   */
-  void HandleAddFrameBufferImageRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat );
-
-  /**
-   * Add an existing resource to the resource manager.
-   * @param[in] id            The resource id
-   * @param[in] nativeImage   The NativeImage
-   */
-  void HandleAddFrameBufferImageRequest( ResourceId id, NativeImageInterfacePtr nativeImage );
-
-  /**
-   * Allocate a new empty texture.
-   * @param[in] id The resource id
-   * @param[in] width       width in pixels
-   * @param[in] height      height in pixels
-   * @param[in] pixelFormat Pixel format
-   */
-  void HandleAllocateTextureRequest( ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat );
-
-  /**
-   * Update bitmap area request
-   * @param[in] textureId The resource ID of a bitmap-texture to remove.
-   * @param[in] area The updated area. Zero width/height indicates the whole bitmap has been updated
-   */
-  void HandleUpdateBitmapAreaRequest( ResourceId textureId, const RectArea& area );
-
-  /**
-   * Upload a bitmap to a position within a specified texture
-   * @param[in] destId The destination texture ID
-   * @param[in] bitmap The pointer pointing to the bitmap data 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 HandleUploadBitmapRequest( ResourceId destId, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Upload a bitmap to a position within a specified 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 HandleUploadBitmapRequest( ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Upload a pixel buffer to a position within a specified texture
-   * @param[in] destId The destination texture ID
-   * @param[in] pixelData pointer pointing to the pixel data 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 HandleUploadBitmapRequest( ResourceId destId, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset );
-
-  /**
-   * Request reloading a resource from the native filesystem.
-   * @param[in] id The resource id
-   * @param[in] typePath The type & path of the resource
-   * @param[in] priority The priority of the request. This is ignored if the resource is already being refreshed.
-   * @param[in] resetFinishedStatus True if the finished status of the resource id should be reset
-   */
-  void HandleReloadResourceRequest( ResourceId id, const ResourceTypePath& typePath, Integration::LoadResourcePriority priority, bool resetFinishedStatus );
-
-  /**
-   * Resource ticket has been discarded, throw away the actual resource
-   */
-  void HandleDiscardResourceRequest( ResourceId id, Integration::ResourceTypeId typeId );
-
-   /**
-    * @brief Create GL texture for resource.
-    * @param[in] id The resource id.
-    */
-   void HandleCreateGlTextureRequest( ResourceId id );
-
-  /********************************************************************************
-   ******************** Update thread object direct interface  ********************
-   ********************************************************************************/
-
-  /**
-   * Check if a resource has completed loading.
-   * @param[in] id The ID of a bitmap/texture resource.
-   * @return true if the bitmap or texture has finished loading
-   */
-  bool IsResourceLoaded( ResourceId id ) const;
-
-  /**
-   * Check if a resource has failed to load, e.g. file not found, etc.
-   * @param[in] id The ID of a bitmap/texture resource.
-   * @return true if the bitmap or texture has failed to load
-   */
-  bool HasResourceLoadFailed( ResourceId id ) const;
-
-  /**
-   * @param[in] id The ID of a texture resource.
-   * @param[in] value if the FBO has been rendered to
-   */
-  void SetFrameBufferBeenRenderedTo( ResourceId id, bool value );
-
-  /**
-   * @param[in] id The ID of a texture resource.
-   * @return true if the FBO has been rendered to
-   */
-  bool HasFrameBufferBeenRenderedTo( ResourceId id ) const;
-
-  /**
-   * Get texture metadata. This stores meta data about the resource, but
-   * doesn't keep track of the resource
-   * @param id of the texture
-   * @param metadata reference
-   * @return false if metadata does not exist
-   */
-  bool GetTextureMetadata( ResourceId id, TextureMetadata*& metadata ) const;
-
-   /********************************************************************************
-    ************************* ResourceCache Implementation  ************************
-    ********************************************************************************/
-public:
-
-  /**
-   * @copydoc Integration::ResourceCache::LoadResponse
-   */
-  virtual void LoadResponse(ResourceId id, Integration::ResourceTypeId type, Integration::ResourcePointer resource, Integration::LoadStatus loadStatus);
-
-  /**
-   * @copydoc Integration::ResourceCache::LoadFailed
-   */
-  virtual void LoadFailed(ResourceId id, Integration::ResourceFailure failure);
-
-  /********************************************************************************
-   ********************************* Private Methods  *****************************
-   ********************************************************************************/
-
-  /**
-   * Discard all dead resources.
-   * @param[in] updateBufferIndex The current update buffer index.
-   */
-  void DiscardDeadResources( BufferIndex updateBufferIndex );
-
-private:
-
-  // Undefined
-  ResourceManager( const ResourceManager& resourceManager );
-
-  // Undefined
-  ResourceManager& operator=( const ResourceManager& rhs );
-
-private:
-  struct ResourceManagerImpl;
-  ResourceManagerImpl* mImpl;
-};
-
-// Messages sent to resource manager from other threads:
-// These functions are run on other threads and insert messages to be
-// picked-up by the update thread in its main loop and executed on that in
-// submission order.
-
-inline void RequestLoadResourceMessage( EventThreadServices& eventThreadServices,
-                                        ResourceManager& manager,
-                                        ResourceId id,
-                                        const ResourceTypePath& typePath,
-                                        Integration::LoadResourcePriority priority )
-{
-  typedef MessageValue3< ResourceManager, ResourceId, ResourceTypePath, Integration::LoadResourcePriority > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleLoadResourceRequest, id, typePath, priority );
-}
-
-inline void RequestDecodeResourceMessage( EventThreadServices& eventThreadServices,
-                                          ResourceManager& manager,
-                                          const ResourceId id,
-                                          /// We use typePath instead of the raw type for ownership and to enable copying of a concrete type.
-                                          const ResourceTypePath& typePath,
-                                          RequestBufferPtr buffer,
-                                          Integration::LoadResourcePriority priority )
-{
-  typedef MessageValue4< ResourceManager, ResourceId, ResourceTypePath, RequestBufferPtr, Integration::LoadResourcePriority > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleDecodeResourceRequest, id, typePath, buffer, priority );
-}
-
-inline void RequestAddBitmapImageMessage( EventThreadServices& eventThreadServices,
-                                          ResourceManager& manager,
-                                          ResourceId id,
-                                          Integration::Bitmap* resourceData )
-{
-  typedef MessageValue2< ResourceManager, ResourceId, Integration::BitmapPtr > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleAddBitmapImageRequest, id, resourceData );
-}
-
-inline void RequestAddNativeImageMessage( EventThreadServices& eventThreadServices,
-                                          ResourceManager& manager,
-                                          ResourceId id,
-                                          NativeImageInterfacePtr resourceData )
-{
-  typedef MessageValue2< ResourceManager, ResourceId, NativeImageInterfacePtr > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleAddNativeImageRequest, id, resourceData );
-}
-
-inline void RequestAddFrameBufferImageMessage( EventThreadServices& eventThreadServices,
-                                               ResourceManager& manager,
-                                               ResourceId id,
-                                               unsigned int width,
-                                               unsigned int height,
-                                               Pixel::Format pixelFormat,
-                                               RenderBuffer::Format bufferFormat
-                                               )
-{
-  typedef MessageValue5< ResourceManager, ResourceId, unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleAddFrameBufferImageRequest, id, width, height, pixelFormat, bufferFormat );
-}
-
-inline void RequestAddFrameBufferImageMessage( EventThreadServices& eventThreadServices,
-                                               ResourceManager& manager,
-                                               ResourceId id,
-                                               NativeImageInterfacePtr resourceData )
-{
-  typedef MessageValue2< ResourceManager, ResourceId, NativeImageInterfacePtr > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleAddFrameBufferImageRequest, id, resourceData );
-}
-
-inline void RequestAllocateTextureMessage( EventThreadServices& eventThreadServices,
-                                           ResourceManager& manager,
-                                           ResourceId id,
-                                           unsigned int width,
-                                           unsigned int height,
-                                           Pixel::Format pixelFormat)
-{
-  typedef MessageValue4< ResourceManager, ResourceId, unsigned int, unsigned int, Pixel::Format > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleAllocateTextureRequest, id, width, height, pixelFormat );
-}
-
-inline void RequestUpdateBitmapAreaMessage( EventThreadServices& eventThreadServices,
-                                            ResourceManager& manager,
-                                            ResourceId id,
-                                            const Dali::RectArea& area )
-{
-  typedef MessageValue2< ResourceManager, ResourceId, Dali::RectArea > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleUpdateBitmapAreaRequest, id, area );
-}
-
-inline void RequestUploadBitmapMessage( EventThreadServices& eventThreadServices,
-                                        ResourceManager& manager,
-                                        ResourceId destId,
-                                        Integration::BitmapPtr bitmap,
-                                        std::size_t xOffset,
-                                        std::size_t yOffset )
-{
-  typedef MessageValue4< ResourceManager, ResourceId, Integration::BitmapPtr , std::size_t, std::size_t > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleUploadBitmapRequest, destId, bitmap, xOffset, yOffset );
-}
-
-inline void RequestUploadBitmapMessage( EventThreadServices& eventThreadServices,
-                                        ResourceManager& manager,
-                                        ResourceId destId,
-                                        ResourceId srcId,
-                                        std::size_t xOffset,
-                                        std::size_t yOffset )
-{
-  typedef MessageValue4< ResourceManager, ResourceId, ResourceId, std::size_t, std::size_t > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleUploadBitmapRequest, destId, srcId, xOffset, yOffset );
-}
-
-inline void RequestUploadBitmapMessage(EventThreadServices& eventThreadServices,
-                                       ResourceManager& manager,
-                                       ResourceId destId,
-                                       PixelDataPtr pixelData,
-                                       std::size_t xOffset,
-                                       std::size_t yOffset)
-{
-  typedef MessageValue4< ResourceManager, ResourceId, PixelDataPtr , std::size_t, std::size_t > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleUploadBitmapRequest, destId, pixelData, xOffset, yOffset );
-}
-
-inline void RequestReloadResourceMessage( EventThreadServices& eventThreadServices,
-                                          ResourceManager& manager,
-                                          ResourceId id,
-                                          const ResourceTypePath& typePath,
-                                          Integration::LoadResourcePriority priority,
-                                          bool resetFinishedStatus )
-{
-  typedef MessageValue4< ResourceManager, ResourceId, ResourceTypePath, Integration::LoadResourcePriority, bool > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleReloadResourceRequest, id, typePath, priority, resetFinishedStatus );
-}
-
-inline void RequestDiscardResourceMessage( EventThreadServices& eventThreadServices,
-                                           ResourceManager& manager,
-                                           ResourceId id,
-                                           Integration::ResourceTypeId typeId )
-{
-  typedef MessageValue2< ResourceManager, ResourceId, Integration::ResourceTypeId > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleDiscardResourceRequest, id, typeId );
-}
-
-inline void RequestCreateGlTextureMessage( EventThreadServices& eventThreadServices,
-                                           ResourceManager& manager,
-                                           ResourceId id )
-{
-  typedef MessageValue1< ResourceManager, ResourceId > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &ResourceManager::HandleCreateGlTextureRequest, id );
-}
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RESOURCE_MANAGER_H__
diff --git a/dali/internal/update/resources/texture-metadata.h b/dali/internal/update/resources/texture-metadata.h
deleted file mode 100644 (file)
index fbd0492..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-#ifndef __DALI_TEXTURE_METADATA_H__
-#define __DALI_TEXTURE_METADATA_H__
-
-/*
- * Copyright (c) 2015 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 <dali/public-api/common/type-traits.h>
-#include <dali/public-api/images/image-operations.h>
-#include <dali/public-api/images/native-image-interface.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/internal/update/resources/resource-manager-declarations.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-/**
- * Texture metadata.
- */
-class TextureMetadata
-{
-public:
-  /**
-   * Creates a BitmapMetadata object from a native image (eg.: EGLImage).
-   * @param[in] nativeImage The native image to load
-   * @return A newly allocated BitmapMetadata
-   */
-  static TextureMetadata New( ResourceId id, NativeImageInterfacePtr nativeImage )
-  {
-    return TextureMetadata( id, nativeImage->GetWidth(), nativeImage->GetHeight(), nativeImage->RequiresBlending(), ! nativeImage->RequiresBlending() );
-  }
-
-  /**
-   * Creates a new BitmapMetadata object from a Bitmap
-   * @param[in] bitmap The bitmap
-   * @return A newly allocated BitmapMetadata
-   */
-  static TextureMetadata New( ResourceId id, Integration::Bitmap* const bitmap )
-  {
-    return TextureMetadata( id, bitmap->GetImageWidth(), bitmap->GetImageHeight(), Pixel::HasAlpha(bitmap->GetPixelFormat()), bitmap->IsFullyOpaque() );
-  }
-
-  /**
-   * Creates a new BitmapMetadata object
-   * @return A newly allocated BitmapMetadata
-   */
-  static TextureMetadata New( ResourceId id, unsigned int width, unsigned int height, bool hasAlphaChannel )
-  {
-    return TextureMetadata( id, width, height, hasAlphaChannel, !hasAlphaChannel );
-  }
-
-  /**
-   * Default Constructor
-   */
-  TextureMetadata()
-  : mSize( 0, 0 ),
-    mId( 0 ),
-    mHasAlphaChannel( true ),
-    mOpaqueness( false ),
-    mIsNativeImage( false ),
-    mIsFramebuffer( false ),
-    mHasFrameBufferBeenRenderedTo( false )
-  {
-  }
-
-  /**
-   * Constructor
-   */
-  TextureMetadata( ResourceId id, unsigned int width, unsigned int height, bool hasAlphaChannel, bool opaqueness )
-  : mSize( width, height ),
-    mId( id ),
-    mHasAlphaChannel( hasAlphaChannel ),
-    mOpaqueness( opaqueness ),
-    mIsNativeImage( false ),
-    mIsFramebuffer( false ),
-    mHasFrameBufferBeenRenderedTo( false )
-  {
-  }
-
-  /**
-   * As this class is POD, compiler generated copy constructor and assignment operator are ok (bitwise copy)
-   */
-
-  /**
-   * @return the id
-   */
-  ResourceId GetId() const
-  {
-    return mId;
-  }
-
-  /**
-   * Updates the metadata with information from the native image
-   * @param[in] nativeImage The native image that was updated
-   */
-  void Update( NativeImageInterfacePtr nativeImage )
-  {
-    mSize = ImageDimensions( nativeImage->GetWidth(), nativeImage->GetHeight() );
-    mHasAlphaChannel = nativeImage->RequiresBlending();
-    mOpaqueness  = ! mHasAlphaChannel;
-    mIsNativeImage = true;
-  }
-
-  /**
-   * Updates the metadata with information from the bitmap
-   * @param[in] bitmap The bitmap that was updated
-   */
-  void Update( Integration::Bitmap* const bitmap )
-  {
-    mSize = ImageDimensions( bitmap->GetImageWidth(), bitmap->GetImageHeight() );
-    mHasAlphaChannel = Pixel::HasAlpha(bitmap->GetPixelFormat());
-    mOpaqueness  = bitmap->IsFullyOpaque();
-    mIsNativeImage = false;
-  }
-
-  /**
-   * Set the width of image
-   * @param[in] width The width of the image
-   */
-  void SetWidth( unsigned int width )
-  {
-    mSize.SetWidth( width );
-  }
-
-  /**
-   * Return the width of image in pixels.
-   * @return width
-   */
-  unsigned int GetWidth() const
-  {
-    return mSize.GetWidth();
-  }
-
-  /**
-   * Set the height of image
-   * @param[in] height The height of the image in pixels
-   */
-  void SetHeight(unsigned int height)
-  {
-    mSize.SetHeight( height );
-  }
-
-  /**
-   * Return the height of image in pixels.
-   * @return height
-   */
-  unsigned int GetHeight() const
-  {
-    return mSize.GetHeight();
-  }
-
-  /**
-   * Query whether the texture data has an alpha channel.
-   * @return True if the texture data has an alpha channel.
-   */
-  bool HasAlphaChannel() const
-  {
-    return mHasAlphaChannel;
-  }
-
-  /**
-   * Set whether the texture is completely opaque, i.e.
-   * true if all pixels of the texture data are opaque.
-   * @param[in] opaqueness If the alpha channel is set to fully opaque.
-   */
-  void SetOpaqueness( bool opaqueness )
-  {
-    mOpaqueness = opaqueness;
-  }
-
-  /**
-   * Query whether the texture is completely opaque
-   * @return True if all pixels of the texture data are opaque
-   */
-  bool IsFullyOpaque() const
-  {
-    return mOpaqueness;
-  }
-
-  /**
-   * @param isNativeImage flag
-   */
-  void SetIsNativeImage( bool isNativeImage )
-  {
-    mIsNativeImage = isNativeImage;
-  }
-
-  /**
-   * @return isNativeImage flag
-   */
-  bool IsNativeImage() const
-  {
-    return mIsNativeImage;
-  }
-
-  /**
-   * @param isFramebuffer flag
-   */
-  void SetIsFramebuffer( bool isFramebuffer )
-  {
-    mIsFramebuffer = isFramebuffer;
-  }
-
-  /**
-   * @return isFramebuffer flag
-   */
-  bool IsFramebuffer() const
-  {
-    return mIsFramebuffer;
-  }
-
-  /**
-   * @param value if the framebuffer has been rendered to
-   */
-  void SetFrameBufferBeenRenderedTo( bool value )
-  {
-    mHasFrameBufferBeenRenderedTo = value;
-  }
-
-  /**
-   * @return true if the framebuffer has been rendered to
-   */
-  bool HasFrameBufferBeenRenderedTo() const
-  {
-    return mHasFrameBufferBeenRenderedTo;
-  }
-
-private: // Data
-
-  ImageDimensions mSize;              ///< size compressed into 32 bits
-  ResourceId      mId;                ///< Unique resource/texture ID
-  bool            mHasAlphaChannel:1; ///< Pixel format of the contained image data.
-  bool            mOpaqueness:1;      ///< Whether the bitmap was fully opaque when loaded / updated
-  bool            mIsNativeImage:1;   ///< Whether the image is native or not
-  bool            mIsFramebuffer:1;   ///< Whether the image is an FBO
-  bool            mHasFrameBufferBeenRenderedTo:1; /// If the FBO has been rendered to
-
-};
-
-} // namespace Internal
-
-// Allow BitmapMetadataEntry to be treated as a POD type (need to do this in Dali namespace)
-template <> struct TypeTraits< Internal::TextureMetadata > : public BasicTypes< Internal::TextureMetadata > { enum { IS_TRIVIAL_TYPE = true }; };
-
-} // namespace Dali
-
-#endif // __DALI_TEXTURE_METADATA_H__
index 66d9976..af6b8e1 100644 (file)
@@ -69,14 +69,14 @@ void FrameBuffer::AttachColorTexture( Texture& texture, unsigned int mipmapLevel
 {
   if( texture )
   {
-    Internal::NewTexturePtr texturePtr( &GetImplementation( texture ) );
+    Internal::TexturePtr texturePtr( &GetImplementation( texture ) );
     GetImplementation(*this).AttachColorTexture( texturePtr, mipmapLevel, layer );
   }
 }
 
 Texture FrameBuffer::GetColorTexture()
 {
-  Internal::NewTexture* texturePtr = GetImplementation(*this).GetColorTexture();
+  Internal::Texture* texturePtr = GetImplementation(*this).GetColorTexture();
   return Dali::Texture( texturePtr );
 }
 
index 7fc501b..261e597 100644 (file)
@@ -60,7 +60,7 @@ void TextureSet::SetTexture( size_t index, Texture texture )
 {
   if( texture )
   {
-    Internal::NewTexturePtr texturePtr( &GetImplementation( texture ) );
+    Internal::TexturePtr texturePtr( &GetImplementation( texture ) );
     GetImplementation(*this).SetTexture( index, texturePtr );
   }
   else
@@ -71,7 +71,7 @@ void TextureSet::SetTexture( size_t index, Texture texture )
 
 Texture TextureSet::GetTexture( size_t index ) const
 {
-  Internal::NewTexture* texturePtr = GetImplementation(*this).GetTexture( index );
+  Internal::Texture* texturePtr = GetImplementation(*this).GetTexture( index );
   return Dali::Texture( texturePtr );
 }
 
index 1f6325c..79720cf 100644 (file)
@@ -28,13 +28,13 @@ namespace Dali
 
 Texture Texture::New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
 {
-  Internal::NewTexturePtr texture = Internal::NewTexture::New(type, format, width, height );
+  Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height );
   return Texture( texture.Get() );
 }
 
 Texture Texture::New( NativeImageInterface& nativeImageInterface )
 {
-  Internal::NewTexturePtr texture = Internal::NewTexture::New( nativeImageInterface );
+  Internal::TexturePtr texture = Internal::Texture::New( nativeImageInterface );
   return Texture( texture.Get() );
 }
 
@@ -53,7 +53,7 @@ Texture::Texture( const Texture& handle )
 
 Texture Texture::DownCast( BaseHandle handle )
 {
-  return Texture( dynamic_cast<Dali::Internal::NewTexture*>(handle.GetObjectPtr()));
+  return Texture( dynamic_cast<Dali::Internal::Texture*>(handle.GetObjectPtr()));
 }
 
 Texture& Texture::operator=( const Texture& handle )
@@ -92,7 +92,7 @@ unsigned int Texture::GetHeight() const
   return GetImplementation(*this).GetHeight();
 }
 
-Texture::Texture( Internal::NewTexture* pointer )
+Texture::Texture( Internal::Texture* pointer )
 : BaseHandle( pointer )
 {
 }
index ba7b6c8..90bcad5 100644 (file)
@@ -29,7 +29,7 @@ namespace Dali
 
 namespace Internal DALI_INTERNAL
 {
-class NewTexture;
+class Texture;
 }
 
 namespace TextureType
@@ -197,7 +197,7 @@ public:
    * @SINCE_1_1.43
    * @param[in] pointer A pointer to a newly allocated Texture
    */
-  explicit DALI_INTERNAL Texture( Internal::NewTexture* pointer );
+  explicit DALI_INTERNAL Texture( Internal::Texture* pointer );
 };
 
 } //namespace Dali