From 7c148d3457051e5d101756203ccc6df1a206eab0 Mon Sep 17 00:00:00 2001 From: Ferran Sole Date: Tue, 26 Apr 2016 14:33:25 +0100 Subject: [PATCH] Make TextureSet a non property owner - TextureSet are no longer property owner objects - TextureSet can not provide uniforms to renderers Change-Id: I7c604fef8b521361ac986593ef0ec63419433a80 --- .../src/dali-devel/utc-Dali-Renderer.cpp | 75 ++------ .../src/dali-devel/utc-Dali-TextureSet.cpp | 198 --------------------- dali/devel-api/rendering/texture-set.cpp | 4 +- dali/devel-api/rendering/texture-set.h | 2 +- dali/internal/event/actors/image-actor-impl.cpp | 3 +- dali/internal/event/rendering/geometry-impl.cpp | 13 -- dali/internal/event/rendering/texture-set-impl.cpp | 135 ++------------ dali/internal/event/rendering/texture-set-impl.h | 86 +-------- dali/internal/update/common/discard-queue.cpp | 20 --- dali/internal/update/common/discard-queue.h | 9 - dali/internal/update/manager/update-manager.cpp | 45 +++-- dali/internal/update/manager/update-manager.h | 46 ++++- .../update/rendering/scene-graph-renderer.cpp | 19 +- .../update/rendering/scene-graph-renderer.h | 4 + .../update/rendering/scene-graph-texture-set.cpp | 55 +++--- .../update/rendering/scene-graph-texture-set.h | 67 +++---- 16 files changed, 167 insertions(+), 614 deletions(-) diff --git a/automated-tests/src/dali-devel/utc-Dali-Renderer.cpp b/automated-tests/src/dali-devel/utc-Dali-Renderer.cpp index a9724f1..6e68fb2 100644 --- a/automated-tests/src/dali-devel/utc-Dali-Renderer.cpp +++ b/automated-tests/src/dali-devel/utc-Dali-Renderer.cpp @@ -1100,9 +1100,6 @@ int UtcDaliRendererAnimatedProperty02(void) END_TEST; } - - - int UtcDaliRendererUniformMapPrecendence01(void) { TestApplication application; @@ -1127,12 +1124,8 @@ int UtcDaliRendererUniformMapPrecendence01(void) application.Render(0); renderer.RegisterProperty( "uFadeColor", Color::RED ); - actor.RegisterProperty( "uFadeColor", Color::GREEN ); - - Property::Index textureSetFadeColorIndex = textureSet.RegisterProperty( "uFadeColor", Color::BLUE ); - - shader.RegisterProperty( "uFadeColor", Color::MAGENTA ); + Property::Index shaderFadeColorIndex = shader.RegisterProperty( "uFadeColor", Color::MAGENTA ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -1144,12 +1137,12 @@ int UtcDaliRendererUniformMapPrecendence01(void) DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION ); - // Animate texture set's fade color property. Should be no change to uniform + // Animate shader's fade color property. Should be no change to uniform Animation animation = Animation::New(1.0f); KeyFrames keyFrames = KeyFrames::New(); keyFrames.Add(0.0f, Color::WHITE); keyFrames.Add(1.0f, Color::TRANSPARENT); - animation.AnimateBetween( Property( textureSet, textureSetFadeColorIndex ), keyFrames ); + animation.AnimateBetween( Property( shader, shaderFadeColorIndex ), keyFrames ); animation.Play(); application.SendNotification(); @@ -1189,13 +1182,8 @@ int UtcDaliRendererUniformMapPrecendence02(void) application.Render(0); // Don't add property / uniform map to renderer - actor.RegisterProperty( "uFadeColor", Color::GREEN ); - - Property::Index textureSetFadeColorIndex = textureSet.RegisterProperty( "uFadeColor", Color::BLUE ); - - shader.RegisterProperty( "uFadeColor", Color::MAGENTA ); - + Property::Index shaderFadeColorIndex = shader.RegisterProperty( "uFadeColor", Color::BLUE ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -1212,7 +1200,7 @@ int UtcDaliRendererUniformMapPrecendence02(void) KeyFrames keyFrames = KeyFrames::New(); keyFrames.Add(0.0f, Color::WHITE); keyFrames.Add(1.0f, Color::TRANSPARENT); - animation.AnimateBetween( Property( textureSet, textureSetFadeColorIndex ), keyFrames ); + animation.AnimateBetween( Property( shader, shaderFadeColorIndex ), keyFrames ); animation.Play(); application.SendNotification(); @@ -1253,38 +1241,17 @@ int UtcDaliRendererUniformMapPrecendence03(void) application.Render(0); // Don't add property / uniform map to renderer or actor - - textureSet.RegisterProperty( "uFadeColor", Color::BLUE ); - - Property::Index shaderFadeColorIndex = shader.RegisterProperty( "uFadeColor", Color::BLACK ); + shader.RegisterProperty( "uFadeColor", Color::BLACK ); TestGlAbstraction& gl = application.GetGlAbstraction(); application.SendNotification(); application.Render(0); - // Expect that the texture set's fade color property is accessed + // Expect that the shader's fade color property is accessed Vector4 actualValue(Vector4::ZERO); DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::BLUE, TEST_LOCATION ); - - // Animate geometry's fade color property. Should be no change to uniform - Animation animation = Animation::New(1.0f); - KeyFrames keyFrames = KeyFrames::New(); - keyFrames.Add(0.0f, Color::WHITE); - keyFrames.Add(1.0f, Color::TRANSPARENT); - animation.AnimateBetween( Property( shader, shaderFadeColorIndex ), keyFrames ); - animation.Play(); - - application.SendNotification(); - application.Render(500); - - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::BLUE, TEST_LOCATION ); - - application.Render(500); - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::BLUE, TEST_LOCATION ); + DALI_TEST_EQUALS( actualValue, Color::BLACK, TEST_LOCATION ); END_TEST; } @@ -1314,8 +1281,7 @@ int UtcDaliRendererUniformMapMultipleUniforms01(void) renderer.RegisterProperty( "uUniform1", Color::RED ); actor.RegisterProperty( "uUniform2", Color::GREEN ); - textureSet.RegisterProperty( "uUniform3", Color::BLUE ); - shader.RegisterProperty( "uUniform4", Color::MAGENTA ); + shader.RegisterProperty( "uUniform3", Color::MAGENTA ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -1333,11 +1299,7 @@ int UtcDaliRendererUniformMapMultipleUniforms01(void) Vector4 uniform3Value(Vector4::ZERO); DALI_TEST_CHECK( gl.GetUniformValue( "uUniform3", uniform3Value ) ); - DALI_TEST_EQUALS( uniform3Value, Color::BLUE, TEST_LOCATION ); - - Vector4 uniform4Value(Vector4::ZERO); - DALI_TEST_CHECK( gl.GetUniformValue( "uUniform4", uniform4Value ) ); - DALI_TEST_EQUALS( uniform4Value, Color::MAGENTA, TEST_LOCATION ); + DALI_TEST_EQUALS( uniform3Value, Color::MAGENTA, TEST_LOCATION ); END_TEST; } @@ -1371,11 +1333,8 @@ int UtcDaliRendererUniformMapMultipleUniforms02(void) Property::Value value2(1.0f); actor.RegisterProperty( "uFadeProgress", value2 ); - Property::Value value3(Vector3(0.5f, 0.5f, 1.0f)); - textureSet.RegisterProperty( "uFadePosition", value3); - - Property::Value value5(Matrix3::IDENTITY); - shader.RegisterProperty( "uANormalMatrix", value5 ); + Property::Value value3(Matrix3::IDENTITY); + shader.RegisterProperty( "uANormalMatrix", value3 ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -1391,13 +1350,9 @@ int UtcDaliRendererUniformMapMultipleUniforms02(void) DALI_TEST_CHECK( gl.GetUniformValue( "uFadeProgress", uniform2Value ) ); DALI_TEST_EQUALS( uniform2Value, value2.Get(), TEST_LOCATION ); - Vector3 uniform3Value(Vector3::ZERO); - DALI_TEST_CHECK( gl.GetUniformValue( "uFadePosition", uniform3Value ) ); - DALI_TEST_EQUALS( uniform3Value, value3.Get(), TEST_LOCATION ); - - Matrix3 uniform5Value; - DALI_TEST_CHECK( gl.GetUniformValue( "uANormalMatrix", uniform5Value ) ); - DALI_TEST_EQUALS( uniform5Value, value5.Get(), TEST_LOCATION ); + Matrix3 uniform3Value; + DALI_TEST_CHECK( gl.GetUniformValue( "uANormalMatrix", uniform3Value ) ); + DALI_TEST_EQUALS( uniform3Value, value3.Get(), TEST_LOCATION ); END_TEST; } diff --git a/automated-tests/src/dali-devel/utc-Dali-TextureSet.cpp b/automated-tests/src/dali-devel/utc-Dali-TextureSet.cpp index 868c448..483b5dc 100644 --- a/automated-tests/src/dali-devel/utc-Dali-TextureSet.cpp +++ b/automated-tests/src/dali-devel/utc-Dali-TextureSet.cpp @@ -110,204 +110,6 @@ int UtcDaliTextureSetDownCast02(void) END_TEST; } -int UtcDaliTextureSetConstraint(void) -{ - TestApplication application; - - tet_infoline("Test that a custom texture set property can be constrained"); - - Shader shader = Shader::New( "VertexSource", "FragmentSource"); - TextureSet textureSet = TextureSet::New(); - - Geometry geometry = CreateQuadGeometry(); - Renderer renderer = Renderer::New( geometry, shader ); - renderer.SetTextures( textureSet ); - - Actor actor = Actor::New(); - actor.AddRenderer(renderer); - actor.SetSize(400, 400); - Stage::GetCurrent().Add(actor); - - Vector4 initialColor = Color::WHITE; - Property::Index colorIndex = textureSet.RegisterProperty( "uFadeColor", initialColor ); - - application.SendNotification(); - application.Render(0); - DALI_TEST_EQUALS( textureSet.GetProperty(colorIndex), initialColor, TEST_LOCATION ); - - // Apply constraint - Constraint constraint = Constraint::New( textureSet, colorIndex, TestConstraintNoBlue ); - constraint.Apply(); - application.SendNotification(); - application.Render(0); - - // Expect no blue component in either buffer - yellow - DALI_TEST_EQUALS( textureSet.GetProperty(colorIndex), Color::YELLOW, TEST_LOCATION ); - application.Render(0); - DALI_TEST_EQUALS( textureSet.GetProperty(colorIndex), Color::YELLOW, TEST_LOCATION ); - - textureSet.RemoveConstraints(); - textureSet.SetProperty(colorIndex, Color::WHITE ); - application.SendNotification(); - application.Render(0); - DALI_TEST_EQUALS( textureSet.GetProperty(colorIndex), Color::WHITE, TEST_LOCATION ); - - END_TEST; -} - -int UtcDaliTextureSetConstraint02(void) -{ - TestApplication application; - - tet_infoline("Test that a uniform map texture set property can be constrained"); - - Shader shader = Shader::New( "VertexSource", "FragmentSource"); - TextureSet textureSet = TextureSet::New(); - - Geometry geometry = CreateQuadGeometry(); - Renderer renderer = Renderer::New( geometry, shader ); - renderer.SetTextures( textureSet ); - - Actor actor = Actor::New(); - actor.AddRenderer(renderer); - actor.SetSize(400, 400); - Stage::GetCurrent().Add(actor); - application.SendNotification(); - application.Render(0); - - Vector4 initialColor = Color::WHITE; - Property::Index colorIndex = textureSet.RegisterProperty( "uFadeColor", initialColor ); - - TestGlAbstraction& gl = application.GetGlAbstraction(); - - application.SendNotification(); - application.Render(0); - - Vector4 actualValue(Vector4::ZERO); - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, initialColor, TEST_LOCATION ); - - // Apply constraint - Constraint constraint = Constraint::New( textureSet, colorIndex, TestConstraintNoBlue ); - constraint.Apply(); - application.SendNotification(); - application.Render(0); - - // Expect no blue component in either buffer - yellow - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::YELLOW, TEST_LOCATION ); - - application.Render(0); - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::YELLOW, TEST_LOCATION ); - - textureSet.RemoveConstraints(); - textureSet.SetProperty(colorIndex, Color::WHITE ); - application.SendNotification(); - application.Render(0); - - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::WHITE, TEST_LOCATION ); - - END_TEST; -} - -int UtcDaliTextureSetAnimatedProperty01(void) -{ - TestApplication application; - - tet_infoline("Test that a non-uniform texture set property can be animated"); - - Shader shader = Shader::New( "VertexSource", "FragmentSource"); - TextureSet textureSet = TextureSet::New(); - - Geometry geometry = CreateQuadGeometry(); - Renderer renderer = Renderer::New( geometry, shader ); - renderer.SetTextures( textureSet ); - - Actor actor = Actor::New(); - actor.AddRenderer(renderer); - actor.SetSize(400, 400); - Stage::GetCurrent().Add(actor); - - Vector4 initialColor = Color::WHITE; - Property::Index colorIndex = textureSet.RegisterProperty( "uFadeColor", initialColor ); - - application.SendNotification(); - application.Render(0); - DALI_TEST_EQUALS( textureSet.GetProperty(colorIndex), initialColor, TEST_LOCATION ); - - Animation animation = Animation::New(1.0f); - KeyFrames keyFrames = KeyFrames::New(); - keyFrames.Add(0.0f, initialColor); - keyFrames.Add(1.0f, Color::TRANSPARENT); - animation.AnimateBetween( Property( textureSet, colorIndex ), keyFrames ); - animation.Play(); - - application.SendNotification(); - application.Render(500); - - DALI_TEST_EQUALS( textureSet.GetProperty(colorIndex), Color::WHITE * 0.5f, TEST_LOCATION ); - - application.Render(500); - - DALI_TEST_EQUALS( textureSet.GetProperty(colorIndex), Color::TRANSPARENT, TEST_LOCATION ); - - END_TEST; -} - -int UtcDaliTextureSetAnimatedProperty02(void) -{ - TestApplication application; - - tet_infoline("Test that a uniform map texture set property can be animated"); - - Shader shader = Shader::New( "VertexSource", "FragmentSource"); - TextureSet textureSet = TextureSet::New(); - - Geometry geometry = CreateQuadGeometry(); - Renderer renderer = Renderer::New( geometry, shader ); - renderer.SetTextures( textureSet ); - - Actor actor = Actor::New(); - actor.AddRenderer(renderer); - actor.SetSize(400, 400); - Stage::GetCurrent().Add(actor); - application.SendNotification(); - application.Render(0); - - Vector4 initialColor = Color::WHITE; - Property::Index colorIndex = textureSet.RegisterProperty( "uFadeColor", initialColor ); - - TestGlAbstraction& gl = application.GetGlAbstraction(); - - application.SendNotification(); - application.Render(0); - - Vector4 actualValue(Vector4::ZERO); - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, initialColor, TEST_LOCATION ); - - Animation animation = Animation::New(1.0f); - KeyFrames keyFrames = KeyFrames::New(); - keyFrames.Add(0.0f, initialColor); - keyFrames.Add(1.0f, Color::TRANSPARENT); - animation.AnimateBetween( Property( textureSet, colorIndex ), keyFrames ); - animation.Play(); - - application.SendNotification(); - application.Render(500); - - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::WHITE * 0.5f, TEST_LOCATION ); - - application.Render(500); - DALI_TEST_CHECK( gl.GetUniformValue( "uFadeColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, Color::TRANSPARENT, TEST_LOCATION ); - - END_TEST; -} - int UtcDaliTextureSetSetImage01(void) { TestApplication application; diff --git a/dali/devel-api/rendering/texture-set.cpp b/dali/devel-api/rendering/texture-set.cpp index 0211527..22b9298 100644 --- a/dali/devel-api/rendering/texture-set.cpp +++ b/dali/devel-api/rendering/texture-set.cpp @@ -41,7 +41,7 @@ TextureSet::~TextureSet() } TextureSet::TextureSet( const TextureSet& handle ) -: Handle( handle ) +: BaseHandle( handle ) { } @@ -100,7 +100,7 @@ size_t TextureSet::GetTextureCount() const } TextureSet::TextureSet( Internal::TextureSet* pointer ) -: Handle( pointer ) +: BaseHandle( pointer ) { } diff --git a/dali/devel-api/rendering/texture-set.h b/dali/devel-api/rendering/texture-set.h index 68d4b1e..ca639e0 100644 --- a/dali/devel-api/rendering/texture-set.h +++ b/dali/devel-api/rendering/texture-set.h @@ -39,7 +39,7 @@ class TextureSet; * @brief TextureSet is a handle to an object that specifies the set of images used as textures by a renderer * The images have to be ordered in the same order they are declared in the shader */ -class DALI_IMPORT_API TextureSet : public Handle +class DALI_IMPORT_API TextureSet : public BaseHandle { public: diff --git a/dali/internal/event/actors/image-actor-impl.cpp b/dali/internal/event/actors/image-actor-impl.cpp index 73d7be4..9ebf015 100644 --- a/dali/internal/event/actors/image-actor-impl.cpp +++ b/dali/internal/event/actors/image-actor-impl.cpp @@ -374,8 +374,7 @@ void ImageActor::UpdateTexureRect() textureRect.w = vScale * float(mPixelArea.y + mPixelArea.height); } - TextureSet* textureSet = mRenderer->GetTextures(); - textureSet->RegisterProperty( TEXTURE_RECT_UNIFORM_NAME, textureRect ); + mRenderer->RegisterProperty( TEXTURE_RECT_UNIFORM_NAME, textureRect ); } unsigned int ImageActor::GetDefaultPropertyCount() const diff --git a/dali/internal/event/rendering/geometry-impl.cpp b/dali/internal/event/rendering/geometry-impl.cpp index 0f5af2e..07ecda9 100644 --- a/dali/internal/event/rendering/geometry-impl.cpp +++ b/dali/internal/event/rendering/geometry-impl.cpp @@ -22,7 +22,6 @@ #include #include // Dali::Internal::ObjectHelper -#include // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END #include namespace Dali @@ -30,18 +29,6 @@ namespace Dali namespace Internal { -namespace -{ - -BaseHandle Create() -{ - return Dali::Geometry::New(); -} - -TypeRegistration mType( typeid( Dali::Geometry ), typeid( Dali::Handle ), Create ); - -} // unnamed namespace - GeometryPtr Geometry::New() { GeometryPtr geometry( new Geometry() ); diff --git a/dali/internal/event/rendering/texture-set-impl.cpp b/dali/internal/event/rendering/texture-set-impl.cpp index 01104d3..2c4aeac 100644 --- a/dali/internal/event/rendering/texture-set-impl.cpp +++ b/dali/internal/event/rendering/texture-set-impl.cpp @@ -18,14 +18,10 @@ // CLASS HEADER #include // Dali::Internal::TextureSet -//EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include #include // Dali::Internal::Render::TextureSet #include // Dali::Internal::ObjectHelper -#include // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END #include #include @@ -34,20 +30,6 @@ namespace Dali namespace Internal { -namespace -{ - -const ObjectImplHelper<0> TEXTURE_SET_IMPL = { NULL }; - -BaseHandle Create() -{ - return Dali::BaseHandle(); -} - -TypeRegistration mType( typeid( Dali::TextureSet ), typeid( Dali::Handle ), Create ); - -} // unnamed namespace - TextureSetPtr TextureSet::New() { TextureSetPtr textureSet( new TextureSet() ); @@ -83,11 +65,11 @@ void TextureSet::SetImage( size_t index, ImagePtr image ) { image->Connect(); } - SceneGraph::SetImageMessage( GetEventThreadServices(), *mSceneObject, index, image->GetResourceId() ); + SceneGraph::SetImageMessage( mEventThreadServices, *mSceneObject, index, image->GetResourceId() ); } else { - SceneGraph::SetImageMessage( GetEventThreadServices(), *mSceneObject, index, Integration::InvalidResourceId ); + SceneGraph::SetImageMessage( mEventThreadServices, *mSceneObject, index, Integration::InvalidResourceId ); } } @@ -127,7 +109,7 @@ void TextureSet::SetSampler( size_t index, SamplerPtr sampler ) renderSampler = sampler->GetSamplerRenderObject(); } - SceneGraph::SetSamplerMessage( GetEventThreadServices(), *mSceneObject, index, renderSampler ); + SceneGraph::SetSamplerMessage( mEventThreadServices, *mSceneObject, index, renderSampler ); } Sampler* TextureSet::GetSampler( size_t index ) const @@ -155,92 +137,6 @@ const SceneGraph::TextureSet* TextureSet::GetTextureSetSceneObject() const return mSceneObject; } -unsigned int TextureSet::GetDefaultPropertyCount() const -{ - return TEXTURE_SET_IMPL.GetDefaultPropertyCount(); -} - -void TextureSet::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const -{ - TEXTURE_SET_IMPL.GetDefaultPropertyIndices( indices ); -} - -const char* TextureSet::GetDefaultPropertyName(Property::Index index) const -{ - return TEXTURE_SET_IMPL.GetDefaultPropertyName( index ); -} - -Property::Index TextureSet::GetDefaultPropertyIndex( const std::string& name ) const -{ - return TEXTURE_SET_IMPL.GetDefaultPropertyIndex( name ); -} - -bool TextureSet::IsDefaultPropertyWritable( Property::Index index ) const -{ - return TEXTURE_SET_IMPL.IsDefaultPropertyWritable( index ); -} - -bool TextureSet::IsDefaultPropertyAnimatable( Property::Index index ) const -{ - return TEXTURE_SET_IMPL.IsDefaultPropertyAnimatable( index ); -} - -bool TextureSet::IsDefaultPropertyAConstraintInput( Property::Index index ) const -{ - return TEXTURE_SET_IMPL.IsDefaultPropertyAConstraintInput( index ); -} - -Property::Type TextureSet::GetDefaultPropertyType( Property::Index index ) const -{ - return TEXTURE_SET_IMPL.GetDefaultPropertyType( index ); -} - -void TextureSet::SetDefaultProperty( Property::Index index, - const Property::Value& propertyValue ) -{ -} - -void TextureSet::SetSceneGraphProperty( Property::Index index, - const PropertyMetadata& entry, - const Property::Value& value ) -{ - TEXTURE_SET_IMPL.SetSceneGraphProperty( GetEventThreadServices(), this, index, entry, value ); - OnPropertySet(index, value); -} - -Property::Value TextureSet::GetDefaultProperty( Property::Index index ) const -{ - Property::Value value; - return value; -} - -const SceneGraph::PropertyOwner* TextureSet::GetPropertyOwner() const -{ - return mSceneObject; -} - -const SceneGraph::PropertyOwner* TextureSet::GetSceneObject() const -{ - return mSceneObject; -} - -const SceneGraph::PropertyBase* TextureSet::GetSceneObjectAnimatableProperty( Property::Index index ) const -{ - PropertyMetadata* property = index >= PROPERTY_CUSTOM_START_INDEX ? static_cast(FindCustomProperty( index )) : static_cast(FindAnimatableProperty( index )); - DALI_ASSERT_ALWAYS( property && "Property index is invalid" ); - return property->GetSceneGraphProperty(); -} - -const PropertyInputImpl* TextureSet::GetSceneObjectInputProperty( Property::Index index ) const -{ - return GetSceneObjectAnimatableProperty( index ); -} - -int TextureSet::GetPropertyComponentIndex( Property::Index index ) const -{ - return Property::INVALID_COMPONENT_INDEX; -} - bool TextureSet::OnStage() const { return mOnStage; @@ -255,11 +151,11 @@ void TextureSet::Connect() if( mTextures[i].image ) { mTextures[i].image->Connect(); - SceneGraph::SetImageMessage( GetEventThreadServices(), *mSceneObject, i, mTextures[i].image->GetResourceId() ); + SceneGraph::SetImageMessage( mEventThreadServices, *mSceneObject, i, mTextures[i].image->GetResourceId() ); } else { - SceneGraph::SetImageMessage( GetEventThreadServices(), *mSceneObject, i, Integration::InvalidResourceId ); + SceneGraph::SetImageMessage( mEventThreadServices, *mSceneObject, i, Integration::InvalidResourceId ); } } } @@ -278,32 +174,27 @@ void TextureSet::Disconnect() } TextureSet::TextureSet() -: mSceneObject( NULL ), - mTextures(), - mOnStage( false ) +:mEventThreadServices( *Stage::GetCurrent() ), + mSceneObject( NULL ), + mTextures(), + mOnStage( false ) { } void TextureSet::Initialize() { - EventThreadServices& eventThreadServices = GetEventThreadServices(); - SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager(); + SceneGraph::UpdateManager& updateManager = mEventThreadServices.GetUpdateManager(); mSceneObject = SceneGraph::TextureSet::New(); - AddMessage( updateManager, updateManager.GetTexturesOwner(), *mSceneObject ); - - eventThreadServices.RegisterObject( this ); + AddTextureSetMessage( updateManager, *mSceneObject ); } TextureSet::~TextureSet() { if( EventThreadServices::IsCoreRunning() ) { - EventThreadServices& eventThreadServices = GetEventThreadServices(); - SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager(); - RemoveMessage( updateManager, updateManager.GetTexturesOwner(), *mSceneObject ); - - eventThreadServices.UnregisterObject( this ); + SceneGraph::UpdateManager& updateManager = mEventThreadServices.GetUpdateManager(); + RemoveTextureSetMessage( updateManager, *mSceneObject ); } } diff --git a/dali/internal/event/rendering/texture-set-impl.h b/dali/internal/event/rendering/texture-set-impl.h index 0a3b2c9..a8d0892 100644 --- a/dali/internal/event/rendering/texture-set-impl.h +++ b/dali/internal/event/rendering/texture-set-impl.h @@ -48,7 +48,7 @@ typedef IntrusivePtr TextureSetPtr; /** * TextureSet is an object that holds all the textures used by a renderer */ -class TextureSet : public Object, public Connectable +class TextureSet : public BaseObject, public Connectable { public: @@ -89,88 +89,6 @@ public: */ const SceneGraph::TextureSet* GetTextureSetSceneObject() const; -public: // Default property extensions from Object - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyCount() - */ - virtual unsigned int GetDefaultPropertyCount() const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices() - */ - virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyName() - */ - virtual const char* GetDefaultPropertyName(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex() - */ - virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const; - - /** - * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable() - */ - virtual bool IsDefaultPropertyWritable(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable() - */ - virtual bool IsDefaultPropertyAnimatable(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput() - */ - virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyType() - */ - virtual Property::Type GetDefaultPropertyType(Property::Index index) const; - - /** - * @copydoc Dali::Internal::Object::SetDefaultProperty() - */ - virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue); - - /** - * @copydoc Dali::Internal::Object::SetSceneGraphProperty() - */ - virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value ); - - /** - * @copydoc Dali::Internal::Object::GetDefaultProperty() - */ - virtual Property::Value GetDefaultProperty( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetPropertyOwner() - */ - virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const; - - /** - * @copydoc Dali::Internal::Object::GetSceneObject() - */ - virtual const SceneGraph::PropertyOwner* GetSceneObject() const; - - /** - * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty() - */ - virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty() - */ - virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const; - - /** - * @copydoc Dali::Internal::Object::GetPropertyComponentIndex() - */ - virtual int GetPropertyComponentIndex( Property::Index index ) const; - public: // Functions from Connectable /** * @copydoc Dali::Internal::Connectable::OnStage() @@ -218,7 +136,7 @@ private: // unimplemented methods TextureSet& operator=( const TextureSet& ); private: // Data - + EventThreadServices& mEventThreadServices; /// mTextures; bool mOnStage; diff --git a/dali/internal/update/common/discard-queue.cpp b/dali/internal/update/common/discard-queue.cpp index 5fd4954..8a2e7e8 100644 --- a/dali/internal/update/common/discard-queue.cpp +++ b/dali/internal/update/common/discard-queue.cpp @@ -78,24 +78,6 @@ void DiscardQueue::Add( BufferIndex updateBufferIndex, Renderer* renderer ) } } -void DiscardQueue::Add( BufferIndex updateBufferIndex, TextureSet* textureSet ) -{ - DALI_ASSERT_DEBUG( NULL != textureSet ); - - // The GL resources will now be freed in frame N - // The Update for frame N+1 may occur in parallel with the rendering of frame N - // Queue the node for destruction in frame N+2 - if ( 0u == updateBufferIndex ) - { - mTextureSetQueue0.PushBack( textureSet ); - } - else - { - mTextureSetQueue1.PushBack( textureSet ); - } -} - - void DiscardQueue::Add( BufferIndex updateBufferIndex, Shader* shader ) { DALI_ASSERT_DEBUG( NULL != shader ); @@ -123,14 +105,12 @@ void DiscardQueue::Clear( BufferIndex updateBufferIndex ) { mNodeQueue0.Clear(); mShaderQueue0.Clear(); - mTextureSetQueue0.Clear(); mRendererQueue0.Clear(); } else { mNodeQueue1.Clear(); mShaderQueue1.Clear(); - mTextureSetQueue1.Clear(); mRendererQueue1.Clear(); } } diff --git a/dali/internal/update/common/discard-queue.h b/dali/internal/update/common/discard-queue.h index c9cb7d0..10d1824 100644 --- a/dali/internal/update/common/discard-queue.h +++ b/dali/internal/update/common/discard-queue.h @@ -54,7 +54,6 @@ class DiscardQueue public: typedef OwnerContainer< Shader* > ShaderQueue; - typedef OwnerContainer< TextureSet* > TextureSetQueue; typedef OwnerContainer< Renderer* > RendererQueue; /** @@ -78,12 +77,6 @@ public: void Add( BufferIndex updateBufferIndex, Node* node ); /** - * Adds an unwanted texture set to the discard queue. - * A message will be sent to clean up GL resources in the next Render. - */ - void Add( BufferIndex updateBufferIndex, TextureSet* textureSet ); - - /** * Adds an unwanted shader to the discard queue. * A message will be sent to clean-up GL resources in the next Render. * @pre This method is not thread-safe, and should only be called from the update-thread. @@ -122,13 +115,11 @@ private: // Messages are queued here when the update buffer index == 0 NodeOwnerContainer mNodeQueue0; ShaderQueue mShaderQueue0; - TextureSetQueue mTextureSetQueue0; RendererQueue mRendererQueue0; // Messages are queued here when the update buffer index == 1 NodeOwnerContainer mNodeQueue1; ShaderQueue mShaderQueue1; - TextureSetQueue mTextureSetQueue1; RendererQueue mRendererQueue1; }; diff --git a/dali/internal/update/manager/update-manager.cpp b/dali/internal/update/manager/update-manager.cpp index c414c4e..7903261 100644 --- a/dali/internal/update/manager/update-manager.cpp +++ b/dali/internal/update/manager/update-manager.cpp @@ -113,6 +113,9 @@ typedef OwnerContainer GestureContainer; typedef GestureContainer::Iterator GestureIter; typedef GestureContainer::ConstIterator GestureConstIter; +typedef OwnerContainer< TextureSet* > TextureSetContainer; +typedef TextureSetContainer::Iterator TextureSetIter; +typedef TextureSetContainer::ConstIterator TextureSetConstIter; /** * Structure to contain UpdateManager internal data @@ -150,7 +153,7 @@ struct UpdateManager::Impl root( NULL ), systemLevelRoot( NULL ), renderers( sceneGraphBuffers, discardQueue ), - textureSets( sceneGraphBuffers, discardQueue ), + textureSets(), messageQueue( renderController, sceneGraphBuffers ), keepRenderingSeconds( 0.0f ), animationFinishedDuringUpdate( false ), @@ -163,7 +166,6 @@ struct UpdateManager::Impl sceneController = new SceneControllerImpl( renderMessageDispatcher, renderQueue, discardQueue, textureCache ); renderers.SetSceneController( *sceneController ); - textureSets.SetSceneController( *sceneController ); // create first 'dummy' node nodes.PushBack(0u); @@ -249,7 +251,7 @@ struct UpdateManager::Impl PropertyNotificationContainer propertyNotifications; ///< A container of owner property notifications. ObjectOwnerContainer renderers; - ObjectOwnerContainer textureSets; ///< A container of texture sets + TextureSetContainer textureSets; ///< A container of texture sets ShaderContainer shaders; ///< A container of owned shaders @@ -497,12 +499,6 @@ ObjectOwnerContainer& UpdateManager::GetRendererOwner() return mImpl->renderers; } - -ObjectOwnerContainer& UpdateManager::GetTexturesOwner() -{ - return mImpl->textureSets; -} - void UpdateManager::AddShader( Shader* shader ) { DALI_ASSERT_DEBUG( NULL != shader ); @@ -614,6 +610,26 @@ void UpdateManager::RemoveGesture( PanGesture* gesture ) DALI_ASSERT_DEBUG(false); } +void UpdateManager::AddTextureSet( TextureSet* textureSet ) +{ + DALI_ASSERT_DEBUG( NULL != textureSet ); + mImpl->textureSets.PushBack( textureSet ); +} + +void UpdateManager::RemoveTextureSet( TextureSet* textureSet ) +{ + DALI_ASSERT_DEBUG(textureSet != NULL); + size_t textureSetCount( mImpl->textureSets.Size() ); + for( size_t i(0); itextureSets[i] ) + { + mImpl->textureSets.Remove( mImpl->textureSets.Begin() + i ); + return; + } + } +} + unsigned int* UpdateManager::ReserveMessageSlot( std::size_t size, bool updateScene ) { return mImpl->messageQueue.ReserveMessageSlot( size, updateScene ); @@ -676,7 +692,6 @@ void UpdateManager::ResetProperties( BufferIndex bufferIndex ) (*iter)->ResetToBaseValues( bufferIndex ); } - mImpl->textureSets.ResetToBaseValues( bufferIndex ); mImpl->renderers.ResetToBaseValues( bufferIndex ); // Reset animatable shader properties to base values @@ -798,15 +813,11 @@ void UpdateManager::ProcessPropertyNotifications( BufferIndex bufferIndex ) void UpdateManager::PrepareTextureSets( BufferIndex bufferIndex ) { - ObjectOwnerContainer::Iterator iter = mImpl->textureSets.GetObjectContainer().Begin(); - const ObjectOwnerContainer::Iterator end = mImpl->textureSets.GetObjectContainer().End(); - for( ; iter != end; ++iter ) + size_t textureSetCount( mImpl->textureSets.Size() ); + for( size_t i(0); iPrepare( mImpl->resourceManager ); + mImpl->textureSets[i]->Prepare( mImpl->resourceManager ); } } diff --git a/dali/internal/update/manager/update-manager.h b/dali/internal/update/manager/update-manager.h index 745e042..e8ea3b6 100644 --- a/dali/internal/update/manager/update-manager.h +++ b/dali/internal/update/manager/update-manager.h @@ -250,13 +250,6 @@ public: ObjectOwnerContainer< Renderer >& GetRendererOwner(); /** - * @brief Get the texture set owner - * - * @return The texture set owner - */ - ObjectOwnerContainer< TextureSet >& GetTexturesOwner(); - - /** * @brief Get the property buffer owner * * @return The property buffer owner @@ -282,6 +275,21 @@ public: void RemoveShader(Shader* shader); /** + * Add a newly created TextureSet. + * @param[in] textureSet The texture set to add. + * @post The TextureSet is owned by the UpdateManager. + */ + void AddTextureSet(TextureSet* textureSet); + + /** + * Remove a TextureSet. + * @pre The TextureSet has been added to the UpdateManager. + * @param[in] textureSet The TextureSet to remove. + * @post The TextureSet is destroyed. + */ + void RemoveTextureSet(TextureSet* textureSet); + + /** * Set the shader program for a Shader object * @param[in] shader The shader to modify * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program @@ -930,6 +938,30 @@ inline void RemoveMessage( UpdateManager& manager, ObjectOwnerContainer& owne new (slot) LocalType( &owner, &ObjectOwnerContainer::Remove, &object ); } +// The render thread can safely change the Shader +inline void AddTextureSetMessage( UpdateManager& manager, TextureSet& textureSet ) +{ + typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType; + + // Reserve some memory inside the message queue + unsigned int* slot = manager.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, &UpdateManager::AddTextureSet, &textureSet ); +} + +// The render thread can safely change the Shader +inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet ) +{ + typedef MessageValue1< UpdateManager, TextureSet* > LocalType; + + // Reserve some memory inside the message queue + unsigned int* slot = manager.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, &UpdateManager::RemoveTextureSet, &textureSet ); +} + inline void AddSamplerMessage( UpdateManager& manager, Render::Sampler& sampler ) { typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType; diff --git a/dali/internal/update/rendering/scene-graph-renderer.cpp b/dali/internal/update/rendering/scene-graph-renderer.cpp index 4876a34..ec8965f 100644 --- a/dali/internal/update/rendering/scene-graph-renderer.cpp +++ b/dali/internal/update/rendering/scene-graph-renderer.cpp @@ -143,7 +143,7 @@ Renderer::~Renderer() { if (mTextureSet) { - mTextureSet->RemoveConnectionObserver(*this); + mTextureSet->RemoveObserver(this); mTextureSet=NULL; } if( mShader ) @@ -191,12 +191,6 @@ void Renderer::PrepareRender( BufferIndex updateBufferIndex ) const UniformMap& rendererUniformMap = PropertyOwner::GetUniformMap(); AddMappings( localMap, rendererUniformMap ); - - if( mTextureSet ) - { - AddMappings( localMap, mTextureSet->GetUniformMap() ); - } - AddMappings( localMap, mShader->GetUniformMap() ); } else if( mRegenerateUniformMap == COPY_UNIFORM_MAP ) @@ -289,8 +283,6 @@ void Renderer::PrepareRender( BufferIndex updateBufferIndex ) new (slot) DerivedType( mRenderer, &Render::Renderer::SetIndexedDrawElementsCount, mIndexedDrawElementsCount ); mResendFlag &= ~RESEND_INDEXED_DRAW_FIRST_ELEMENT; } - - } void Renderer::SetTextures( TextureSet* textureSet ) @@ -299,11 +291,11 @@ void Renderer::SetTextures( TextureSet* textureSet ) if( mTextureSet ) { - mTextureSet->RemoveConnectionObserver(*this); + mTextureSet->RemoveObserver(this); } mTextureSet = textureSet; - mTextureSet->AddConnectionObserver( *this ); + mTextureSet->AddObserver( this ); mRegenerateUniformMap = REGENERATE_UNIFORM_MAP; mResendFlag |= RESEND_DATA_PROVIDER; } @@ -520,6 +512,11 @@ Renderer::Opacity Renderer::GetOpacity( BufferIndex updateBufferIndex, const Nod return opacity; } +void Renderer::TextureSetChanged() +{ + mResendFlag |= RESEND_DATA_PROVIDER; +} + void Renderer::ConnectionsChanged( PropertyOwner& object ) { // One of our child objects has changed it's connections. Ensure the uniform diff --git a/dali/internal/update/rendering/scene-graph-renderer.h b/dali/internal/update/rendering/scene-graph-renderer.h index 9311b3f..03af729 100644 --- a/dali/internal/update/rendering/scene-graph-renderer.h +++ b/dali/internal/update/rendering/scene-graph-renderer.h @@ -215,6 +215,10 @@ public: return mReferenceCount > 0; } + /** + * Called by the TextureSet to notify to the renderer that it has changed + */ + void TextureSetChanged(); public: // Implementation of ObjectOwnerContainer template methods /** diff --git a/dali/internal/update/rendering/scene-graph-texture-set.cpp b/dali/internal/update/rendering/scene-graph-texture-set.cpp index cd37706..e9ffa53 100644 --- a/dali/internal/update/rendering/scene-graph-texture-set.cpp +++ b/dali/internal/update/rendering/scene-graph-texture-set.cpp @@ -18,15 +18,13 @@ #include "scene-graph-texture-set.h" // INTERNAL HEADERS -#include -#include #include #include #include #include #include -#include #include +#include namespace //Unnamed namespace { @@ -51,19 +49,16 @@ TextureSet* TextureSet::New() TextureSet::TextureSet() : mSamplers(), mTextureId(), - mConnectionObservers(), + mRenderers(), mResourcesReady( false ), mFinishedResourceAcquisition( false ), mChanged( true ), mHasAlpha( false ) { - // Observe own property-owner's uniform map - AddUniformMapObserver( *this ); } TextureSet::~TextureSet() { - mConnectionObservers.Destroy( *this ); } void TextureSet::operator delete( void* ptr ) @@ -163,7 +158,7 @@ void TextureSet::SetImage( size_t index, ResourceId imageId ) mTextureId[index] = imageId; mChanged = true; - mConnectionObservers.ConnectionsChanged(*this); + NotifyChangeToRenderers(); } void TextureSet::SetSampler( size_t index, Render::Sampler* sampler ) @@ -183,7 +178,7 @@ void TextureSet::SetSampler( size_t index, Render::Sampler* sampler ) mSamplers[index] = sampler; mChanged = true; - mConnectionObservers.ConnectionsChanged(*this); + NotifyChangeToRenderers(); } bool TextureSet::HasAlpha() const @@ -197,29 +192,41 @@ void TextureSet::GetResourcesStatus( bool& resourcesReady, bool& finishedResourc finishedResourceAcquisition = mFinishedResourceAcquisition; } -void TextureSet::ConnectToSceneGraph( SceneController& sceneController, BufferIndex bufferIndex ) +void TextureSet::AddObserver( Renderer* renderer ) { -} + size_t rendererCount( mRenderers.Size() ); + for( size_t i(0); iTextureSetChanged(); + } } } // namespace SceneGraph diff --git a/dali/internal/update/rendering/scene-graph-texture-set.h b/dali/internal/update/rendering/scene-graph-texture-set.h index d1a94de..2d0da55 100644 --- a/dali/internal/update/rendering/scene-graph-texture-set.h +++ b/dali/internal/update/rendering/scene-graph-texture-set.h @@ -20,11 +20,8 @@ // INTERNAL INCLUDES #include #include +#include #include -#include -#include -#include -#include #include namespace Dali @@ -39,12 +36,10 @@ class Sampler; } namespace SceneGraph { +class Renderer; class Sampler; -class Shader; -class ConnectionObserver; -class SceneController; -class TextureSet : public PropertyOwner, public UniformMap::Observer +class TextureSet { public: @@ -100,37 +95,20 @@ public: */ void GetResourcesStatus( bool& resourcesReady, bool& finishedResourceAcquisition ); - -public: // Implementation of ObjectOwnerContainer template methods - /** - * Connect the object to the scene graph + * Adds a renderer to the Renderers list of the texture set. + * Renderers using the TextureSet get a notification when the texture set changes * - * @param[in] sceneController The scene controller - used for sending messages to render thread - * @param[in] bufferIndex The current buffer index - used for sending messages to render thread - */ - void ConnectToSceneGraph( SceneController& sceneController, BufferIndex bufferIndex ); - - /** - * Disconnect the object from the scene graph - * @param[in] sceneController The scene controller - used for sending messages to render thread - * @param[in] bufferIndex The current buffer index - used for sending messages to render thread - */ - void DisconnectFromSceneGraph( SceneController& sceneController, BufferIndex bufferIndex ); - -public: // Implementation of ConnectionChangePropagator - - /** - * @copydoc ConnectionChangePropagator::AddObserver + * @param[in] renderer The renderer using the TextureSet */ - void AddConnectionObserver(ConnectionChangePropagator::Observer& observer); + void AddObserver( Renderer* renderer ); /** - * @copydoc ConnectionChangePropagator::RemoveObserver + * Removes a renderer from the TextureSet renderers list + * + * @param[in] renderer The renderer no longer using the TextureSet */ - void RemoveConnectionObserver(ConnectionChangePropagator::Observer& observer); - -public: + void RemoveObserver( Renderer* renderer ); /** * Get the ResourceId of a texture in the TextureSet @@ -161,11 +139,6 @@ public: return mTextureId.Size(); } -public: // UniformMap::Observer - /** - * @copydoc UniformMap::Observer::UniformMappingsChanged - */ - virtual void UniformMappingsChanged( const UniformMap& mappings ); private: @@ -174,15 +147,21 @@ private: */ TextureSet(); + /** + * Helper method to notify the renderers observing the TextureSet + * that the TextureSet has changed + */ + void NotifyChangeToRenderers(); + private: // Data - Vector< Render::Sampler* > mSamplers; // Not owned - Vector< ResourceId > mTextureId; - ConnectionChangePropagator mConnectionObservers; - bool mResourcesReady; ///< if the textures are ready to be used for rendering + Vector< Render::Sampler* > mSamplers; ///< List of samplers used by each texture. Not owned + Vector< ResourceId > mTextureId; ///< List of texture ids + Vector mRenderers; ///< List of renderers using the TextureSet + bool mResourcesReady; ///< if the textures are ready to be used for rendering bool mFinishedResourceAcquisition; ///< if resource loading is completed - bool mChanged; ///< if the texture set has changed since the last frame - bool mHasAlpha; ///< if any of the textures has an alpha channel + bool mChanged; ///< if the texture set has changed since the last frame + bool mHasAlpha; ///< if any of the textures has an alpha channel }; inline void SetImageMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, ResourceId resourceId ) -- 2.7.4