Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / effects / renderer / engine-model / FUiEffects_RendererEngineModelTexture2DAttachmentProperty.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FUiEffects_RendererEngineModelTexture2DAttachmentProperty.cpp
20  * @brief               This file contains implementation of Texture2DAttachmentProperty class
21  *
22  */
23
24 #include <renderer/engine-model/FUiEffects_RendererEngineModelTexture2DAttachmentProperty.h>
25
26 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer { namespace EngineModel
27 {
28
29 void
30 Texture2dAttachmentProperty::Visit(PropertyVisitor& v)
31 {
32         v.OnTexture2DAttachmentProperty(*this);
33         return;
34 }
35
36 Texture2dAttachmentProperty::Texture2dAttachmentProperty(
37         bool generateMipmaps,
38         InternalFormat::Value internalFormat,
39         DataFormat::Value dataFormat,
40         DataType::Value dataType,
41         FilterType::Value minFilter,
42         FilterType::Value magFilter,
43         WrapType::Value wrapS,
44         WrapType::Value wrapT):
45         _generateMipmaps(generateMipmaps),
46         _internalFormat(internalFormat),
47         _dataFormat(dataFormat),
48         _dataType(dataType),
49         _minFilter(minFilter),
50         _magFilter(magFilter),
51         _wrapS(wrapS),
52         _wrapT(wrapT)
53 {
54
55 }
56
57 Texture2dAttachmentProperty::~Texture2dAttachmentProperty(void)
58 {
59         if (__pCache)
60         {
61                 __pCache->Die();
62         }
63 }
64
65 void
66 Texture2dAttachmentProperty::SetMipmapGeneration(bool generateMipmaps)
67 {
68         _generateMipmaps = generateMipmaps;
69         return;
70 }
71
72 bool
73 Texture2dAttachmentProperty::GetGenerateMipmaps(void) const
74 {
75         return _generateMipmaps;
76 }
77
78 TextureProperty::InternalFormat::Value
79 Texture2dAttachmentProperty::GetInternalFormat(void) const
80 {
81         return _internalFormat;
82 }
83
84 TextureProperty::DataFormat::Value
85 Texture2dAttachmentProperty::GetDataFormat(void) const
86 {
87         return _dataFormat;
88 }
89
90 TextureProperty::DataType::Value
91 Texture2dAttachmentProperty::GetDataType(void) const
92 {
93         return _dataType;
94 }
95
96 TextureProperty::FilterType::Value
97 Texture2dAttachmentProperty::GetMinFilter(void) const
98 {
99         return _minFilter;
100 }
101
102 TextureProperty::FilterType::Value
103 Texture2dAttachmentProperty::GetMagFilter(void) const
104 {
105         return _magFilter;
106 }
107
108 TextureProperty::WrapType::Value
109 Texture2dAttachmentProperty::GetWrapS(void) const
110 {
111         return _wrapS;
112 }
113
114 TextureProperty::WrapType::Value
115 Texture2dAttachmentProperty::GetWrapT(void) const
116 {
117         return _wrapT;
118 }
119
120 TextureProperty::WrapType::Value
121 Texture2dAttachmentProperty::GetWrapR(void) const
122 {
123         return WrapType::CLAMP_TO_EDGE;
124 }
125
126 CachePtr
127 Texture2dAttachmentProperty::GetCache(void)
128 {
129         return __pCache;
130 }
131
132 void
133 Texture2dAttachmentProperty::SetCache(CachePtr pCache)
134 {
135         if (__pCache)
136         {
137                 __pCache->Die();
138         }
139         __pCache = pCache;
140         return;
141 }
142
143 void
144 Texture2dAttachmentProperty::TouchCache(void)
145 {
146         if (__pCache)
147         {
148                 __pCache->Invalidate();
149         }
150         return;
151 }
152
153 }}}}} //Tizen::Ui::Effects::_Renderer::EngineModel