-//
-// 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"
/**
* @copydoc PlatformAbstraction::GetDefaultFontFamily()
*/
-std::string TestPlatformAbstraction::GetDefaultFontFamily() const
+const std::string& TestPlatformAbstraction::GetDefaultFontFamily() const
{
mTrace.PushCall("GetDefaultFontFamily", "");
return mGetDefaultFontFamilyResult;
/**
* @copydoc PlatformAbstraction::GetDefaultFontSize()
*/
-const float TestPlatformAbstraction::GetDefaultFontSize() const
+float TestPlatformAbstraction::GetDefaultFontSize() const
{
mTrace.PushCall("GetDefaultFontSize", "");
return mGetDefaultFontSizeResult;
}
-const PixelSize TestPlatformAbstraction::GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, const CapsHeight& capsHeight) const
+PixelSize TestPlatformAbstraction::GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const
{
mTrace.PushCall("GetFontLineHeightFromCapsHeight", "");
// LineHeight will be bigger than CapsHeight, so return capsHeight + 1
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<uint32_t> characters;
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 = Integration::NewBitmapImageData( 64, 64, Pixel::A8 );
+ bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD);
+ bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
memset( pixelBuffer, it->character, 64*64 );
}
// 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<uint32_t> characters;
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::NewBitmapImageData( 64, 64, Pixel::A8 );
+ bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD);
+ bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
memset( pixelBuffer, it->character, 64*64 );
set->AddCharacter(bitmapData, character);
/**
* @copydoc PlatformAbstraction::GetFontFamilyForChars()
*/
-std::string TestPlatformAbstraction::GetFontFamilyForChars(const TextArray& charsRequested) const
+const std::string& TestPlatformAbstraction::GetFontFamilyForChars(const Integration::TextArray& charsRequested) const
{
mTrace.PushCall("GetFontFamilyForChars", "");
return mGetDefaultFontFamilyResult;
/**
* @copydoc PlatformAbstraction::AllGlyphsSupported()
*/
-bool TestPlatformAbstraction::AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const TextArray& text) const
+bool TestPlatformAbstraction::AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const Integration::TextArray& text) const
{
mTrace.PushCall("AllGlyphsSupported", "");
return true;
/**
* @copydoc PlatformAbstraction::GetFontList()
*/
-std::vector<std::string> TestPlatformAbstraction::GetFontList( PlatformAbstraction::FontListMode mode ) const
+void TestPlatformAbstraction::GetFontList( PlatformAbstraction::FontListMode mode, std::vector<std::string>& fontList ) const
{
mFontListMode = mode;
mTrace.PushCall("ValidateGetFontList", "");
- std::vector<std::string> fontList;
- return fontList;
}
/**
fileNames.push_back( std::string( "u1f601.png" ) );
}
-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 = Integration::NewBitmapImageData( 1, 1, Pixel::A8 );
+ Integration::BitmapPtr image = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
+ image->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 1, 1 );
mTrace.PushCall("GetGlyphImage", "");
return image;
}
-
/** Call this every test */
void TestPlatformAbstraction::Initialize()
{