X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-platform-abstraction.cpp;h=218279a933fbeef4f0ddd32e5639b18a246aa771;hp=db1cae2dc03c8f63c71d2baa9ad25adac223b5a8;hb=d5e3ed5f5b1c8fdba3ae97ead8729620f54b3836;hpb=827603cec5a42a6de410cd04797f4cc86360a063 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp index db1cae2..218279a 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp @@ -1,22 +1,23 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ #include "test-platform-abstraction.h" #include "dali-test-suite-utils.h" -#include +#include namespace Dali { @@ -187,21 +188,21 @@ const PixelSize TestPlatformAbstraction::GetFontLineHeightFromCapsHeight(const s Integration::GlyphSet* TestPlatformAbstraction::GetGlyphData ( const Integration::TextResourceType& textRequest, const std::string& fontFamily, - bool getImageData) const + bool getBitmap) const { - if( getImageData ) + if( getBitmap ) { - mTrace.PushCall("GetGlyphData", "getImageData:true"); + mTrace.PushCall("GetGlyphData", "getBitmap:true"); } else { - mTrace.PushCall("GetGlyphData", "getImageData:false"); + mTrace.PushCall("GetGlyphData", "getBitmap:false"); } // It creates fake metrics for the received characters. Integration::GlyphSet* set = new Dali::Integration::GlyphSet(); - Integration::ImageDataPtr bitmapData; + Integration::BitmapPtr bitmapData; std::set characters; @@ -212,9 +213,10 @@ Integration::GlyphSet* TestPlatformAbstraction::GetGlyphData ( const Integration characters.insert( it->character ); Integration::GlyphMetrics character = {it->character, Integration::GlyphMetrics::LOW_QUALITY, 10.0f, 10.0f, 9.0f, 1.0f, 10.0f, it->xPosition, it->yPosition }; - if( getImageData ) + if( getBitmap ) { - bitmapData = Dali::Integration::NewBitmapImageData( 64, 64, Pixel::A8 ); + bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true); + bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64); PixelBuffer* pixelBuffer = bitmapData->GetBuffer(); memset( pixelBuffer, it->character, 64*64 ); } @@ -243,7 +245,7 @@ Integration::GlyphSet* TestPlatformAbstraction::GetCachedGlyphData( const Integr // It creates fake metrics and bitmap for received numeric characters '0' through '9'. Integration::GlyphSet* set = new Dali::Integration::GlyphSet(); - Integration::ImageDataPtr bitmapData; + Integration::BitmapPtr bitmapData; std::set characters; @@ -254,7 +256,8 @@ Integration::GlyphSet* TestPlatformAbstraction::GetCachedGlyphData( const Integr characters.insert( it->character ); Integration::GlyphMetrics character = {it->character, Integration::GlyphMetrics::HIGH_QUALITY, 10.0f, 10.0f, 9.0f, 1.0f, 10.0f, it->xPosition, it->yPosition }; - bitmapData = Dali::Integration::NewBitmapImageData( 64, 64, Pixel::A8 ); + bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true); + bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64); PixelBuffer* pixelBuffer = bitmapData->GetBuffer(); memset( pixelBuffer, it->character, 64*64 ); set->AddCharacter(bitmapData, character); @@ -440,10 +443,13 @@ void TestPlatformAbstraction::GetFileNamesFromDirectory( const std::string& dire } -Integration::ImageDataPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const +Integration::BitmapPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const { - Integration::ImageDataPtr image = Dali::Integration::NewBitmapImageData( 1, 1, Pixel::RGBA8888 ); + Integration::BitmapPtr image = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true ); + image->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 1, 1 ); + mTrace.PushCall("GetGlyphImage", ""); + return image; }