From 6861f629112d44d4de1a8a7c70591e2279b951b2 Mon Sep 17 00:00:00 2001 From: Ferran Sole Date: Tue, 6 Oct 2015 16:50:53 +0100 Subject: [PATCH] Changes following "Remove Sampler scene object" Change-Id: I7934f6d0c516687c252f49509812f2a87becff3a --- .../src/dali-toolkit/utc-Dali-RendererFactory.cpp | 8 +---- .../internal/atlas-manager/atlas-manager-impl.cpp | 12 +++---- .../internal/atlas-manager/atlas-manager-impl.h | 6 ++-- .../internal/atlas-manager/atlas-manager.cpp | 4 +-- .../internal/atlas-manager/atlas-manager.h | 4 +-- .../controls/bubble-effect/bubble-emitter-impl.cpp | 10 +++--- .../controls/bubble-effect/bubble-emitter-impl.h | 2 -- .../controls/model3d-view/model3d-view-impl.cpp | 23 ++++--------- .../renderers/gradient/gradient-renderer.cpp | 14 ++++---- .../controls/renderers/image/image-renderer.cpp | 14 +++----- .../controls/renderers/npatch/npatch-renderer.cpp | 38 +++++++++------------- .../rendering/atlas/atlas-glyph-manager-impl.cpp | 4 +-- .../rendering/atlas/atlas-glyph-manager-impl.h | 2 +- .../text/rendering/atlas/atlas-glyph-manager.cpp | 4 +-- .../text/rendering/atlas/atlas-glyph-manager.h | 2 +- .../text/rendering/atlas/text-atlas-renderer.cpp | 7 ++-- 16 files changed, 60 insertions(+), 94 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp index 391bc74..9cc604b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp @@ -173,7 +173,7 @@ void TestControlRendererRender( ToolkitTestApplication& application, Actor& acto controlRenderer.SetOnStage( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); - DALI_TEST_CHECK( actor.GetRendererAt(0u).GetMaterial().GetNumberOfSamplers() == expectedSamplers ); + DALI_TEST_CHECK( actor.GetRendererAt(0u).GetMaterial().GetNumberOfTextures() == expectedSamplers ); application.SendNotification(); application.Render(); @@ -804,8 +804,6 @@ int UtcDaliRendererFactoryResetRenderer1(void) controlRenderer.SetOnStage( actor2 ); application.SendNotification(); application.Render(0); - Image samplerImage = actor2.GetRendererAt(0u).GetMaterial().GetSamplerAt(0u).GetImage(); - DALI_TEST_CHECK( BufferImage::DownCast( samplerImage ) ); END_TEST; } @@ -830,16 +828,12 @@ int UtcDaliRendererFactoryResetRenderer2(void) application.SendNotification(); application.Render(0); - Image samplerImage = actor.GetRendererAt(0u).GetMaterial().GetSamplerAt(0u).GetImage(); - DALI_TEST_CHECK( ResourceImage::DownCast( samplerImage ) ); Image bufferImage = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) ); bool isNewRenderer = factory.ResetRenderer( controlRenderer, bufferImage ); DALI_TEST_CHECK( !isNewRenderer ); application.SendNotification(); application.Render(0); - samplerImage = actor.GetRendererAt(0u).GetMaterial().GetSamplerAt(0u).GetImage(); - DALI_TEST_CHECK( BufferImage::DownCast( samplerImage ) ); isNewRenderer = factory.ResetRenderer( controlRenderer, Color::RED ); DALI_TEST_CHECK( isNewRenderer ); diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp index 832e5d9..5a524d2 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp +++ b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp @@ -159,11 +159,9 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasMa memset( buffer, 0xFF, filledPixelImage.GetBufferSize() ); atlas.Upload( filledPixelImage, 0, 0 ); - Sampler sampler = Sampler::New( atlas, "sTexture" ); - sampler.SetProperty( Sampler::Property::AFFECTS_TRANSPARENCY, true ); atlasDescriptor.mMaterial = Material::New( pixelformat == Pixel::L8 ? mShaderL8 : mShaderRgba ); - atlasDescriptor.mMaterial.AddSampler( sampler ); - atlasDescriptor.mSampler = sampler; + atlasDescriptor.mMaterial.AddTexture(atlas, "sTexture" ); + atlasDescriptor.mImage = atlas; atlasDescriptor.mMaterial.SetBlendMode( BlendingMode::ON ); mAtlasList.push_back( atlasDescriptor ); return mAtlasList.size(); @@ -792,13 +790,13 @@ Material AtlasManager::GetMaterial( AtlasId atlas ) const return null; } -Sampler AtlasManager::GetSampler( AtlasId atlas ) const +Image AtlasManager::GetImage( AtlasId atlas ) const { if ( atlas && atlas-- <= mAtlasList.size() ) { - return mAtlasList[ atlas ].mSampler; + return mAtlasList[ atlas ].mImage; } - Sampler null; + Image null; return null; } diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h index 5b301f0..5f940a6 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h +++ b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h @@ -65,7 +65,7 @@ public: BufferImage mHorizontalStrip; // Image used to pad upload BufferImage mVerticalStrip; // Image used to pad upload Material mMaterial; // material used for atlas texture - Sampler mSampler; // sampler used for atlas texture + Image mImage; SizeType mTotalBlocks; // total number of blocks in atlas SizeType mAvailableBlocks; // number of blocks available in atlas Dali::Vector< SizeType > mFreeBlocksList; // unless there are any previously freed blocks @@ -177,9 +177,9 @@ public: Material GetMaterial( AtlasId atlas ) const; /** - * @copydoc Toolkit::AtlasManager::GetSampler + * @copydoc Toolkit::AtlasManager::GetImage */ - Sampler GetSampler( AtlasId atlas ) const; + Image GetImage( AtlasId atlas ) const; private: diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager.cpp b/dali-toolkit/internal/atlas-manager/atlas-manager.cpp index 849b27d..987f1f1 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager.cpp +++ b/dali-toolkit/internal/atlas-manager/atlas-manager.cpp @@ -130,9 +130,9 @@ Material AtlasManager::GetMaterial( AtlasId atlas ) const return GetImplementation(*this).GetMaterial( atlas ); } -Sampler AtlasManager::GetSampler( AtlasId atlas ) const +Image AtlasManager::GetImage( AtlasId atlas ) const { - return GetImplementation(*this).GetSampler( atlas ); + return GetImplementation(*this).GetImage( atlas ); } } // namespace Toolkit diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager.h b/dali-toolkit/internal/atlas-manager/atlas-manager.h index 2c7f192..6d41419 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager.h +++ b/dali-toolkit/internal/atlas-manager/atlas-manager.h @@ -389,13 +389,13 @@ public: Material GetMaterial( AtlasId atlas ) const; /** - * @brief Get Sampler used by atlas + * @brief Get Image used by atlas * * @param atlas[in] atlas AtlasId * * @return Sampler used by atlas */ - Sampler GetSampler( AtlasId atlas ) const; + Image GetImage( AtlasId atlas ) const; private: explicit DALI_INTERNAL AtlasManager(Internal::AtlasManager *impl); diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp index 9fed7cc..aeb1de2 100644 --- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp +++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp @@ -132,16 +132,14 @@ void BubbleEmitter::OnInitialize() // Prepare the frame buffer to store the color adjusted background image mEffectImage = FrameBufferImage::New( mMovementArea.width/4.f, mMovementArea.height/4.f, Pixel::RGBA8888, Dali::Image::UNUSED ); - // Generate the samplers and geometry, which is used by all bubbleActors - mSamplerBackground = Sampler::New( mEffectImage, "sBackground" ); - mSamplerBubbleShape = Sampler::New( mShapeImage, "sBubbleShape" ); + // Generate the geometry, which is used by all bubbleActors mMeshGeometry = CreateGeometry( mNumBubblePerActor*mDensity ); Shader bubbleShader = CreateBubbleShader (mNumBubblePerActor ); mMaterial = Material::New( bubbleShader ); - mMaterial.AddSampler( mSamplerBackground ); - mMaterial.AddSampler( mSamplerBubbleShape ); + mMaterial.AddTexture( mEffectImage, "sBackground" ); + mMaterial.AddTexture( mShapeImage, "sBubbleShape" ); mBubbleActors.resize( mNumActor ); @@ -195,7 +193,7 @@ void BubbleEmitter::SetBackground( Image bgImage, const Vector3& hsvDelta ) void BubbleEmitter::SetShapeImage( Image shapeImage ) { - mSamplerBubbleShape.SetImage( shapeImage ); + mMaterial.SetTextureImage( 1, shapeImage ); } void BubbleEmitter::SetBubbleScale( float scale ) diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h index 40b4b74..08185a0 100644 --- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h +++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h @@ -163,8 +163,6 @@ private: FrameBufferImage mEffectImage; ///< The image stores the adjusted color of the background image.The bubbles pick color from this image. CameraActor mCameraActor; ///< The render task views the scene from the perspective of this actor. - Sampler mSamplerBackground; ///< The sampler which provides the background image to material - Sampler mSamplerBubbleShape; ///< The sampler which provides the bubble shape image to material Geometry mMeshGeometry; ///< The mesh geometry which contains the vertices and indices data Material mMaterial; ///< The material which controls the bubble display std::vector mBubbleActors; ///< The meshActor vector, its size is mNumShader. diff --git a/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp b/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp index 84780be..b44f4a1 100644 --- a/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp +++ b/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp @@ -627,11 +627,8 @@ void Model3dView::LoadTextures() Image tex0 = ResourceImage::New( imgUrl ); if( tex0 ) { - Sampler sampler = Sampler::New( tex0, "sDiffuse" ); - sampler.SetWrapMode(Sampler::REPEAT,Sampler::REPEAT); - sampler.SetAffectsTransparency(false); - - mMaterial.AddSampler( sampler ); + size_t index = mMaterial.AddTexture( tex0, "sDiffuse" ); + mMaterial.SetTextureAffectsTransparency(index, false ); } } @@ -643,12 +640,8 @@ void Model3dView::LoadTextures() Image tex1 = ResourceImage::New( imgUrl ); if (tex1) { - Sampler sampler = Sampler::New( tex1, "sNormal" ); - sampler.SetWrapMode(Sampler::REPEAT,Sampler::REPEAT); - sampler.SetAffectsTransparency(false); - sampler.SetFilterMode(Sampler::LINEAR,Sampler::LINEAR); - - mMaterial.AddSampler( sampler ); + size_t index = mMaterial.AddTexture( tex1, "sNormal" ); + mMaterial.SetTextureAffectsTransparency(index, false ); } } @@ -660,12 +653,8 @@ void Model3dView::LoadTextures() Image tex2 = ResourceImage::New( imgUrl ); if( tex2 ) { - Sampler sampler = Sampler::New( tex2, "sGloss" ); - sampler.SetWrapMode(Sampler::REPEAT,Sampler::REPEAT); - sampler.SetAffectsTransparency(false); - sampler.SetFilterMode(Sampler::LINEAR,Sampler::LINEAR); - - mMaterial.AddSampler( sampler ); + size_t index = mMaterial.AddTexture( tex2, "sGloss" ); + mMaterial.SetTextureAffectsTransparency(index, false ); } } } diff --git a/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp b/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp index 30a587f..6dc25ca 100644 --- a/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp +++ b/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp @@ -155,22 +155,22 @@ DALI_COMPOSE_SHADER( ) }; -Sampler::WrapMode GetWrapMode( Gradient::SpreadMethod spread ) +Dali::WrapMode::Type GetWrapMode( Gradient::SpreadMethod spread ) { switch(spread) { case Gradient::REPEAT: { - return Sampler::REPEAT; + return Dali::WrapMode::REPEAT; } case Gradient::REFLECT: { - return Sampler::MIRRORED_REPEAT; + return Dali::WrapMode::MIRRORED_REPEAT; } case Gradient::PAD: default: { - return Sampler::CLAMP_TO_EDGE; + return Dali::WrapMode::CLAMP_TO_EDGE; } } } @@ -324,11 +324,11 @@ void GradientRenderer::InitializeRenderer( Dali::Renderer& renderer ) } Dali::BufferImage lookupTexture = mGradient->GenerateLookupTexture(); - Sampler sampler = Sampler::New( lookupTexture, UNIFORM_TEXTULRE_NAME ); - Sampler::WrapMode wrap = GetWrapMode( mGradient->GetSpreadMethod() ); + Sampler sampler = Sampler::New(); + Dali::WrapMode::Type wrap = GetWrapMode( mGradient->GetSpreadMethod() ); sampler.SetWrapMode( wrap, wrap ); - material.AddSampler( sampler ); + material.AddTexture( lookupTexture, UNIFORM_TEXTULRE_NAME, sampler ); renderer.RegisterProperty( UNIFORM_ALIGNMENT_MATRIX_NAME, mGradientTransform ); } diff --git a/dali-toolkit/internal/controls/renderers/image/image-renderer.cpp b/dali-toolkit/internal/controls/renderers/image/image-renderer.cpp index b595a48..0fad543 100644 --- a/dali-toolkit/internal/controls/renderers/image/image-renderer.cpp +++ b/dali-toolkit/internal/controls/renderers/image/image-renderer.cpp @@ -568,18 +568,14 @@ void ImageRenderer::ApplyImageToSampler() Material material = mImpl->mRenderer.GetMaterial(); if( material ) { - for( std::size_t i = 0; i < material.GetNumberOfSamplers(); ++i ) + int index = material.GetTextureIndex(TEXTURE_UNIFORM_NAME); + if( index != -1 ) { - Sampler sampler = material.GetSamplerAt( i ); - if( sampler.GetUniformName() == TEXTURE_UNIFORM_NAME ) - { - sampler.SetImage( mImage ); - return; - } + material.SetTextureImage( index, mImage ); + return; } - Sampler sampler = Sampler::New( mImage, TEXTURE_UNIFORM_NAME ); - material.AddSampler( sampler ); + material.AddTexture( mImage,TEXTURE_UNIFORM_NAME ); } } } diff --git a/dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.cpp b/dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.cpp index cd23466..10f851f 100644 --- a/dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.cpp +++ b/dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.cpp @@ -172,7 +172,7 @@ void AddVertex( Vector< Vector2 >& vertices, unsigned int x, unsigned int y ) vertices.PushBack( Vector2( x, y ) ); } -void RegisterStretchProperties( Sampler& sampler, const char * uniformName, const NinePatchImage::StretchRanges& stretchPixels, uint16_t imageExtent) +void RegisterStretchProperties( Material& material, const char * uniformName, const NinePatchImage::StretchRanges& stretchPixels, uint16_t imageExtent) { uint16_t prevEnd = 0; uint16_t prevFix = 0; @@ -188,7 +188,7 @@ void RegisterStretchProperties( Sampler& sampler, const char * uniformName, cons std::stringstream uniform; uniform << uniformName << "[" << i << "]"; - sampler.RegisterProperty( uniform.str(), Vector2( fix, stretch ) ); + material.RegisterProperty( uniform.str(), Vector2( fix, stretch ) ); prevEnd = end; prevFix = fix; @@ -199,7 +199,7 @@ void RegisterStretchProperties( Sampler& sampler, const char * uniformName, cons prevFix += imageExtent - prevEnd; std::stringstream uniform; uniform << uniformName << "[" << i << "]"; - sampler.RegisterProperty( uniform.str(), Vector2( prevFix, prevStretch ) ); + material.RegisterProperty( uniform.str(), Vector2( prevFix, prevStretch ) ); } } @@ -462,20 +462,14 @@ void NPatchRenderer::ApplyImageToSampler() Material material = mImpl->mRenderer.GetMaterial(); if( material ) { - Sampler sampler; - for( std::size_t i = 0; i < material.GetNumberOfSamplers(); ++i ) + int index = material.GetTextureIndex( TEXTURE_UNIFORM_NAME ); + if( index > -1 ) { - sampler = material.GetSamplerAt( i ); - if( sampler.GetUniformName() == TEXTURE_UNIFORM_NAME ) - { - sampler.SetImage( mCroppedImage ); - break; - } + material.SetTextureImage( index, mCroppedImage ); } - if( !sampler ) + else { - sampler = Sampler::New( mCroppedImage, TEXTURE_UNIFORM_NAME ); - material.AddSampler( sampler ); + material.AddTexture( mCroppedImage, TEXTURE_UNIFORM_NAME ); } if( mStretchPixelsX.Size() == 1 && mStretchPixelsY.Size() == 1 ) @@ -487,18 +481,18 @@ void NPatchRenderer::ApplyImageToSampler() uint16_t stretchWidth = stretchX.GetY() - stretchX.GetX(); uint16_t stretchHeight = stretchY.GetY() - stretchY.GetX(); - sampler.RegisterProperty( "uFixed[0]", Vector2::ZERO ); - sampler.RegisterProperty( "uFixed[1]", Vector2( stretchX.GetX(), stretchY.GetX()) ); - sampler.RegisterProperty( "uFixed[2]", Vector2( mImageSize.GetWidth() - stretchWidth, mImageSize.GetHeight() - stretchHeight ) ); - sampler.RegisterProperty( "uStretchTotal", Vector2( stretchWidth, stretchHeight ) ); + material.RegisterProperty( "uFixed[0]", Vector2::ZERO ); + material.RegisterProperty( "uFixed[1]", Vector2( stretchX.GetX(), stretchY.GetX()) ); + material.RegisterProperty( "uFixed[2]", Vector2( mImageSize.GetWidth() - stretchWidth, mImageSize.GetHeight() - stretchHeight ) ); + material.RegisterProperty( "uStretchTotal", Vector2( stretchWidth, stretchHeight ) ); } else { - sampler.RegisterProperty( "uNinePatchFactorsX[0]", Vector2::ZERO ); - sampler.RegisterProperty( "uNinePatchFactorsY[0]", Vector2::ZERO ); + material.RegisterProperty( "uNinePatchFactorsX[0]", Vector2::ZERO ); + material.RegisterProperty( "uNinePatchFactorsY[0]", Vector2::ZERO ); - RegisterStretchProperties( sampler, "uNinePatchFactorsX", mStretchPixelsX, mImageSize.GetWidth() ); - RegisterStretchProperties( sampler, "uNinePatchFactorsY", mStretchPixelsY, mImageSize.GetHeight() ); + RegisterStretchProperties( material, "uNinePatchFactorsX", mStretchPixelsX, mImageSize.GetWidth() ); + RegisterStretchProperties( material, "uNinePatchFactorsY", mStretchPixelsY, mImageSize.GetHeight() ); } } } diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp index 3841229..92c5b42 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp @@ -263,9 +263,9 @@ Material AtlasGlyphManager::GetMaterial( uint32_t atlasId ) const return mAtlasManager.GetMaterial( atlasId ); } -Sampler AtlasGlyphManager::GetSampler( uint32_t atlasId ) const +Image AtlasGlyphManager::GetImage( uint32_t atlasId ) const { - return mAtlasManager.GetSampler( atlasId ); + return mAtlasManager.GetImage( atlasId ); } AtlasGlyphManager::~AtlasGlyphManager() diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h index 5ba6740..da659bc 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h @@ -121,7 +121,7 @@ public: /** * @copydoc Toolkit::AtlasGlyphManager::GetMaterial */ - Sampler GetSampler( uint32_t atlasId ) const; + Image GetImage( uint32_t atlasId ) const; /** * @copydoc Toolkit::AtlasGlyphManager::GetMetrics diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp index 463a3e8..39ce202 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp @@ -117,9 +117,9 @@ Material AtlasGlyphManager::GetMaterial( uint32_t atlasId ) const return GetImplementation(*this).GetMaterial( atlasId ); } -Sampler AtlasGlyphManager::GetSampler( uint32_t atlasId ) const +Image AtlasGlyphManager::GetImage( uint32_t atlasId ) const { - return GetImplementation(*this).GetSampler( atlasId ); + return GetImplementation(*this).GetImage( atlasId ); } const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics() diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h index a74ce28..2deba24 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h @@ -164,7 +164,7 @@ public: * * @return The sampler used by the atlas */ - Sampler GetSampler( uint32_t atlasId ) const; + Image GetImage( uint32_t atlasId ) const; /** * @brief Get Glyph Manager metrics diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp index 7c629fd..80459a8 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp @@ -718,9 +718,8 @@ struct AtlasRenderer::Impl : public ConnectionTracker quadGeometry.AddVertexBuffer( quadVertices ); quadGeometry.SetIndexBuffer( quadIndices ); - Sampler sampler = Sampler::New( meshRecord.mBuffer, "sTexture" ); Material material = Material::New( mGlyphManager.GetEffectBufferShader() ); - material.AddSampler( sampler ); + material.AddTexture(meshRecord.mBuffer, "sTexture"); Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material ); @@ -751,8 +750,8 @@ struct AtlasRenderer::Impl : public ConnectionTracker normGeometry.SetIndexBuffer( normIndices ); Material normMaterial = Material::New( mGlyphManager.GetGlyphShadowShader() ); - Sampler normSampler = mGlyphManager.GetSampler( meshRecord.mAtlasId ); - normMaterial.AddSampler( normSampler ); + Image normImage = mGlyphManager.GetImage( meshRecord.mAtlasId ); + normMaterial.AddTexture( normImage, "sTexture" ); Dali::Renderer normRenderer = Dali::Renderer::New( normGeometry, normMaterial ); Actor subActor = Actor::New(); subActor.AddRenderer( normRenderer ); -- 2.7.4