Remove model loading and mesh usage 49/36449/1
authorDavid Steele <david.steele@partner.samsung.com>
Tue, 10 Feb 2015 16:09:37 +0000 (16:09 +0000)
committerFrancisco Santos <f1.santos@samsung.com>
Fri, 6 Mar 2015 11:00:22 +0000 (11:00 +0000)
Change-Id: I382cfe016c60e3ae99c61c3b1398fc00408e7711

adaptors/common/indicator-impl.cpp
adaptors/common/indicator-impl.h
adaptors/common/object-profiler.cpp
build/tizen/adaptor/Makefile.am
build/tizen/configure.ac

index 98d8fe9..9784377 100644 (file)
@@ -81,22 +81,6 @@ const char* ELM_INDICATOR_LANDSCAPE("elm_indicator_landscape");
 const char* ELM_INDICATOR_PORTRAIT_FIXED_COLOR_STYLE("elm_indicator_portrait_fixed");
 const char* ELM_INDICATOR_LANDSCAPE_FIXED_COLOR_STYLE("elm_indicator_landscape_fixed");
 
-const char* MESH_VERTEX_SHADER =
-"attribute lowp vec3     aColor;\n"
-"varying   mediump vec4  vColor;\n"
-"void main()\n"
-"{\n"
-"  gl_Position = uMvpMatrix * vec4(aPosition, 1.0);\n"
-"  vColor = vec4(aColor.r, aColor.g, aColor.b, aTexCoord.x);\n"
-"}\n";
-
-const char* MESH_FRAGMENT_SHADER =
-"varying mediump vec4  vColor;\n"
-"void main()\n"
-"{\n"
-"  gl_FragColor = vColor*uColor;\n"
-"}\n";
-
 // Copied from ecore_evas_extn_engine.h
 
 enum // opcodes
@@ -223,30 +207,6 @@ struct IpcDataEvMouseOut
   }
 };
 
-void SetMeshDataColors(Dali::AnimatableMesh mesh, const Vector4 (&colors)[NUM_GRADIENT_INTERVALS+1])
-{
-  for( size_t i=0; i<NUM_GRADIENT_INTERVALS+1; i++ )
-  {
-    int j=i*2;
-    mesh[j].SetColor(colors[i]);
-    mesh[j+1].SetColor(colors[i]);
-    mesh[j].SetTextureCoords(Dali::Vector2(colors[i].a, colors[i].a));
-    mesh[j+1].SetTextureCoords(Dali::Vector2(colors[i].a, colors[i].a));
-  }
-}
-
-void SetMeshDataColors(Dali::AnimatableMesh mesh, const Vector4& color)
-{
-  for( size_t i=0, length=NUM_GRADIENT_INTERVALS+1 ; i<length; i++ )
-  {
-    int j=i*2;
-    mesh[j].SetColor(color);
-    mesh[j+1].SetColor(color);
-    mesh[j].SetTextureCoords(Dali::Vector2(color.a, color.a));
-    mesh[j+1].SetTextureCoords(Dali::Vector2(color.a, color.a));
-  }
-}
-
 } // anonymous namespace
 
 
@@ -381,22 +341,9 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat
   mIndicatorImageActor.SetLeaveRequired( true );
   mIndicatorImageActor.TouchedSignal().Connect( this, &Indicator::OnTouched );
 
-  SetBackground();
-  mBackgroundActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
-  mBackgroundActor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-  mBackgroundActor.SetZ( -0.02f );
-
-  // add background to image actor to move it with indicator image
-  mIndicatorImageActor.Add( mBackgroundActor );
-
   mIndicatorActor = Dali::Actor::New();
   mIndicatorActor.Add( mIndicatorImageActor );
 
-  if( mOrientation == Dali::Window::LANDSCAPE || mOrientation == Dali::Window::LANDSCAPE_INVERSE )
-  {
-    mBackgroundActor.SetVisible( false );
-  }
-
   // Event handler to find out flick down gesture
   mEventActor = Dali::Actor::New();
   mEventActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
@@ -452,16 +399,6 @@ void Indicator::Open( Dali::Window::WindowOrientation orientation )
   DALI_ASSERT_DEBUG( mState == DISCONNECTED );
 
   Connect( orientation );
-
-  // Change background visibility depending on orientation
-  if(mOrientation == Dali::Window::PORTRAIT || mOrientation == Dali::Window::PORTRAIT_INVERSE)
-  {
-    mBackgroundActor.SetVisible(true);
-  }
-  else
-  {
-    mBackgroundActor.SetVisible(false);
-  }
 }
 
 void Indicator::Close()
@@ -776,10 +713,6 @@ void Indicator::Resize( int width, int height )
     mEventActor.SetSize(mImageWidth, mImageHeight);
 
     SetBackground();
-    if( mBackgroundActor )
-    {
-      mBackgroundActor.SetSize( mImageWidth, mImageHeight );
-    }
   }
 }
 
@@ -991,32 +924,6 @@ bool Indicator::CopyToBuffer( int bufferNumber )
 
 void Indicator::SetBackground()
 {
-  if( ! mBackgroundActor )
-  {
-    ConstructBackgroundMesh();
-  }
-
-  switch( mOpacityMode )
-  {
-    case Dali::Window::TRANSLUCENT:
-    {
-      SetMeshDataColors( mBackgroundMesh, GRADIENT_COLORS );
-    }
-    break;
-
-    case Dali::Window::TRANSPARENT:
-    {
-      SetMeshDataColors( mBackgroundMesh, Color::TRANSPARENT );
-    }
-    break;
-
-    case Dali::Window::OPAQUE:
-    default :
-    {
-      SetMeshDataColors( mBackgroundMesh, Color::BLACK );
-    }
-    break;
-  }
 }
 
 void Indicator::CreateNewPixmapImage()
@@ -1032,10 +939,6 @@ void Indicator::CreateNewPixmapImage()
     mEventActor.SetSize(mImageWidth, mImageHeight);
 
     SetBackground();
-    if( mBackgroundActor )
-    {
-      mBackgroundActor.SetSize( mImageWidth, mImageHeight );
-    }
   }
   else
   {
@@ -1208,45 +1111,6 @@ bool Indicator::CheckVisibleState()
   return true;
 }
 
-void Indicator::ConstructBackgroundMesh()
-{
-  // Construct 5 interval mesh
-  // 0  +---+  1
-  //    | \ |
-  // 2  +---+  3
-  //    | \ |
-  // 4  +---+  5
-  //    | \ |
-  // 6  +---+  7
-  //    | \ |
-  // 8  +---+  9
-  //    | \ |
-  // 10 +---+  11
-  Dali::AnimatableMesh::Faces faces;
-  faces.reserve(NUM_GRADIENT_INTERVALS * 6); // 2 tris per interval
-  for(int i=0; i<NUM_GRADIENT_INTERVALS; i++)
-  {
-    int j=i*2;
-    faces.push_back(j); faces.push_back(j+3); faces.push_back(j+1);
-    faces.push_back(j); faces.push_back(j+2); faces.push_back(j+3);
-  }
-
-  mBackgroundMesh = Dali::AnimatableMesh::New((NUM_GRADIENT_INTERVALS+1)*2, faces);
-  float interval=1.0f / (float)NUM_GRADIENT_INTERVALS;
-  for(int i=0;i<NUM_GRADIENT_INTERVALS+1;i++)
-  {
-    int j=i*2;
-    mBackgroundMesh[j  ].SetPosition(Vector3(-0.5f, -0.5f+(interval*(float)i), 0.0f));
-    mBackgroundMesh[j+1].SetPosition(Vector3( 0.5f, -0.5f+(interval*(float)i), 0.0f));
-  }
-
-  mBackgroundActor = Dali::MeshActor::New(mBackgroundMesh);
-  Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( MESH_VERTEX_SHADER, MESH_FRAGMENT_SHADER,
-                                                             GEOMETRY_TYPE_UNTEXTURED_MESH, // Using vertex color
-                                                             Dali::ShaderEffect::HINT_BLENDING );
-  mBackgroundActor.SetShaderEffect(shaderEffect);
-}
-
 void Indicator::ClearSharedFileInfo()
 {
   for( int i = 0; i < SHARED_FILE_NUMBER; i++ )
index d35dd7d..9be5d68 100644 (file)
@@ -20,8 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/actors/mesh-actor.h>
-#include <dali/public-api/geometry/animatable-mesh.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/events/pan-gesture-detector.h>
@@ -411,11 +409,6 @@ private: // Implementation of ServerConnection::Observer
 private:
 
   /**
-   * Construct the gradient mesh
-   */
-  void ConstructBackgroundMesh();
-
-  /**
    * Clear shared file info
    */
   void ClearSharedFileInfo();
@@ -455,8 +448,6 @@ private:
   Dali::Image                      mImage;               ///< Image created from mIndicatorBuffer
   Dali::ImageActor                 mIndicatorImageActor; ///< Actor created from mImage
 
-  Dali::AnimatableMesh             mBackgroundMesh;
-  Dali::MeshActor                  mBackgroundActor;     ///< Actor for background
   Dali::Actor                      mIndicatorActor;      ///< Handle to topmost indicator actor
   Dali::Actor                      mEventActor;          ///< Handle to event
   Dali::PanGestureDetector         mPanDetector;         ///< Pan detector to find flick gesture for hidden indicator
index 464a36a..4acbadb 100644 (file)
@@ -179,10 +179,7 @@ int ObjectProfiler::GetMemorySize(const std::string& name, int count)
       { "CameraActor", CAMERA_ACTOR_MEMORY_SIZE },
       { "ImageActor", IMAGE_ACTOR_MEMORY_SIZE },
       { "TextActor", TEXT_ACTOR_MEMORY_SIZE },
-      { "MeshActor", MESH_ACTOR_MEMORY_SIZE },
       { "Image", IMAGE_MEMORY_SIZE },
-      { "Mesh", MESH_MEMORY_SIZE },
-      { "Material", MATERIAL_MEMORY_SIZE },
     };
 
   for( size_t i=0; i<sizeof(memoryMemorySizes)/sizeof(MemoryMemorySize); i++ )
index bce2054..e76b4fb 100644 (file)
@@ -69,12 +69,6 @@ include ../../../adaptors/public-api/file.list
 
 ############# source files #############
 
-if ASSIMP_ENABLED
-slp_platform_abstraction_src_files += $(slp_assimp_src_files)
-else
-slp_platform_abstraction_src_files += $(slp_assimp_stubs_src_files)
-endif # ASSIMP_ENABLED
-
 # COMMON
 if COMMON_PROFILE
 
@@ -236,7 +230,6 @@ libdali_adaptor_la_CXXFLAGS = \
                       $(LIBDRM_CFLAGS) \
                       $(LIBEXIF_CFLAGS) \
                       $(LIBCURL_CFLAGS) \
-                      $(ASSIMP_CFLAGS) \
                       $(CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS)
 
 libdali_adaptor_la_LIBADD = \
index 6aec94b..ca772fa 100644 (file)
@@ -99,12 +99,6 @@ if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
 fi
 
-AC_ARG_ENABLE([assimp],
-              [AC_HELP_STRING([--enable-assimp],
-                              [Enable assimp plugin, overriding platform defaults])],
-              [enable_assimp=yes],
-              [enable_assimp=no])
-
 AC_ARG_ENABLE([gles],
               [AC_HELP_STRING([--enable-gles],
                               [Specify the OpenGL ES version for backwards compatibility])],
@@ -190,14 +184,6 @@ PKG_CHECK_MODULES(FEEDBACK, feedback)
 PKG_CHECK_MODULES(MMFSOUND, mm-sound)
 fi
 
-if test "x$enable_assimp" = "xyes" ; then
-  PKG_CHECK_MODULES(ASSIMP, assimp)
-  ASSIMP_CFLAGS+=-DASSIMP_ENABLED
-fi
-
-# Don't move this - it depends on the platform defaults above
-AM_CONDITIONAL([ASSIMP_ENABLED], [test x$enable_assimp = xyes])
-
 if test x$DALI_DATA_RW_DIR != x; then
   dataReadWriteDir=$DALI_DATA_RW_DIR
 else
@@ -269,7 +255,6 @@ Configuration
   Prefix:                           $prefix
   Debug Build:                      $enable_debug
   Compile flags                     $DALI_ADAPTOR_CFLAGS
-  Using Assimp Library:             $enable_assimp
   Using JPEG Turbo Library:         $with_jpeg_turbo
   Profile:                          $enable_profile
   Data Dir (Read/Write):            $dataReadWriteDir