2 * Copyright (c) 2017 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.
19 #include <dali/internal/event/rendering/sampler-impl.h> // Dali::Internal::Sampler
22 #include <dali/internal/event/common/stage-impl.h>
23 #include <dali/internal/update/manager/update-manager.h>
24 #include <dali/internal/render/renderers/render-sampler.h>
31 SamplerPtr Sampler::New( )
33 SamplerPtr sampler( new Sampler() );
34 sampler->Initialize();
38 void Sampler::SetFilterMode( Dali::FilterMode::Type minFilter, Dali::FilterMode::Type magFilter )
40 if( NULL != mRenderObject )
42 SetFilterModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, static_cast< unsigned int >( minFilter ), static_cast< unsigned int >( magFilter ) );
46 void Sampler::SetWrapMode( Dali::WrapMode::Type rWrap, Dali::WrapMode::Type sWrap, Dali::WrapMode::Type tWrap )
48 if( NULL != mRenderObject )
50 SetWrapModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, static_cast< unsigned int >( rWrap ), static_cast< unsigned int >( sWrap ), static_cast< unsigned int >( tWrap ) );
54 Render::Sampler* Sampler::GetSamplerRenderObject()
61 :mEventThreadServices( *Stage::GetCurrent() ),
66 void Sampler::Initialize()
68 SceneGraph::UpdateManager& updateManager = mEventThreadServices.GetUpdateManager();
70 mRenderObject = new Render::Sampler();
71 OwnerPointer< Render::Sampler > transferOwnership( mRenderObject );
72 AddSamplerMessage( updateManager, transferOwnership );
77 if( EventThreadServices::IsCoreRunning() && mRenderObject )
79 SceneGraph::UpdateManager& updateManager = mEventThreadServices.GetUpdateManager();
80 RemoveSamplerMessage( updateManager, *mRenderObject );
84 } // namespace Internal