Removed unused methods from scene-graph-shader.cpp 95/60295/2
authorDavid Steele <david.steele@samsung.com>
Wed, 24 Feb 2016 21:01:17 +0000 (21:01 +0000)
committerDavid Steele <david.steele@samsung.com>
Mon, 18 Apr 2016 15:36:16 +0000 (16:36 +0100)
Change-Id: Id6d923191f01306a918582a64103ab152e34fe7c
Signed-off-by: David Steele <david.steele@samsung.com>
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/shaders/scene-graph-shader.cpp
dali/internal/render/shaders/scene-graph-shader.h
dali/internal/render/shaders/uniform-meta.h [deleted file]
dali/internal/update/manager/update-manager.cpp

index 8d666b7..b48e1d8 100644 (file)
@@ -22,6 +22,7 @@
 // INTERNAL INCLUDES
 #include <dali/internal/common/image-sampler.h>
 #include <dali/internal/render/gl-resources/context.h>
+#include <dali/internal/render/renderers/render-sampler.h>
 #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>
index bf2dce0..a95600a 100644 (file)
 #include <dali/internal/render/shaders/scene-graph-shader.h>
 
 // INTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 #include <dali/internal/render/queue/render-queue.h>
 #include <dali/internal/render/common/render-debug.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/gl-resources/texture.h>
-#include <dali/internal/render/gl-resources/texture-cache.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
 #include <dali/internal/render/shaders/program.h>
-#include <dali/internal/render/shaders/uniform-meta.h>
 #include <dali/internal/common/image-sampler.h>
 
-// See render-debug.h
-#ifdef DALI_PRINT_RENDER_INFO
-
-#include <sstream>
-#define DALI_DEBUG_OSTREAM(streamName) std::stringstream streamName;
-
-#define DALI_PRINT_UNIFORM(streamName,bufferIndex,name,value) \
-  { \
-    streamName << " " << name << ": " << value; \
-  }
-
-#define DALI_PRINT_CUSTOM_UNIFORM(streamName,bufferIndex,name,property) \
-  { \
-    streamName << " " << name << ": "; \
-    property.DebugPrint( streamName, bufferIndex ); \
-  }
-
-#define DALI_PRINT_SHADER_UNIFORMS(streamName) \
-  { \
-    std::string debugString( streamName.str() ); \
-    DALI_LOG_RENDER_INFO( "           %s\n", debugString.c_str() ); \
-  }
-
-#else // DALI_PRINT_RENDER_INFO
-
-#define DALI_DEBUG_OSTREAM(streamName)
-#define DALI_PRINT_UNIFORM(streamName,bufferIndex,name,value)
-#define DALI_PRINT_CUSTOM_UNIFORM(streamName,bufferIndex,name,property)
-#define DALI_PRINT_SHADER_UNIFORMS(streamName)
-
-#endif // DALI_PRINT_RENDER_INFO
 
 namespace Dali
 {
@@ -67,22 +32,13 @@ namespace Dali
 namespace Internal
 {
 
-template <> struct ParameterType< Dali::ShaderEffect::GeometryHints> : public BasicType< Dali::ShaderEffect::GeometryHints > {};
-template <> struct ParameterType< Dali::ShaderEffect::UniformCoordinateType > : public BasicType< Dali::ShaderEffect::UniformCoordinateType > {};
-
 namespace SceneGraph
 {
 
 Shader::Shader( Dali::ShaderEffect::GeometryHints& hints )
 : mGeometryHints( hints ),
-  mGridDensity( Dali::ShaderEffect::DEFAULT_GRID_DENSITY ),
-  mTexture( NULL ),
-  mRenderTextureId( 0 ),
-  mUpdateTextureId( 0 ),
   mProgram( NULL ),
-  mConnectionObservers(),
-  mRenderQueue( NULL ),
-  mTextureCache( NULL )
+  mConnectionObservers()
 {
   AddUniformMapObserver( *this );
 }
@@ -92,12 +48,6 @@ Shader::~Shader()
   mConnectionObservers.Destroy( *this );
 }
 
-void Shader::Initialize( RenderQueue& renderQueue, TextureCache& textureCache )
-{
-  mRenderQueue = &renderQueue;
-  mTextureCache = &textureCache;
-}
-
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // The following methods are called during RenderManager::Render()
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
index 42b106d..813657b 100644 (file)
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/shader-effects/shader-effect.h>
-
 #include <dali/internal/common/shader-data.h>
-
-#include <dali/internal/common/buffer-index.h>
-#include <dali/internal/common/type-abstraction-enums.h>
-
-#include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/effects/shader-declarations.h>
-
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/common/scene-graph-connection-change-propagator.h>
 
-#include <dali/internal/render/gl-resources/gl-resource-owner.h>
-#include <dali/internal/render/gl-resources/texture-declarations.h>
-
-#include <dali/internal/render/common/render-manager.h>
-
 
 namespace Dali
 {
-
 namespace Internal
 {
 
 class Program;
+class ProgramCache;
 
 namespace SceneGraph
 {
 
-class RenderQueue;
-class UniformMeta;
-class TextureCache;
 class ConnectionObserver;
 class SceneController;
-
 /**
- * A base class for a collection of shader programs, to apply an effect to different geometry types.
- * This class is also the default shader so its easier to override default behaviour
+ * A holder class for Program; also enables sharing of uniform properties
  */
 class Shader : public PropertyOwner, public UniformMap::Observer
 {
@@ -75,13 +56,6 @@ public:
    */
   virtual ~Shader();
 
-  /**
-   * Second stage initialization, called when added to the UpdateManager
-   * @param renderQueue Used to queue messages from update to render thread.
-   * @param textureCache Used to retrieve effect textures when rendering.
-   */
-  void Initialize( RenderQueue& renderQueue, TextureCache& textureCache );
-
   ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
   // The following methods are called during UpdateManager::Update()
   ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -200,21 +174,10 @@ public: // UniformMap::Observer
 private: // Data
 
   Dali::ShaderEffect::GeometryHints mGeometryHints;    ///< shader geometry hints for building the geometry
-  float                          mGridDensity;      ///< grid density
-
-  Texture*                       mTexture;          ///< Raw Pointer to Texture
-  Integration::ResourceId        mRenderTextureId;  ///< Copy of the texture ID for the render thread
-  Integration::ResourceId        mUpdateTextureId;  ///< Copy of the texture ID for update thread
 
   Program*                       mProgram;
 
   ConnectionChangePropagator     mConnectionObservers;
-
-  // These members are only safe to access during UpdateManager::Update()
-  RenderQueue*                   mRenderQueue;                   ///< Used for queuing a message for the next Render
-
-  // These members are only safe to access in render thread
-  TextureCache*                  mTextureCache; // Used for retrieving textures in the render thread
 };
 
 } // namespace SceneGraph
diff --git a/dali/internal/render/shaders/uniform-meta.h b/dali/internal/render/shaders/uniform-meta.h
deleted file mode 100644 (file)
index 7f066d2..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef __DALI_INTERNAL_UNIFORM_META_H__
-#define __DALI_INTERNAL_UNIFORM_META_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 <cstring> // for memcpy & memset
-
-// INTERNAL INCLUDES
-#include <dali/public-api/math/compile-time-math.h>
-#include <dali/public-api/object/property.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
-#include <dali/internal/common/message.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace SceneGraph
-{
-
-class PropertyBase;
-
-/**
- * Holds the metadata associated with a Shader uniform.
- */
-class UniformMeta
-{
-public:
-
-  /**
-   * Create a UniformMeta.
-   */
-  static UniformMeta* New( const std::string& name, const PropertyBase& property, Dali::ShaderEffect::UniformCoordinateType coordType )
-  {
-    return new UniformMeta( name, property, coordType );
-  }
-
-  /**
-   * Copy constructor
-   * @param [in] meta The UniformMeta to copy.
-   */
-  UniformMeta( const UniformMeta& meta )
-  : name( meta.name ),
-    property( meta.property ),
-    cacheIndex( meta.cacheIndex ),
-    coordinateType( meta.coordinateType )
-  {
-  }
-
-  /**
-   * Set the coordinate type.
-   * @param [in] coordType The new coordinate type.
-   */
-  void SetCoordinateType( Dali::ShaderEffect::UniformCoordinateType coordType )
-  {
-    coordinateType = coordType;
-  }
-
-private:
-
-  /**
-   * Constructor
-   */
-  UniformMeta( const std::string& uniformName, const PropertyBase& prop, Dali::ShaderEffect::UniformCoordinateType coordType )
-  : name( uniformName ),
-    property( prop ),
-    cacheIndex( 0 ),
-    coordinateType( coordType )
-  {
-  }
-
-  // Undefined
-  UniformMeta& operator=( const UniformMeta& rhs );
-
-public:
-
-  std::string name; ///< name of uniform to set/animate
-  const PropertyBase& property; ///< reference to the corresponding property
-  unsigned int cacheIndex; ///< internal program cache index
-  Dali::ShaderEffect::UniformCoordinateType coordinateType; ///< The coordinate type of the uniform
-
-
-};
-
-} // namespace SceneGraph
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_UNIFORM_META_H__
index 8919ab6..0fbd58c 100644 (file)
@@ -530,9 +530,6 @@ void UpdateManager::AddShader( Shader* shader )
   }
 
   mImpl->shaders.PushBack( shader );
-
-  // Allows the shader to dispatch texture requests to the cache
-  shader->Initialize( mImpl->renderQueue, mImpl->sceneController->GetTextureCache() );
 }
 
 void UpdateManager::RemoveShader( Shader* shader )