2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali/public-api/dali-core.h>
19 #include <dali-test-suite-utils.h>
23 #include <mesh-builder.h>
27 void TestConstraintNoBlue( Vector4& current, const PropertyInputContainer& inputs )
34 void material_test_startup(void)
36 test_return_value = TET_UNDEF;
39 void material_test_cleanup(void)
41 test_return_value = TET_PASS;
44 int UtcDaliMaterialNew01(void)
46 TestApplication application;
48 Shader shader = Shader::New("vertexSrc", "fragmentSrc");
49 Material material = Material::New(shader);
51 DALI_TEST_CHECK( material );
55 int UtcDaliMaterialNew02(void)
57 TestApplication application;
59 DALI_TEST_CHECK( !material );
63 int UtcDaliMaterialCopyConstructor(void)
65 TestApplication application;
67 Shader shader = Shader::New("vertexSrc", "fragmentSrc");
68 Image image = BufferImage::New(32, 32, Pixel::RGBA8888);
69 Material material = Material::New(shader);
70 material.AddTexture( image, "sTexture" );
72 Material materialCopy(material);
74 DALI_TEST_CHECK( materialCopy );
79 int UtcDaliMaterialAssignmentOperator(void)
81 TestApplication application;
83 Shader shader = Shader::New("vertexSrc", "fragmentSrc");
84 Image image = BufferImage::New(32, 32, Pixel::RGBA8888);
85 Material material = Material::New(shader);
88 DALI_TEST_CHECK( !material2 );
91 DALI_TEST_CHECK( material2 );
96 int UtcDaliMaterialDownCast01(void)
98 TestApplication application;
99 Shader shader = Shader::New("vertexSrc", "fragmentSrc");
100 Material material = Material::New(shader);
102 BaseHandle handle(material);
103 Material material2 = Material::DownCast(handle);
104 DALI_TEST_CHECK( material2 );
109 int UtcDaliMaterialDownCast02(void)
111 TestApplication application;
113 Handle handle = Handle::New(); // Create a custom object
114 Material material = Material::DownCast(handle);
115 DALI_TEST_CHECK( !material );
119 int UtcDaliMaterialSetShader(void)
121 TestApplication application;
123 tet_infoline("Test SetShader(shader) ");
125 Shader shader1 = Shader::New( "vertexSrc1", "fragmentSrc1" );
126 shader1.RegisterProperty( "uFadeColor", Color::CYAN );
128 Shader shader2 = Shader::New( "vertexSrc1", "fragmentSrc1" );
129 shader2.RegisterProperty( "uFadeColor", Color::MAGENTA );
132 Material material = Material::New(shader1);
134 Geometry geometry = CreateQuadGeometry();
135 Renderer renderer = Renderer::New( geometry, material );
137 Actor actor = Actor::New();
138 actor.AddRenderer(renderer);
139 actor.SetSize(400, 400);
140 Stage::GetCurrent().Add(actor);
142 TestGlAbstraction& gl = application.GetGlAbstraction();
143 application.SendNotification();
144 application.Render(0);
145 Vector4 actualValue(Vector4::ZERO);
146 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
147 DALI_TEST_EQUALS( actualValue, Color::CYAN, TEST_LOCATION );
150 material.SetShader( shader2 );
152 application.SendNotification();
153 application.Render(0);
154 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
155 DALI_TEST_EQUALS( actualValue, Color::MAGENTA, TEST_LOCATION );
158 material.SetShader( shader1 );
160 application.SendNotification();
161 application.Render(0);
162 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
163 DALI_TEST_EQUALS( actualValue, Color::CYAN, TEST_LOCATION );
168 int UtcDaliMaterialGetShader(void)
170 TestApplication application;
172 tet_infoline("Test GetShader() ");
174 Shader shader1 = Shader::New( "vertexSrc1", "fragmentSrc1" );
175 Shader shader2 = Shader::New( "vertexSrc1", "fragmentSrc1" );
178 Material material = Material::New(shader1);
179 DALI_TEST_EQUALS( shader1, material.GetShader(), TEST_LOCATION );
182 material.SetShader( shader2 );
183 DALI_TEST_EQUALS( shader2, material.GetShader(), TEST_LOCATION );
186 material.SetShader( shader1 );
187 DALI_TEST_EQUALS( shader1, material.GetShader(), TEST_LOCATION );
192 int UtcDaliMaterialGetNumberOfTextures(void)
194 TestApplication application;
196 tet_infoline("Test GetNumberOfTextures()");
198 Image image = BufferImage::New(32, 32, Pixel::RGBA8888);
199 Material material = CreateMaterial();
201 Geometry geometry = CreateQuadGeometry();
202 Renderer renderer = Renderer::New( geometry, material );
203 Actor actor = Actor::New();
204 actor.AddRenderer(renderer);
205 actor.SetParentOrigin( ParentOrigin::CENTER );
206 actor.SetSize(400, 400);
207 Stage::GetCurrent().Add( actor );
209 material.AddTexture( image, "sTexture0" );
210 material.AddTexture( image, "sTexture1" );
211 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 2u, TEST_LOCATION );
213 material.AddTexture( image, "sTexture2" );
214 material.AddTexture( image, "sTexture3" );
215 material.AddTexture( image, "sTexture4" );
216 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 5u, TEST_LOCATION );
218 material.RemoveTexture(3);
219 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 4u, TEST_LOCATION );
221 material.RemoveTexture(3);
222 material.RemoveTexture(0);
223 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 2u, TEST_LOCATION );
228 int UtcDaliMaterialConstraint(void)
230 TestApplication application;
232 tet_infoline("Test that a custom material property can be constrained");
234 Shader shader = Shader::New( "VertexSource", "FragmentSource");
235 Material material = Material::New( shader );
237 Geometry geometry = CreateQuadGeometry();
238 Renderer renderer = Renderer::New( geometry, material );
240 Actor actor = Actor::New();
241 actor.AddRenderer(renderer);
242 actor.SetSize(400, 400);
243 Stage::GetCurrent().Add(actor);
245 Vector4 initialColor = Color::WHITE;
246 Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
248 application.SendNotification();
249 application.Render(0);
250 DALI_TEST_EQUALS( material.GetProperty<Vector4>(colorIndex), initialColor, TEST_LOCATION );
253 Constraint constraint = Constraint::New<Vector4>( material, colorIndex, TestConstraintNoBlue );
255 application.SendNotification();
256 application.Render(0);
258 // Expect no blue component in either buffer - yellow
259 DALI_TEST_EQUALS( material.GetProperty<Vector4>(colorIndex), Color::YELLOW, TEST_LOCATION );
260 application.Render(0);
261 DALI_TEST_EQUALS( material.GetProperty<Vector4>(colorIndex), Color::YELLOW, TEST_LOCATION );
263 material.RemoveConstraints();
264 material.SetProperty(colorIndex, Color::WHITE );
265 application.SendNotification();
266 application.Render(0);
267 DALI_TEST_EQUALS( material.GetProperty<Vector4>(colorIndex), Color::WHITE, TEST_LOCATION );
272 int UtcDaliMaterialConstraint02(void)
274 TestApplication application;
276 tet_infoline("Test that a uniform map material property can be constrained");
278 Shader shader = Shader::New( "VertexSource", "FragmentSource");
279 Material material = Material::New( shader );
281 Geometry geometry = CreateQuadGeometry();
282 Renderer renderer = Renderer::New( geometry, material );
284 Actor actor = Actor::New();
285 actor.AddRenderer(renderer);
286 actor.SetSize(400, 400);
287 Stage::GetCurrent().Add(actor);
288 application.SendNotification();
289 application.Render(0);
291 Vector4 initialColor = Color::WHITE;
292 Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
294 TestGlAbstraction& gl = application.GetGlAbstraction();
296 application.SendNotification();
297 application.Render(0);
299 Vector4 actualValue(Vector4::ZERO);
300 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
301 DALI_TEST_EQUALS( actualValue, initialColor, TEST_LOCATION );
304 Constraint constraint = Constraint::New<Vector4>( material, colorIndex, TestConstraintNoBlue );
306 application.SendNotification();
307 application.Render(0);
309 // Expect no blue component in either buffer - yellow
310 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
311 DALI_TEST_EQUALS( actualValue, Color::YELLOW, TEST_LOCATION );
313 application.Render(0);
314 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
315 DALI_TEST_EQUALS( actualValue, Color::YELLOW, TEST_LOCATION );
317 material.RemoveConstraints();
318 material.SetProperty(colorIndex, Color::WHITE );
319 application.SendNotification();
320 application.Render(0);
322 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
323 DALI_TEST_EQUALS( actualValue, Color::WHITE, TEST_LOCATION );
328 int UtcDaliMaterialAnimatedProperty01(void)
330 TestApplication application;
332 tet_infoline("Test that a non-uniform material property can be animated");
334 Shader shader = Shader::New( "VertexSource", "FragmentSource");
335 Material material = Material::New( shader );
337 Geometry geometry = CreateQuadGeometry();
338 Renderer renderer = Renderer::New( geometry, material );
340 Actor actor = Actor::New();
341 actor.AddRenderer(renderer);
342 actor.SetSize(400, 400);
343 Stage::GetCurrent().Add(actor);
345 Vector4 initialColor = Color::WHITE;
346 Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
348 application.SendNotification();
349 application.Render(0);
350 DALI_TEST_EQUALS( material.GetProperty<Vector4>(colorIndex), initialColor, TEST_LOCATION );
352 Animation animation = Animation::New(1.0f);
353 KeyFrames keyFrames = KeyFrames::New();
354 keyFrames.Add(0.0f, initialColor);
355 keyFrames.Add(1.0f, Color::TRANSPARENT);
356 animation.AnimateBetween( Property( material, colorIndex ), keyFrames );
359 application.SendNotification();
360 application.Render(500);
362 DALI_TEST_EQUALS( material.GetProperty<Vector4>(colorIndex), Color::WHITE * 0.5f, TEST_LOCATION );
364 application.Render(500);
366 DALI_TEST_EQUALS( material.GetProperty<Vector4>(colorIndex), Color::TRANSPARENT, TEST_LOCATION );
371 int UtcDaliMaterialAnimatedProperty02(void)
373 TestApplication application;
375 tet_infoline("Test that a uniform map material property can be animated");
377 Shader shader = Shader::New( "VertexSource", "FragmentSource");
378 Material material = Material::New( shader );
380 Geometry geometry = CreateQuadGeometry();
381 Renderer renderer = Renderer::New( geometry, material );
383 Actor actor = Actor::New();
384 actor.AddRenderer(renderer);
385 actor.SetSize(400, 400);
386 Stage::GetCurrent().Add(actor);
387 application.SendNotification();
388 application.Render(0);
390 Vector4 initialColor = Color::WHITE;
391 Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
393 TestGlAbstraction& gl = application.GetGlAbstraction();
395 application.SendNotification();
396 application.Render(0);
398 Vector4 actualValue(Vector4::ZERO);
399 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
400 DALI_TEST_EQUALS( actualValue, initialColor, TEST_LOCATION );
402 Animation animation = Animation::New(1.0f);
403 KeyFrames keyFrames = KeyFrames::New();
404 keyFrames.Add(0.0f, initialColor);
405 keyFrames.Add(1.0f, Color::TRANSPARENT);
406 animation.AnimateBetween( Property( material, colorIndex ), keyFrames );
409 application.SendNotification();
410 application.Render(500);
412 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
413 DALI_TEST_EQUALS( actualValue, Color::WHITE * 0.5f, TEST_LOCATION );
415 application.Render(500);
416 DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
417 DALI_TEST_EQUALS( actualValue, Color::TRANSPARENT, TEST_LOCATION );
423 int UtcDaliMaterialSetTextureUniformName01(void)
425 TestApplication application;
427 Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
429 Material material = CreateMaterial();
430 material.AddTexture( image, "sTexture" );
432 int textureIndex = material.GetTextureIndex( "sTexture" );
433 DALI_TEST_EQUALS( textureIndex, 0, TEST_LOCATION );
435 material.SetTextureUniformName( 0, "sEffectTexture" );
436 textureIndex = material.GetTextureIndex( "sEffectTexture" );
437 DALI_TEST_EQUALS( textureIndex, 0, TEST_LOCATION );
439 Geometry geometry = CreateQuadGeometry();
440 Renderer renderer = Renderer::New( geometry, material );
441 Actor actor = Actor::New();
442 actor.AddRenderer(renderer);
443 actor.SetParentOrigin( ParentOrigin::CENTER );
444 actor.SetSize(400, 400);
446 Stage::GetCurrent().Add( actor );
448 TestGlAbstraction& gl = application.GetGlAbstraction();
450 application.SendNotification();
451 application.Render();
454 DALI_TEST_CHECK( gl.GetUniformValue<int>( "sEffectTexture", textureUnit ) );
455 DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
460 int UtcDaliMaterialSetTextureUniformName02(void)
462 TestApplication application;
464 Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
465 Image image2 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
467 Material material = CreateMaterial();
468 material.AddTexture( image, "sTexture");
469 material.SetTextureUniformName( 0, "sEffectTexture" );
470 material.AddTexture( image2, "sTexture2");
472 int textureIndex = material.GetTextureIndex( "sEffectTexture" );
473 DALI_TEST_EQUALS( textureIndex, 0, TEST_LOCATION );
475 textureIndex = material.GetTextureIndex( "sTexture2" );
476 DALI_TEST_EQUALS( textureIndex, 1, TEST_LOCATION );
478 Geometry geometry = CreateQuadGeometry();
479 Renderer renderer = Renderer::New( geometry, material );
480 Actor actor = Actor::New();
481 actor.AddRenderer(renderer);
482 actor.SetParentOrigin( ParentOrigin::CENTER );
483 actor.SetSize(400, 400);
485 Stage::GetCurrent().Add( actor );
487 TestGlAbstraction& gl = application.GetGlAbstraction();
489 application.SendNotification();
490 application.Render();
493 DALI_TEST_CHECK( gl.GetUniformValue<int>( "sEffectTexture", textureUnit ) );
494 DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
496 DALI_TEST_CHECK( gl.GetUniformValue<int>( "sTexture2", textureUnit ) );
497 DALI_TEST_EQUALS( textureUnit, 1, TEST_LOCATION );
502 int UtcDaliMaterialAddTexture01(void)
504 TestApplication application;
506 Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
508 Material material = CreateMaterial();
509 material.AddTexture( image, "sTexture");
511 Geometry geometry = CreateQuadGeometry();
512 Renderer renderer = Renderer::New( geometry, material );
513 Actor actor = Actor::New();
514 actor.AddRenderer(renderer);
515 actor.SetParentOrigin( ParentOrigin::CENTER );
516 actor.SetSize(400, 400);
518 Stage::GetCurrent().Add( actor );
520 TestGlAbstraction& gl = application.GetGlAbstraction();
522 TraceCallStack& texParameterTrace = gl.GetTexParameterTrace();
523 texParameterTrace.Reset();
524 texParameterTrace.Enable( true );
525 application.SendNotification();
526 application.Render();
529 DALI_TEST_CHECK( gl.GetUniformValue<int>( "sTexture", textureUnit ) );
530 DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
532 texParameterTrace.Enable( false );
535 // There are three calls to TexParameteri when the texture is first created
536 // as the texture is using default sampling parametrers there shouldn't be any more calls to TexParameteri
537 DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 3, TEST_LOCATION);
542 int UtcDaliMaterialAddTexture02(void)
544 TestApplication application;
546 Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
548 Material material = CreateMaterial();
550 Sampler sampler = Sampler::New();
551 sampler.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
552 material.AddTexture( image, "sTexture", sampler );
554 Geometry geometry = CreateQuadGeometry();
555 Renderer renderer = Renderer::New( geometry, material );
556 Actor actor = Actor::New();
557 actor.AddRenderer(renderer);
558 actor.SetParentOrigin( ParentOrigin::CENTER );
559 actor.SetSize(400, 400);
561 Stage::GetCurrent().Add( actor );
563 TestGlAbstraction& gl = application.GetGlAbstraction();
565 TraceCallStack& texParameterTrace = gl.GetTexParameterTrace();
566 texParameterTrace.Reset();
567 texParameterTrace.Enable( true );
568 application.SendNotification();
569 application.Render();
572 DALI_TEST_CHECK( gl.GetUniformValue<int>( "sTexture", textureUnit ) );
573 DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
575 texParameterTrace.Enable( false );
578 // There are three calls to TexParameteri when the texture is first created
579 // Texture minification and magnification filters are now different than default so
580 //there should have been two extra TexParameteri calls to set the new filter mode
581 DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 4, TEST_LOCATION);
586 int UtcDaliMaterialRemoveTexture(void)
588 TestApplication application;
590 Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
592 Material material = CreateMaterial();
593 material.RemoveTexture(0);
594 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 0u, TEST_LOCATION );
596 material.RemoveTexture(1);
597 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 0u, TEST_LOCATION );
599 Sampler sampler = Sampler::New();
600 sampler.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
601 material.AddTexture( image, "sTexture", sampler );
602 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 1u, TEST_LOCATION );
604 material.RemoveTexture(1);
605 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 1u, TEST_LOCATION );
607 material.RemoveTexture(0);
608 DALI_TEST_EQUALS( material.GetNumberOfTextures(), 0u, TEST_LOCATION );
613 int UtcDaliMaterialSetSampler(void)
615 TestApplication application;
617 Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
619 Material material = CreateMaterial();
620 material.AddTexture( image, "sTexture");
622 Geometry geometry = CreateQuadGeometry();
623 Renderer renderer = Renderer::New( geometry, material );
624 Actor actor = Actor::New();
625 actor.AddRenderer(renderer);
626 actor.SetParentOrigin( ParentOrigin::CENTER );
627 actor.SetSize(400, 400);
629 Stage::GetCurrent().Add( actor );
631 TestGlAbstraction& gl = application.GetGlAbstraction();
633 TraceCallStack& texParameterTrace = gl.GetTexParameterTrace();
634 texParameterTrace.Reset();
635 texParameterTrace.Enable( true );
636 application.SendNotification();
637 application.Render();
640 DALI_TEST_CHECK( gl.GetUniformValue<int>( "sTexture", textureUnit ) );
641 DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
643 texParameterTrace.Enable( false );
646 // There are three calls to TexParameteri when the texture is first created
647 // as the texture is using default sampling parametrers there shouldn't be any more calls to TexParameteri
648 DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 3, TEST_LOCATION);
650 texParameterTrace.Reset();
651 texParameterTrace.Enable( true );
653 Sampler sampler = Sampler::New();
654 sampler.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
655 material.SetTextureSampler(0, sampler );
658 application.SendNotification();
659 application.Render();
661 texParameterTrace.Enable( false );
664 //There should have been two calls to TexParameteri to set the new filtering mode
665 DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 2, TEST_LOCATION);
671 int UtcDaliMaterialGetTextureIndex(void)
673 TestApplication application;
675 Image image0 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
676 Image image1 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
677 Image image2 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
678 Image image3 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
681 Material material = CreateMaterial();
682 material.AddTexture( image0, "sTexture0");
683 material.AddTexture( image1, "sTexture1");
684 material.AddTexture( image2, "sTexture2");
685 material.AddTexture( image3, "sTexture3");
687 int textureIndex = material.GetTextureIndex( "sTexture0" );
688 DALI_TEST_EQUALS( textureIndex, 0, TEST_LOCATION );
690 textureIndex = material.GetTextureIndex( "sTexture1" );
691 DALI_TEST_EQUALS( textureIndex, 1, TEST_LOCATION );
693 textureIndex = material.GetTextureIndex( "sTexture2" );
694 DALI_TEST_EQUALS( textureIndex, 2, TEST_LOCATION );
696 textureIndex = material.GetTextureIndex( "sTexture3" );
697 DALI_TEST_EQUALS( textureIndex, 3, TEST_LOCATION );
699 material.RemoveTexture(1);
701 textureIndex = material.GetTextureIndex( "sTexture0" );
702 DALI_TEST_EQUALS( textureIndex, 0, TEST_LOCATION );
704 textureIndex = material.GetTextureIndex( "sTexture2" );
705 DALI_TEST_EQUALS( textureIndex, 1, TEST_LOCATION );
707 textureIndex = material.GetTextureIndex( "sTexture3" );
708 DALI_TEST_EQUALS( textureIndex, 2, TEST_LOCATION );
713 int UtcDaliMaterialGetTextureP(void)
715 TestApplication application;
717 Image image0 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
718 Image image1 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
719 Image image2 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
720 Image image3 = BufferImage::New( 64, 64, Pixel::RGBA8888 );
723 Material material = CreateMaterial();
724 material.AddTexture( image0, "sTexture0");
725 material.AddTexture( image1, "sTexture1");
726 material.AddTexture( image2, "sTexture2");
727 material.AddTexture( image3, "sTexture3");
729 Image textureImage0 = material.GetTexture( "sTexture0" );
730 DALI_TEST_EQUALS( textureImage0, image0, TEST_LOCATION );
732 Image textureImage1 = material.GetTexture( "sTexture1" );
733 DALI_TEST_EQUALS( textureImage1, image1, TEST_LOCATION );
735 Image textureImage2 = material.GetTexture( "sTexture2" );
736 DALI_TEST_EQUALS( textureImage2, image2, TEST_LOCATION );
738 Image textureImage3 = material.GetTexture( "sTexture3" );
739 DALI_TEST_EQUALS( textureImage3, image3, TEST_LOCATION );
744 int UtcDaliMaterialGetTextureN(void)
746 TestApplication application;
748 Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
750 Material material = CreateMaterial();
751 material.AddTexture( image, "sTexture");
753 Image textureImage = material.GetTexture( "sTextureTEST" );
754 DALI_TEST_CHECK( !textureImage );