From: Andrew Cox Date: Wed, 7 May 2014 12:49:43 +0000 (+0100) Subject: Bitmap Toolkit Patch 1 of 1 - Replace uses of Bitmap class with ImageData X-Git-Tag: dali-2014-wk20-release~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=827603cec5a42a6de410cd04797f4cc86360a063;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Bitmap Toolkit Patch 1 of 1 - Replace uses of Bitmap class with ImageData [Issue#] N/A [Problem] TCT test framework has mock adaptor components that use the old Bitmap class, so TCT tests can't pass. [Cause] Out of date use of old class. [Solution] Replace Bitmap usage with ImageData. Change-Id: I46814d7d693bf7cba27a1a3426285ec0963b4e3c Signed-off-by: Andrew Cox --- 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 27e806e..db1cae2 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 @@ -16,7 +16,7 @@ #include "test-platform-abstraction.h" #include "dali-test-suite-utils.h" -#include +#include namespace Dali { @@ -187,21 +187,21 @@ const PixelSize TestPlatformAbstraction::GetFontLineHeightFromCapsHeight(const s Integration::GlyphSet* TestPlatformAbstraction::GetGlyphData ( const Integration::TextResourceType& textRequest, const std::string& fontFamily, - bool getBitmap) const + bool getImageData) const { - if( getBitmap ) + if( getImageData ) { - mTrace.PushCall("GetGlyphData", "getBitmap:true"); + mTrace.PushCall("GetGlyphData", "getImageData:true"); } else { - mTrace.PushCall("GetGlyphData", "getBitmap:false"); + mTrace.PushCall("GetGlyphData", "getImageData:false"); } // It creates fake metrics for the received characters. Integration::GlyphSet* set = new Dali::Integration::GlyphSet(); - Integration::BitmapPtr bitmapData; + Integration::ImageDataPtr bitmapData; std::set characters; @@ -212,10 +212,9 @@ 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( getBitmap ) + if( getImageData ) { - bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true); - bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64); + bitmapData = Dali::Integration::NewBitmapImageData( 64, 64, Pixel::A8 ); PixelBuffer* pixelBuffer = bitmapData->GetBuffer(); memset( pixelBuffer, it->character, 64*64 ); } @@ -244,7 +243,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::BitmapPtr bitmapData; + Integration::ImageDataPtr bitmapData; std::set characters; @@ -255,8 +254,7 @@ 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 = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true); - bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64); + bitmapData = Dali::Integration::NewBitmapImageData( 64, 64, Pixel::A8 ); PixelBuffer* pixelBuffer = bitmapData->GetBuffer(); memset( pixelBuffer, it->character, 64*64 ); set->AddCharacter(bitmapData, character); @@ -442,13 +440,10 @@ void TestPlatformAbstraction::GetFileNamesFromDirectory( const std::string& dire } -Integration::BitmapPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const +Integration::ImageDataPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const { - Integration::BitmapPtr image = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true ); - image->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 1, 1 ); - + Integration::ImageDataPtr image = Dali::Integration::NewBitmapImageData( 1, 1, Pixel::RGBA8888 ); mTrace.PushCall("GetGlyphImage", ""); - return image; } diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h index 5051fce..5c70e97 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h @@ -152,7 +152,7 @@ public: */ virtual Integration::GlyphSet* GetGlyphData ( const Integration::TextResourceType& textRequest, const std::string& fontFamily, - bool getBitmap) const; + bool getImageData ) const; /** * @copydoc PlatformAbstraction::GetCachedGlyphData() @@ -233,7 +233,7 @@ public: virtual void GetFileNamesFromDirectory( const std::string& directoryName, std::vector& fileNames ); - virtual Integration::BitmapPtr GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const; + virtual Integration::ImageDataPtr GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const; public: // TEST FUNCTIONS