X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fmodel3d-view%2Fmodel3d-view-impl.cpp;h=5b4990934cba635b84ffb416228a7f218eec10a2;hp=dd907475d7f149409eeb82e09852f0a13c179a9a;hb=ed11499452da1ccd5fdfa36324881dc66a5281bc;hpb=709f6618b60d366c84e259564c53b6ef0c43b717 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 dd90747..5b49909 100644 --- a/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp +++ b/dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -25,12 +25,12 @@ #include #include #include -#include #include -#include +#include // INTERNAL INCLUDES #include +#include namespace Dali { @@ -60,12 +60,11 @@ enum TextureIndex Texture LoadTexture( const char* imageUrl ) { Texture texture; - Dali::BitmapLoader loader = Dali::BitmapLoader::New( imageUrl ); - loader.Load(); - PixelData pixelData = loader.GetPixelData(); - if( pixelData ) + Devel::PixelBuffer pixelBuffer = LoadImageFromFile( imageUrl ); + if( pixelBuffer ) { - texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() ); + texture = Texture::New( TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() ); + PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer ); texture.Upload( pixelData ); texture.GenerateMipmaps(); } @@ -426,10 +425,8 @@ Property::Value Model3dView::GetProperty( BaseObject* object, Property::Index in ///////////////////////////////////////////////////////////// -void Model3dView::OnStageConnection( int depth ) +void Model3dView::OnSceneConnection( int depth ) { - Control::OnStageConnection( depth ); - CustomActor self = Self(); self.AddRenderer( mRenderer ); @@ -449,6 +446,8 @@ void Model3dView::OnStageConnection( int depth ) constraint.AddSource( Source( self, Toolkit::Model3dView::Property::LIGHT_POSITION ) ); constraint.Apply(); } + + Control::OnSceneConnection( depth ); } /////////////////////////////////////////////////////////// @@ -463,6 +462,10 @@ void Model3dView::OnInitialize() Shader shader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER ); mRenderer = Renderer::New( mesh, shader ); + DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) { + return std::unique_ptr< Dali::Accessibility::Accessible >( + new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::IMAGE ) ); + } ); } void Model3dView::LoadGeometry()