Changes following "Make TextureSet a non property owner" 53/67453/2
authorFerran Sole <ferran.sole@samsung.com>
Tue, 26 Apr 2016 13:43:20 +0000 (14:43 +0100)
committerFerran Sole <ferran.sole@samsung.com>
Tue, 26 Apr 2016 14:15:54 +0000 (15:15 +0100)
Change-Id: Id3045fd237fac263b309fac51cb39800b3b5ede6

dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.cpp
plugins/dali-script-v8/src/rendering/texture-set-wrapper.cpp
plugins/dali-script-v8/src/rendering/texture-set-wrapper.h

index 94b2382..3f91eeb 100644 (file)
@@ -163,7 +163,7 @@ void AddVertex( Vector< Vector2 >& vertices, unsigned int x, unsigned int y )
   vertices.PushBack( Vector2( x, y ) );
 }
 
-void RegisterStretchProperties( TextureSet& textureSet, const char * uniformName, const NinePatchImage::StretchRanges& stretchPixels, uint16_t imageExtent)
+void RegisterStretchProperties( Renderer& renderer, const char * uniformName, const NinePatchImage::StretchRanges& stretchPixels, uint16_t imageExtent)
 {
   uint16_t prevEnd = 0;
   uint16_t prevFix = 0;
@@ -179,7 +179,7 @@ void RegisterStretchProperties( TextureSet& textureSet, const char * uniformName
 
     std::stringstream uniform;
     uniform << uniformName << "[" << i << "]";
-    textureSet.RegisterProperty( uniform.str(), Vector2( fix, stretch ) );
+    renderer.RegisterProperty( uniform.str(), Vector2( fix, stretch ) );
 
     prevEnd = end;
     prevFix = fix;
@@ -190,7 +190,7 @@ void RegisterStretchProperties( TextureSet& textureSet, const char * uniformName
     prevFix += imageExtent - prevEnd;
     std::stringstream uniform;
     uniform << uniformName << "[" << i << "]";
-    textureSet.RegisterProperty( uniform.str(), Vector2( prevFix, prevStretch ) );
+    renderer.RegisterProperty( uniform.str(), Vector2( prevFix, prevStretch ) );
   }
 }
 
@@ -545,18 +545,18 @@ void NPatchRenderer::ApplyImageToSampler()
       uint16_t stretchWidth = stretchX.GetY() - stretchX.GetX();
       uint16_t stretchHeight = stretchY.GetY() - stretchY.GetX();
 
-      textureSet.RegisterProperty( "uFixed[0]", Vector2::ZERO );
-      textureSet.RegisterProperty( "uFixed[1]", Vector2( stretchX.GetX(), stretchY.GetX()) );
-      textureSet.RegisterProperty( "uFixed[2]", Vector2( mImageSize.GetWidth() - stretchWidth, mImageSize.GetHeight() - stretchHeight ) );
-      textureSet.RegisterProperty( "uStretchTotal", Vector2( stretchWidth, stretchHeight ) );
+      mImpl->mRenderer.RegisterProperty( "uFixed[0]", Vector2::ZERO );
+      mImpl->mRenderer.RegisterProperty( "uFixed[1]", Vector2( stretchX.GetX(), stretchY.GetX()) );
+      mImpl->mRenderer.RegisterProperty( "uFixed[2]", Vector2( mImageSize.GetWidth() - stretchWidth, mImageSize.GetHeight() - stretchHeight ) );
+      mImpl->mRenderer.RegisterProperty( "uStretchTotal", Vector2( stretchWidth, stretchHeight ) );
     }
     else
     {
-      textureSet.RegisterProperty( "uNinePatchFactorsX[0]", Vector2::ZERO );
-      textureSet.RegisterProperty( "uNinePatchFactorsY[0]", Vector2::ZERO );
+      mImpl->mRenderer.RegisterProperty( "uNinePatchFactorsX[0]", Vector2::ZERO );
+      mImpl->mRenderer.RegisterProperty( "uNinePatchFactorsY[0]", Vector2::ZERO );
 
-      RegisterStretchProperties( textureSet, "uNinePatchFactorsX", mStretchPixelsX, mImageSize.GetWidth() );
-      RegisterStretchProperties( textureSet, "uNinePatchFactorsY", mStretchPixelsY, mImageSize.GetHeight() );
+      RegisterStretchProperties( mImpl->mRenderer, "uNinePatchFactorsX", mStretchPixelsX, mImageSize.GetWidth() );
+      RegisterStretchProperties( mImpl->mRenderer, "uNinePatchFactorsY", mStretchPixelsY, mImageSize.GetHeight() );
     }
   }
 }
index 454c966..5296651 100644 (file)
@@ -54,7 +54,7 @@ const unsigned int TextureSetFunctionTableCount = sizeof(TextureSetFunctionTable
 
 
 TextureSetWrapper::TextureSetWrapper( const Dali::TextureSet& textureSet, GarbageCollectorInterface& gc )
-:  HandleWrapper(  BaseWrappedObject::TEXTURE_SET , textureSet, gc )
+:  BaseWrappedObject(  BaseWrappedObject::TEXTURE_SET, gc )
 {
     mTextureSet = textureSet;
 }
@@ -102,9 +102,6 @@ v8::Handle<v8::ObjectTemplate> TextureSetWrapper::MakeTextureSetTemplate( v8::Is
 
   v8::Local<v8::ObjectTemplate> objTemplate = v8::ObjectTemplate::New();
 
-  // property handle intercepts property getters and setters and signals
-  HandleWrapper::AddInterceptsToTemplate( isolate, objTemplate );
-
   objTemplate->SetInternalFieldCount( BaseWrappedObject::FIELD_COUNT );
 
   // add our function properties
index 5826bbf..9e0426a 100644 (file)
@@ -36,7 +36,7 @@ namespace V8Plugin
  * A TextureSet wrapper.
  * Provides access to TextureSet specific functionality and V8 memory handling.
  */
-class TextureSetWrapper : public HandleWrapper
+class TextureSetWrapper : public BaseWrappedObject
 {
 
 public: