/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// EXTERNAL INCLUDES
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/images/texture-set-image.h>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
Actor CreateMeshActorToStage( TestApplication& application, Vector3 parentOrigin = ParentOrigin::CENTER, Vector3 anchorPoint = AnchorPoint::CENTER, Shader::Hint::Value shaderHints = Shader::Hint::NONE )
{
PixelBuffer* pixelBuffer = new PixelBuffer[ 4 ];
- BufferImage image = BufferImage::New( pixelBuffer, 1, 1 );
+ PixelData pixelData = PixelData::New(pixelBuffer, 4, 1, 1, Pixel::RGBA8888, PixelData::DELETE_ARRAY);
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1);
+ image.Upload(pixelData);
Geometry geometry = CreateQuadGeometry();
Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER, shaderHints );
TextureSet textureSet = TextureSet::New();
- TextureSetImage( textureSet, 0u, image );
+ textureSet.SetTexture(0u, image);
Renderer renderer = Renderer::New( geometry, shader );
renderer.SetTextures( textureSet );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
return textureSet;
}
+TextureSet CreateTextureSet( Texture texture )
+{
+ TextureSet textureSet = TextureSet::New();
+ textureSet.SetTexture(0u, texture);
+ return textureSet;
+}
+
PropertyBuffer CreatePropertyBuffer()
{
Property::Map texturedQuadVertexFormat;
#define MESH_BUILDER_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Shader CreateShader();
TextureSet CreateTextureSet();
TextureSet CreateTextureSet( Image image );
+TextureSet CreateTextureSet( Texture texture );
Geometry CreateQuadGeometry();
PropertyBuffer CreatePropertyBuffer();
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Actor CreateRenderableActor()
{
- return CreateRenderableActor( Image(), VERTEX_SHADER, FRAGMENT_SHADER );
+ return CreateRenderableActor( Texture(), VERTEX_SHADER, FRAGMENT_SHADER );
+}
+
+Actor CreateRenderableActor( Texture texture )
+{
+ return CreateRenderableActor( texture, VERTEX_SHADER, FRAGMENT_SHADER );
+}
+
+Actor CreateRenderableActor( Texture texture, const std::string& vertexShader, const std::string& fragmentShader )
+{
+ // Create the geometry
+ Geometry geometry = CreateQuadGeometry();
+
+ // Create Shader
+ Shader shader = Shader::New( vertexShader, fragmentShader );
+
+ // Create renderer from geometry and material
+ Renderer renderer = Renderer::New( geometry, shader );
+
+ // Create actor and set renderer
+ Actor actor = Actor::New();
+ actor.AddRenderer( renderer );
+
+ // If we a texture, then create a texture-set and add to renderer
+ if( texture )
+ {
+ TextureSet textureSet = TextureSet::New();
+ textureSet.SetTexture( 0u, texture );
+ renderer.SetTextures( textureSet );
+
+ // Set actor to the size of the texture if set
+ actor.SetProperty( Actor::Property::SIZE, Vector2( texture.GetWidth(), texture.GetHeight() ) );
+ }
+
+ return actor;
}
Actor CreateRenderableActor( Image texture )
#define DALI_TEST_ACTOR_UTILS_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
class Actor;
class Image;
+class Texture;
/**
* @brief Creates a simple renderable-actor with solid colored quad.
*/
Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader );
+/**
+ * @brief Creates a renderable-actor with a texture.
+ * @param[in] texture Texture to set.
+ * @return An actor with a renderer.
+ */
+Actor CreateRenderableActor( Texture texture );
+
+/**
+ * @brief Creates a renderable-actor with a texture and custom shaders.
+ * @param[in] texture Texture to set.
+ * @param[in] vertexShader The vertex-shader.
+ * @param[in] fragmentShader The fragment-shader.
+ * @return An actor with a renderer.
+ */
+Actor CreateRenderableActor( Texture texture, const std::string& vertexShader, const std::string& fragmentShader );
+
} // namespace Dali
#endif // DALI_TEST_ACTOR_UTILS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
ids.push_back( 10 ); // third rendered actor
app.GetGlAbstraction().SetNextTextureIds( ids );
- BufferImage imageA = BufferImage::New(16, 16);
- BufferImage imageB = BufferImage::New(16, 16);
- BufferImage imageC = BufferImage::New(16, 16);
+ Texture imageA = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
+ Texture imageB = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
+ Texture imageC = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
Actor a = CreateRenderableActor( imageA );
Actor b = CreateRenderableActor( imageB );
Actor c = CreateRenderableActor( imageC );
// Clipping test helper functions:
Actor CreateActorWithContent( uint32_t width, uint32_t height)
{
- BufferImage image = BufferImage::New( width, height );
+ Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
Actor actor = CreateRenderableActor( image );
// Setup dimensions and position so actor is not skipped by culling.
Actor actors[5];
for( int i = 0; i < 5; ++i )
{
- BufferImage image = BufferImage::New( 16u, 16u );
+ Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 16u, 16u );
Actor actor = CreateRenderableActor( image );
// Setup dimensions and position so actor is not skipped by culling.
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
TestApplication application;
tet_infoline( "Testing Dali::CameraActor Test view application" );
- BufferImage image = CreateBufferImage();
-
- Actor actor = CreateRenderableActor(image);
+ Actor actor = CreateRenderableActor();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::POSITION, Vector3( 20.0f, 30.0f, 40.0f ));
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
application.Render( 0 );
application.Render();
application.SendNotification();
- Image image = CreateBufferImage();
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 4u, 4u);
Actor actor = CreateRenderableActor( image, RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE );
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Stage::GetCurrent().Add( actor );
// Create bitmap actor
static Actor CreateBitmapActor()
{
- BufferImage image = BufferImage::New(4,4,Pixel::RGBA8888);
- Actor actor = CreateRenderableActor( image );
+ Actor actor = CreateRenderableActor();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::NAME,"Test Image Rendering Actor");
return actor;
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
stage.Add( layer );
// Create a clipping actor and add it to the layer.
- Actor clippingActor = CreateRenderableActor( Dali::BufferImage::WHITE() );
+ Actor clippingActor = CreateRenderableActor();
clippingActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
clippingActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
clippingActor.SetProperty( Actor::Property::SIZE, Vector2( 50.0f, 50.0f ) );
layer.Add( clippingActor );
// Create a renderable actor and add it to the clipping actor.
- Actor childActor = CreateRenderableActor( Dali::BufferImage::WHITE() );
+ Actor childActor = CreateRenderableActor();
childActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
childActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
childActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
Vector2 stageSize ( stage.GetSize() );
// FrameBufferImage for offscreen RenderTask
- FrameBufferImage frameBufferImage( FrameBufferImage::New( stageSize.width, stageSize.height, Pixel::RGBA8888 ) );
+ FrameBuffer frameBuffer = FrameBuffer::New( stageSize.width, stageSize.height );
// Create a renderable actor to display the FrameBufferImage
- Actor renderableActor = CreateRenderableActor( frameBufferImage );
+ Actor renderableActor = CreateRenderableActor(frameBuffer.GetColorTexture());
renderableActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
renderableActor.SetProperty( Actor::Property::SIZE, Vector2( stageSize.x, stageSize.y ) );
renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
// Create a RenderTask
RenderTask renderTask = stage.GetRenderTaskList().CreateTask();
renderTask.SetSourceActor( actor );
- renderTask.SetTargetFrameBuffer( frameBufferImage );
+ renderTask.SetFrameBuffer(frameBuffer);
renderTask.SetInputEnabled( true );
// Create another RenderTask
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
tet_infoline("Testing Dali::Layer::SetSortFunction()");
TestApplication application;
- BufferImage img = BufferImage::New( 1,1 );
+
// create two transparent actors so there is something to sort
- Actor actor = CreateRenderableActor( img );
- Actor actor2 = CreateRenderableActor( img );
+ Actor actor = CreateRenderableActor();
+ Actor actor2 = CreateRenderableActor();
actor.SetProperty( Actor::Property::SIZE, Vector2( 1, 1 ) );
actor.SetProperty( Actor::Property::COLOR, Vector4(1, 1, 1, 0.5f ) ); // 50% transparent
actor2.SetProperty( Actor::Property::SIZE, Vector2( 1, 1 ) );
layer.SetClippingBox( testBox );
// Add at least one renderable actor so the GL calls are actually made
- BufferImage img = BufferImage::New( 1,1 );
+ Texture img = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor actor = CreateRenderableActor( img );
stage.Add( actor );
Actor CreateActor( bool withAlpha )
{
- Dali::BufferImage bufferImage;
-
- if( withAlpha )
- {
- bufferImage = Dali::BufferImage::WHITE();
- }
- else
- {
- bufferImage = BufferImage::New( 1u, 1u, Pixel::RGB888 );
- PixelBuffer* pBuffer = bufferImage.GetBuffer();
- if( pBuffer )
- {
- pBuffer[0] = pBuffer[1] = pBuffer[2] = 0xFF;
- }
- }
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, withAlpha ? Pixel::Format::RGBA8888 : Pixel::Format::RGB888, 1u, 1u );
- Actor actor = CreateRenderableActor( bufferImage );
+ Actor actor = CreateRenderableActor( texture );
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
Actor actor = task.GetSourceActor();
DALI_TEST_CHECK( actor );
- BufferImage img = BufferImage::New( 1,1 );
+ Texture img = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor newActor = CreateRenderableActor( img );
newActor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
stage.Add( newActor );
DALI_TEST_CHECK( actor );
- BufferImage img = BufferImage::New( 1,1 );
+ Texture img = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor newActor = CreateRenderableActor( img );
newActor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
stage.Add( newActor );
TraceCallStack& drawTrace = gl.GetDrawTrace();
drawTrace.Enable(true);
- BufferImage img = BufferImage::New( 1,1 );
+ Texture img = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor newActor = CreateRenderableActor( img );
newActor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
task.SetSourceActor( newActor );
Actor actor = task.GetSourceActor();
DALI_TEST_CHECK( actor );
- BufferImage img = BufferImage::New( 1,1 );
+ Texture img = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor newActor = CreateRenderableActor( img );
newActor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
stage.Add( newActor );
Actor actor = task.GetSourceActor();
DALI_TEST_CHECK( actor );
- BufferImage img = BufferImage::New( 1,1 );
+ Texture img = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
+
Actor newActor = CreateRenderableActor( img );
newActor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
stage.Add( newActor );
ids.push_back( 10 ); // 10 = actor3
application.GetGlAbstraction().SetNextTextureIds( ids );
- BufferImage img1 = BufferImage::New( 1,1 );
+ Texture img1 = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor actor1 = CreateRenderableActor( img1 );
actor1.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
Stage::GetCurrent().Add( actor1 );
}
}
- BufferImage img2 = BufferImage::New( 1,1 );
+ Texture img2 = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
+
Actor actor2 = CreateRenderableActor( img2 );
actor2.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
}
- BufferImage img3 = BufferImage::New( 1,1 );
+ Texture img3 = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor actor3 = CreateRenderableActor( img3 );
actor3.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
ids.push_back( 8 ); // 8 = actor1
application.GetGlAbstraction().SetNextTextureIds( ids );
- BufferImage img1 = BufferImage::New( 1,1 );
+ Texture img1 = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor actor1 = CreateRenderableActor( img1 );
actor1.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
Stage::GetCurrent().Add( actor1 );
Stage::GetCurrent().Add( offscreenCameraActor );
- BufferImage image = BufferImage::New( 10, 10 );
- image.Update();
+ Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 10, 10 );
Actor rootActor = CreateRenderableActor( image );
rootActor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
Stage::GetCurrent().Add( rootActor );
Stage::GetCurrent().Add( offscreenCameraActor );
- BufferImage image = BufferImage::New( 10, 10 );
+ Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 10, 10 );
Actor rootActor = CreateRenderableActor( image );
rootActor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
rootActor.SetProperty( Actor::Property::VISIBLE,false);
Stage stage = Stage::GetCurrent();
- BufferImage image = BufferImage::New( 10, 10 );
+ Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 10, 10 );
Actor rootActor = CreateRenderableActor( image );
rootActor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
stage.Add( rootActor );
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
tet_infoline("Test setting the blend mode to auto with an opaque color and an image with an alpha channel renders with blending enabled");
Geometry geometry = CreateQuadGeometry();
- BufferImage image = BufferImage::New( 40, 40, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40);
Shader shader = CreateShader();
TextureSet textureSet = CreateTextureSet( image );
Geometry geometry = CreateQuadGeometry();
Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
- BufferImage image = BufferImage::New( 50, 50, Pixel::RGB888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGB888, 50, 50);
TextureSet textureSet = CreateTextureSet( image );
Renderer renderer = Renderer::New( geometry, shader );
renderer.SetTextures( textureSet );
Geometry geometry = CreateQuadGeometry();
Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
TextureSet textureSet = TextureSet::New();
- BufferImage image = BufferImage::New( 50, 50, Pixel::RGBA8888 );
- TextureSetImage( textureSet, 0u, image );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 50, 50);
+ textureSet.SetTexture(0u, image);
Renderer renderer = Renderer::New( geometry, shader );
renderer.SetTextures( textureSet );
tet_infoline("Test the uniform map precedence is applied properly");
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
Shader shader = Shader::New("VertexSource", "FragmentSource");
TextureSet textureSet = CreateTextureSet( image );
tet_infoline("Test the uniform map precedence is applied properly");
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
Shader shader = Shader::New("VertexSource", "FragmentSource");
TextureSet textureSet = CreateTextureSet( image );
tet_infoline("Test the uniform map precedence is applied properly");
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
Shader shader = Shader::New("VertexSource", "FragmentSource");
TextureSet textureSet = CreateTextureSet( image );
tet_infoline("Test the uniform maps are collected from all objects (same type)");
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
Shader shader = Shader::New("VertexSource", "FragmentSource");
TextureSet textureSet = CreateTextureSet( image );
tet_infoline("Test the uniform maps are collected from all objects (different types)");
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
Shader shader = Shader::New("VertexSource", "FragmentSource");
TextureSet textureSet = CreateTextureSet( image );
Renderer CreateRenderer( Actor actor, Geometry geometry, Shader shader, int depthIndex )
{
- Image image0 = BufferImage::New( 64, 64, Pixel::RGB888 );
+ Texture image0 = Texture::New(TextureType::TEXTURE_2D, Pixel::RGB888, 64, 64);
TextureSet textureSet0 = CreateTextureSet( image0 );
Renderer renderer0 = Renderer::New( geometry, shader );
renderer0.SetTextures( textureSet0 );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
TestApplication application;
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
Sampler sampler = Sampler::New();
TextureSet textureSet = CreateTextureSet();
- TextureSetImage( textureSet, 0u, image );
+ textureSet.SetTexture(0u, image);
textureSet.SetSampler( 0u, sampler );
Shader shader = CreateShader();
{
TestApplication application;
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
TextureSet textureSet = CreateTextureSet();
Sampler sampler = Sampler::New();
- TextureSetImage( textureSet, 0u, image );
+ textureSet.SetTexture(0u, image);
textureSet.SetSampler( 0u, sampler );
Shader shader = CreateShader();
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
DALI_TEST_EQUALS( map.Find( "height" )->Get< int >(), 400, TEST_LOCATION );
}
- // BufferImage
- {
- Image image = BufferImage::New( 200, 300, Pixel::A8 );
- Property::Map map;
- CreatePropertyMap( image, map );
- DALI_TEST_CHECK( NULL != map.Find( "type" ) );
- DALI_TEST_EQUALS( map.Find( "type" )->Get< std::string >(), "BufferImage", TEST_LOCATION );
- DALI_TEST_CHECK( NULL != map.Find( "pixelFormat") );
- DALI_TEST_EQUALS( map.Find( "pixelFormat" )->Get< std::string >(), "A8", TEST_LOCATION );
- }
-
// FrameBufferImage
{
Image image = FrameBufferImage::New( 200, 300, Pixel::RGBA8888 );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
TestApplication application;
- Image image = BufferImage::New(32, 32, Pixel::RGBA8888);
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 32, 32);
TextureSet textureSet = TextureSet::New();
- TextureSetImage( textureSet, 0u, image );
+ textureSet.SetTexture( 0u, image );
TextureSet textureSetCopy(textureSet);
{
TestApplication application;
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
Shader shader = CreateShader();
TextureSet textureSet = CreateTextureSet( image );
TextureSet textureSet = CreateTextureSet();
DALI_TEST_EQUALS( textureSet.GetTextureCount(), 0u, TEST_LOCATION );
- Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
- TextureSetImage( textureSet, 0u, image );
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64);
+ textureSet.SetTexture( 0u, image );
DALI_TEST_EQUALS( textureSet.GetTextureCount(), 1u, TEST_LOCATION );
- TextureSetImage( textureSet, 1u, image );
+ textureSet.SetTexture( 1u, image );
DALI_TEST_EQUALS( textureSet.GetTextureCount(), 2u, TEST_LOCATION );
Sampler sampler = Sampler::New();
textureSet.SetSampler( 2u, sampler );
DALI_TEST_EQUALS( textureSet.GetTextureCount(), 2u, TEST_LOCATION );
- TextureSetImage( textureSet, 2u, image );
+ textureSet.SetTexture( 2u, image );
DALI_TEST_EQUALS( textureSet.GetTextureCount(), 3u, TEST_LOCATION );
DALI_TEST_EQUALS( textureSet.GetSampler(2u), sampler, TEST_LOCATION );
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Vector2 stageSize ( stage.GetSize() );
// FrameBufferImage for offscreen RenderTask
- FrameBufferImage frameBufferImage( FrameBufferImage::New( stageSize.width, stageSize.height, Pixel::RGBA8888 ) );
+ FrameBuffer frameBuffer = FrameBuffer::New(stageSize.width, stageSize.height);
// Create a renderable actor to display the FrameBufferImage
- Actor renderableActor = CreateRenderableActor( frameBufferImage );
+ Actor renderableActor = CreateRenderableActor(frameBuffer.GetColorTexture());
renderableActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
renderableActor.SetProperty( Actor::Property::SIZE, Vector2( stageSize.x, stageSize.y ) );
renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
// Create a RenderTask
RenderTask renderTask = stage.GetRenderTaskList().CreateTask();
renderTask.SetSourceActor( actor );
- renderTask.SetTargetFrameBuffer( frameBufferImage );
+ renderTask.SetFrameBuffer(frameBuffer);
renderTask.SetInputEnabled( true );
// Create another RenderTask
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Stage stage ( Stage::GetCurrent() );
Vector2 stageSize ( stage.GetSize() );
- // FrameBufferImage for offscreen RenderTask
- FrameBufferImage frameBufferImage( FrameBufferImage::New( stageSize.width, stageSize.height, Pixel::RGBA8888 ) );
+ // FrameBuffer for offscreen RenderTask
+ FrameBuffer frameBuffer = FrameBuffer::New( stageSize.width, stageSize.height );
// Create a renderable actor to display the FrameBufferImage
- Actor renderableActor = CreateRenderableActor( frameBufferImage );
+ Actor renderableActor = CreateRenderableActor(frameBuffer.GetColorTexture());
renderableActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
renderableActor.SetProperty( Actor::Property::SIZE, Vector2( stageSize.x, stageSize.y ) );
renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
// Create a RenderTask
RenderTask renderTask = stage.GetRenderTaskList().CreateTask();
renderTask.SetSourceActor( actor );
- renderTask.SetTargetFrameBuffer( frameBufferImage );
+ renderTask.SetFrameBuffer( frameBuffer );
renderTask.SetInputEnabled( true );
// Create another RenderTask