Messages and ownership of update objects
[platform/core/uifw/dali-core.git] / dali / internal / update / effects / scene-graph-sampler.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 // CLASS HEADER
18 #include "scene-graph-sampler.h"
19
20 // EXTERNAL HEADERS
21
22
23 namespace Dali
24 {
25 namespace Internal
26 {
27 namespace SceneGraph
28 {
29
30 Sampler::Sampler( const std::string& samplerName )
31 : mUniformName( samplerName ),
32   mTextureId( 0 ),
33   mMinFilter( Dali::Sampler::DEFAULT ),
34   mMagFilter( Dali::Sampler::DEFAULT ),
35   mUWrapMode( Dali::Sampler::CLAMP_TO_EDGE ),
36   mVWrapMode( Dali::Sampler::CLAMP_TO_EDGE )
37 {
38 }
39
40 Sampler::~Sampler()
41 {
42 }
43
44 void Sampler::SetUniformName( const std::string& samplerName )
45 {
46 }
47
48 void Sampler::SetTextureId( ResourceId textureId )
49 {
50   mTextureId = textureId;
51 }
52
53 void Sampler::SetFilterMode( BufferIndex bufferIndex, FilterMode minFilter, FilterMode magFilter )
54 {
55   mMinFilter[bufferIndex] = minFilter;
56   mMagFilter[bufferIndex] = magFilter;
57 }
58
59 void Sampler::SetWrapMode( BufferIndex bufferIndex, WrapMode uWrap, WrapMode vWrap )
60 {
61 }
62
63 const std::string& Sampler::GetUniformName()
64 {
65   // @todo MESH_REWORK
66   return mUniformName;
67 }
68
69 Integration::ResourceId Sampler::GetTextureId()
70 {
71   // @todo MESH_REWORK
72   return mTextureId;
73 }
74
75 Sampler::FilterMode Sampler::GetMinifyFilterMode( BufferIndex bufferIndex )
76 {
77   // @todo MESH_REWORK
78   return mMinFilter[bufferIndex];
79 }
80
81 Sampler::FilterMode Sampler::GetMagnifyFilterMode( BufferIndex bufferIndex )
82 {
83   // @todo MESH_REWORK
84   return mMagFilter[bufferIndex];
85 }
86
87 Sampler::WrapMode Sampler::GetUWrapMode( BufferIndex bufferIndex )
88 {
89   // @todo MESH_REWORK
90   return mUWrapMode[bufferIndex];
91 }
92
93 Sampler::WrapMode Sampler::GetVWrapMode( BufferIndex bufferIndex )
94 {
95   // @todo MESH_REWORK
96   return mVWrapMode[bufferIndex];
97 }
98
99 bool Sampler::IsFullyOpaque()
100 {
101   return true; // @todo MESH_REWORK - check the actual image. For the moment, pretend it's opaque
102 }
103
104 } // namespace SceneGraph
105 } // namespace Internal
106 } // namespace Dali