2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @file FGrp_BufferInfoImpl.cpp
20 * @brief This is the implementation file for %_BufferInfoImpl class.
24 #include <FGrpBufferInfo.h>
26 #include "FGrp_BufferInfoImpl.h"
29 namespace Tizen { namespace Graphics
32 _BufferInfoImpl::_BufferInfoImpl()
33 : __handleType(HANDLE_TYPE_NONE)
34 , __handle(INVALID_BUFFER_HANDLE)
35 , __orientation(ORIENTATION_PORTRAIT)
36 , __rotation(ROTATION_0)
40 _BufferInfoImpl::_BufferInfoImpl(const _BufferInfoImpl& src)
41 : __handleType(src.__handleType)
42 , __handle(src.__handle)
43 , __orientation(src.__orientation)
44 , __rotation(ROTATION_0)
48 _BufferInfoImpl::~_BufferInfoImpl()
53 _BufferInfoImpl::operator =(const _BufferInfoImpl& rhs)
60 this->__handle = rhs.__handle;
61 this->__orientation = rhs.__orientation;
67 _BufferInfoImpl::GetHandle(HandleType handleType) const
71 case HANDLE_TYPE_OVERLAY_REGION:
72 case HANDLE_TYPE_VE_SURFACE:
73 case HANDLE_TYPE_CANVAS_TEXTURE:
74 return (__handleType == handleType) ? __handle : INVALID_BUFFER_HANDLE;
75 case HANDLE_TYPE_NONE:
77 return INVALID_BUFFER_HANDLE;
82 _BufferInfoImpl::SetHandle(HandleType handleType, int handle)
86 case HANDLE_TYPE_NONE:
87 __handleType = HANDLE_TYPE_NONE;
88 __handle = INVALID_BUFFER_HANDLE;
90 case HANDLE_TYPE_OVERLAY_REGION:
91 case HANDLE_TYPE_VE_SURFACE:
92 case HANDLE_TYPE_CANVAS_TEXTURE:
93 __handleType = handleType;
99 _BufferInfoImpl::Orientation
100 _BufferInfoImpl::GetOrientation(void) const
102 return __orientation;
106 _BufferInfoImpl::SetOrientation(_BufferInfoImpl::Orientation orientation)
108 if (orientation >= ORIENTATION_PORTRAIT && orientation <= ORIENTATION_LANDSCAPE_REVERSE)
110 __orientation = orientation;
114 __orientation = ORIENTATION_PORTRAIT;
119 _BufferInfoImpl::GetBounds(void) const
125 _BufferInfoImpl::SetBounds(const Rectangle& bounds)
127 __bounds.x = bounds.x;
128 __bounds.y = bounds.y;
129 __bounds.width = bounds.width;
130 __bounds.height = bounds.height;
133 _BufferInfoImpl::Rotation
134 _BufferInfoImpl::GetRotation(void) const
140 _BufferInfoImpl::SetRotation(_BufferInfoImpl::Rotation rotation)
142 if (rotation >= ROTATION_0 && rotation <= ROTATION_270)
144 __rotation = rotation;
148 __rotation = ROTATION_0;
153 _BufferInfoImpl::GetInstance(BufferInfo& bufferInfo)
155 return (&bufferInfo != null) ? bufferInfo.__pImpl : null;
158 const _BufferInfoImpl*
159 _BufferInfoImpl::GetInstance(const BufferInfo& bufferInfo)
161 return (&bufferInfo != null) ? bufferInfo.__pImpl : null;
164 }} // Tizen::Graphics