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.
18 * @file FUiEffects_RendererMemoryTexture2DProperty.cpp
19 * @brief This is the source file for the MemoryTexture2DProperty class
22 #include <FUiEffects_RendererMemoryTexture2DProperty.h>
23 #include <FUiEffects_RendererLog.h>
25 using namespace Tizen::Ui::Effects::_Renderer::EngineModel;
27 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer
30 MemoryTexture2DProperty::MemoryTexture2DProperty(void)
32 unsigned char pix[4] = {255, 0, 128, 255};
36 MemoryTexture2DProperty::~MemoryTexture2DProperty(void)
42 MemoryTexture2DProperty::GetFormatSize(void)
44 switch (GetDataFormat())
46 case TextureProperty::DataFormat::RGB:
49 case TextureProperty::DataFormat::BGR:
52 case TextureProperty::DataFormat::RGBA:
55 case TextureProperty::DataFormat::BGRA:
58 default: ; //ASSERTLOG(0);
64 MemoryTexture2DProperty::SetData(const void* ptr, size_t width, size_t height)
68 __data.Resize(__width * __height * GetFormatSize());
72 __data.Copy(ptr, __data.Size(), 0);
80 }}}} //Tizen::Ui::Effects::_Renderer