mPanMinimumDistance(-1),
mPanMinimumEvents(-1),
mGlesCallTime(0),
+ mWindowWidth( 0 ),
+ mWindowHeight( 0 ),
mLogFunction( NULL )
{
}
return mPanMinimumEvents;
}
+unsigned int EnvironmentOptions::GetWindowWidth() const
+{
+ return mWindowWidth;
+}
+
+unsigned int EnvironmentOptions::GetWindowHeight() const
+{
+ return mWindowHeight;
+}
+
void EnvironmentOptions::SetPanGesturePredictionMode( unsigned int mode )
{
mPanGesturePredictionMode = mode;
return mGlesCallTime;
}
+void EnvironmentOptions::SetWindowWidth( int width )
+{
+ mWindowWidth = width;
+}
+
+void EnvironmentOptions::SetWindowHeight( int height )
+{
+ mWindowHeight = height;
+}
+
bool EnvironmentOptions::PerformanceServerRequired() const
{
return ( (GetPerformanceStatsLoggingOptions() > 0) ||
/**
* Contains environment options which define settings and the ability to install a log function.
+ *
+ * TODO: This file and adaptor needs cleaning up. There should not be any environment options in the adaptor class, only here!
*/
class EnvironmentOptions
{
int GetMinimumPanEvents() const;
/**
+ * @return The width of the window
+ */
+ unsigned int GetWindowWidth() const;
+
+ /**
+ * @return The height of the window
+ */
+ unsigned int GetWindowHeight() const;
+
+ /**
* @brief Sets the mode used to predict pan gesture movement
*
* @param[in] mode The prediction mode to use
int GetGlesCallTime() const;
/**
+ * @brief Sets the width of the window
+ */
+ void SetWindowWidth( int width );
+
+ /**
+ * @brief Sets the width of the window
+ */
+ void SetWindowHeight( int height );
+
+ /**
* @return true if performance server is required
*/
bool PerformanceServerRequired() const;
int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
- int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
- float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
+ int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
+ float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
int mPanMinimumDistance; ///< minimum distance required before pan starts
int mPanMinimumEvents; ///< minimum events required before pan starts
int mGlesCallTime; ///< time in seconds between status updates
+ unsigned int mWindowWidth; ///< width of the window
+ unsigned int mWindowHeight; ///< height of the window
Dali::Integration::Log::LogFunction mLogFunction;
#define DALI_GLES_CALL_TIME "DALI_GLES_CALL_TIME"
+#define DALI_WINDOW_WIDTH "DALI_WINDOW_WIDTH"
+
+#define DALI_WINDOW_HEIGHT "DALI_WINDOW_HEIGHT"
+
} // namespace Adaptor
} // namespace Internal
#include <vsync-monitor.h>
#include <object-profiler.h>
-#include <slp-logging.h>
+#include <tizen-logging.h>
unsigned int logPanGesture = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PAN_GESTURE, 0 );
- // all threads here (event, update, and render) will send their logs to SLP Platform's LogMessage handler.
- Dali::Integration::Log::LogFunction logFunction(Dali::SlpPlatform::LogMessage);
+ // all threads here (event, update, and render) will send their logs to TIZEN Platform's LogMessage handler.
+ Dali::Integration::Log::LogFunction logFunction(Dali::TizenPlatform::LogMessage);
mEnvironmentOptions.SetLogOptions( logFunction, logFrameRateFrequency, logupdateStatusFrequency, logPerformanceStats, logPerformanceStatsFrequency, performanceTimeStampOutput, logPanGesture );
mEnvironmentOptions.SetGlesCallTime( glesCallTime );
}
+ int windowWidth(0), windowHeight(0);
+ if ( GetIntegerEnvironmentVariable( DALI_WINDOW_WIDTH, windowWidth ) && GetIntegerEnvironmentVariable( DALI_WINDOW_HEIGHT, windowHeight ) )
+ {
+ mEnvironmentOptions.SetWindowWidth( windowWidth );
+ mEnvironmentOptions.SetWindowHeight( windowHeight );
+ }
+
mEnvironmentOptions.InstallLogFunction();
}
{
ParseEnvironmentOptions();
- mPlatformAbstraction = new SlpPlatform::SlpPlatformAbstraction;
+ mPlatformAbstraction = new TizenPlatform::TizenPlatformAbstraction;
std::string path;
GetDataStoragePath( path );
{
Integration::SetPanGestureSmoothingAmount(mEnvironmentOptions.GetPanGestureSmoothingAmount());
}
+ if( mEnvironmentOptions.GetWindowWidth() && mEnvironmentOptions.GetWindowHeight() )
+ {
+ SurfaceResized( PositionSize( 0, 0, mEnvironmentOptions.GetWindowWidth(), mEnvironmentOptions.GetWindowHeight() ));
+ }
}
Adaptor::~Adaptor()
// guarantee map the surface before starting render-thread.
mSurface->Map();
- // NOTE: dpi must be set before starting the render thread
// use default or command line settings if not run on device
-#ifdef __arm__
- // set the DPI value for font rendering
- unsigned int dpiHor, dpiVer;
- dpiHor = dpiVer = 0;
- mSurface->GetDpi(dpiHor, dpiVer);
-
- // tell core about the value
- mCore->SetDpi(dpiHor, dpiVer);
-#else
- mCore->SetDpi(mHDpi, mVDpi);
-#endif
+ if( mHDpi == 0 || mVDpi == 0 )
+ {
+ unsigned int dpiHor, dpiVer;
+ dpiHor = dpiVer = 0;
+ mSurface->GetDpi(dpiHor, dpiVer);
+
+ // tell core about the value
+ mCore->SetDpi(dpiHor, dpiVer);
+ }
+ else
+ {
+ mCore->SetDpi(mHDpi, mVDpi);
+ }
// Tell the core the size of the surface just before we start the render-thread
PositionSize size = mSurface->GetPositionSize();
#include <device-layout.h>
#include <clipboard.h>
-#include <slp-platform-abstraction.h>
+#include <tizen-platform-abstraction.h>
#include <base/interfaces/adaptor-internal-services.h>
#include <base/environment-options.h>
#include <base/core-event-interface.h>
EglFactory* mEglFactory; ///< EGL Factory
RenderSurface* mSurface; ///< Current surface
- SlpPlatform::SlpPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
+ TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
EventHandler* mEventHandler; ///< event handler
CallbackManager* mCallbackManager; ///< Used to install callbacks
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
-class SlpPlatformAbstraction;
+class TizenPlatformAbstraction;
}
namespace Integration
namespace Adaptor
{
-namespace
-{
-// Defaults taken from H2 device
-const unsigned int DEFAULT_WINDOW_WIDTH = 480;
-const unsigned int DEFAULT_WINDOW_HEIGHT = 800;
-const float DEFAULT_HORIZONTAL_DPI = 220;
-const float DEFAULT_VERTICAL_DPI = 217;
-}
-
ApplicationPtr Application::New(
int* argc,
char **argv[],
void Application::CreateWindow()
{
-#ifndef __arm__
- PositionSize windowPosition(0, 0, DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT);
-#else
- PositionSize windowPosition(0, 0, 0, 0); // this will use full screen
-#endif
- if (mCommandLineOptions->stageWidth > 0 && mCommandLineOptions->stageHeight > 0)
+ PositionSize windowPosition(0, 0, 0, 0); // this will use full screen
+
+ if( mCommandLineOptions->stageWidth > 0 && mCommandLineOptions->stageHeight > 0 )
{
// let the command line options over ride
- windowPosition = PositionSize(0,0,mCommandLineOptions->stageWidth,mCommandLineOptions->stageHeight);
+ windowPosition = PositionSize( 0, 0, mCommandLineOptions->stageWidth, mCommandLineOptions->stageHeight );
}
mWindow = Dali::Window::New( windowPosition, mName, mWindowMode == Dali::Application::TRANSPARENT );
mAdaptor = &Dali::Adaptor::New( mWindow, mBaseLayout, mContextLossConfiguration );
- // Allow DPI to be overridden from command line.
- unsigned int hDPI=DEFAULT_HORIZONTAL_DPI;
- unsigned int vDPI=DEFAULT_VERTICAL_DPI;
-
std::string dpiStr = mCommandLineOptions->stageDPI;
if(!dpiStr.empty())
{
+ // Use DPI from command line.
+ unsigned int hDPI = 0;
+ unsigned int vDPI = 0;
+
sscanf(dpiStr.c_str(), "%ux%u", &hDPI, &vDPI);
+
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetDpi(hDPI, vDPI);
}
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetDpi(hDPI, vDPI);
mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
}
{
ImageAttributes attributes;
Integration::BitmapResourceType bitmapResourceType( attributes );
- Integration::ResourcePointer resource = SlpPlatform::ImageLoader::LoadResourceSynchronously( bitmapResourceType, filename );
+ Integration::ResourcePointer resource = TizenPlatform::ImageLoader::LoadResourceSynchronously( bitmapResourceType, filename );
mBitmap = static_cast<Integration::Bitmap*>(resource.Get());
}
{
/**
- * The Framework class is used to register callbacks with the SLP platform so that
+ * The Framework class is used to register callbacks with the TIZEN platform so that
* we know when any of the application lifecycle events occur. This includes events
* like when our application is to be initialised, terminated, paused, resumed etc.
*/
attribs );
DALI_ASSERT_DEBUG( EGL_NO_IMAGE_KHR != eglImage && "X11Image::GlExtensionCreate eglCreateImageKHR failed!\n");
- if( EGL_NO_IMAGE_KHR != eglImage )
+ if( EGL_NO_IMAGE_KHR == eglImage )
{
switch( eglGetError() )
{
// INTERNAL INCLUDES
#if defined(DEBUG_ENABLED)
-#include <slp-logging.h>
+#include <tizen-logging.h>
Debug::Filter* gSingletonServiceLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_SINGLETON_SERVICE" );
// Need to define own macro as the log function is not installed when this object is created so no logging is shown with DALI_LOG_INFO at construction and destruction
#define DALI_LOG_SINGLETON_SERVICE_DIRECT(level, message) \
- if(gSingletonServiceLogFilter && gSingletonServiceLogFilter->IsEnabledFor(level)) { std::string string(message); Dali::SlpPlatform::LogMessage( Debug::DebugInfo, string ); }
+ if(gSingletonServiceLogFilter && gSingletonServiceLogFilter->IsEnabledFor(level)) { std::string string(message); Dali::TizenPlatform::LogMessage( Debug::DebugInfo, string ); }
#define DALI_LOG_SINGLETON_SERVICE(level, format, args...) DALI_LOG_INFO(gSingletonServiceLogFilter, level, format, ## args )
*/
void RotationDone( int orientation, int width, int height );
-
private:
/**
* Private constructor.
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <platform-abstractions/slp/resource-loader/resource-loader.h>
-#include <platform-abstractions/slp/image-loaders/loader-jpeg.h>
-#include <platform-abstractions/slp/image-loaders/loader-png.h>
+#include <platform-abstractions/tizen/resource-loader/resource-loader.h>
+#include <platform-abstractions/tizen/image-loaders/loader-jpeg.h>
+#include <platform-abstractions/tizen/image-loaders/loader-png.h>
#include <image-encoder.h>
namespace Dali
{
case JPG_FORMAT:
{
- return SlpPlatform::EncodeToJpeg( pixelBuffer, encodedPixels, width, height, pixelFormat );
+ return TizenPlatform::EncodeToJpeg( pixelBuffer, encodedPixels, width, height, pixelFormat );
break;
}
case PNG_FORMAT:
{
- return SlpPlatform::EncodeToPng( pixelBuffer, encodedPixels, width, height, pixelFormat );
+ return TizenPlatform::EncodeToPng( pixelBuffer, encodedPixels, width, height, pixelFormat );
break;
}
default:
DALI_LOG_ERROR("Encoding pixels failed");
return false;
}
- return SlpPlatform::ResourceLoader::SaveFile( filename, pixbufEncoded );
+ return TizenPlatform::ResourceLoader::SaveFile( filename, pixbufEncoded );
}
} // namespace Dali
* @brief Get the native handle of the window.
* @return The native handle of the window or an empty handle.
*/
-
Any GetNativeHandle() const;
public: // Signals
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 0;
-const unsigned int ADAPTOR_MICRO_VERSION = 33;
+const unsigned int ADAPTOR_MICRO_VERSION = 34;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
$(adaptor_tizen_dir)/vsync-monitor-tizen.cpp \
$(adaptor_tizen_dir)/tilt-sensor-impl-tizen.cpp \
$(adaptor_tizen_dir)/tts-player-impl-tizen.cpp
-
#include <render-surface.h>
// Allow this to be encoded and saved:
-#include <platform-abstractions/slp/resource-loader/resource-loader.h>
+#include <platform-abstractions/tizen/resource-loader/resource-loader.h>
#include <bitmap-saver.h>
namespace Dali
case Dali::Window::PORTRAIT:
actor.SetParentOrigin( ParentOrigin::TOP_CENTER );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(0), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(0), Vector3::ZAXIS );
break;
case Dali::Window::PORTRAIT_INVERSE:
actor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(180), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(180), Vector3::ZAXIS );
break;
case Dali::Window::LANDSCAPE:
actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(270), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(270), Vector3::ZAXIS );
break;
case Dali::Window::LANDSCAPE_INVERSE:
actor.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(90), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(90), Vector3::ZAXIS );
break;
}
}
$(_adaptor_x11_internal_src_files) \
$(adaptor_x11_dir)/accessibility-manager-impl-x.cpp \
$(adaptor_x11_dir)/framework-x.cpp \
- $(adaptor_x11_dir)/key-impl-x.cpp
+ $(adaptor_x11_dir)/key-impl-x.cpp \
+ $(adaptor_x11_dir)/window-extensions.cpp
adaptor_x11_tv_internal_src_files = \
$(_adaptor_x11_internal_src_files) \
adaptor_x11_internal_default_profile_src_files = \
$(adaptor_x11_dir)/ecore-x-render-surface-factory.cpp \
$(adaptor_x11_dir)/system-settings-x.cpp
+
+public_api_adaptor_tizen_x11_header_files = \
+ $(adaptor_x11_dir)/window-extensions.h
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <window-extensions.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+#include <dali/public-api/common/vector-wrapper.h>
+#include <string>
+#include <sstream>
+#include <Ecore.h>
+#include <Ecore_X.h>
+
+// INTERNAL INCLUDES
+#include <window.h>
+
+namespace
+{
+typedef std::vector< std::string > HintContainer;
+
+const char* HINT_EFFECT_NAME = "wm.comp.win.effect.enable";
+const char* HINT_ENABLE_POSTFIX = ":1";
+const char* HINT_DISABLE_POSTFIX = ":0";
+
+void Tokenize(const std::string& str, HintContainer& hints, const std::string& delimiters = ",")
+{
+ std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
+ std::string::size_type pos = str.find_first_of(delimiters, lastPos);
+
+ while (std::string::npos != pos || std::string::npos != lastPos)
+ {
+ hints.push_back(str.substr(lastPos, pos - lastPos));
+ lastPos = str.find_first_not_of(delimiters, pos);
+ pos = str.find_first_of(delimiters, lastPos);
+ }
+}
+
+void GetAppliedHints( Dali::Window window, HintContainer& hints )
+{
+ Dali::Any nativeWindow = window.GetNativeHandle();
+ if ( !nativeWindow.Empty() )
+ {
+ Ecore_X_Window ecoreWindow;
+ nativeWindow.Get( ecoreWindow );
+
+ unsigned char* data = NULL;
+ int n = 0;
+ int res = ecore_x_window_prop_property_get( ecoreWindow, ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORTED_LIST,
+ ECORE_X_ATOM_STRING, 0, &data, &n );
+
+ if ((res == 8) && (n > 0))
+ {
+ std::stringstream ss;
+ ss << data;
+ Tokenize(ss.str(), hints);
+ }
+
+ free(data);
+ }
+}
+
+}
+
+namespace Dali
+{
+
+namespace WindowExtensions
+{
+
+void EnableEffect( Window window, bool enable )
+{
+ Any nativeWindow = window.GetNativeHandle();
+
+ DALI_ASSERT_ALWAYS( !nativeWindow.Empty() && "Empty window!!!" );
+
+ HintContainer hints;
+ GetAppliedHints( window, hints );
+
+ std::stringstream ss;
+ ss << hints.size() << ":" << HINT_EFFECT_NAME << (enable ? HINT_ENABLE_POSTFIX : HINT_DISABLE_POSTFIX);
+
+ // Applied the window effect to the current window.
+ Ecore_X_Window ecoreWindow;
+ nativeWindow.Get(ecoreWindow);
+ ecore_x_window_prop_property_set( ecoreWindow, ECORE_X_ATOM_E_WINDOW_AUX_HINT,
+ ECORE_X_ATOM_STRING, 8,
+ (void*)ss.str().c_str(), ss.str().size() + 1 );
+}
+
+bool IsEffectEnabled( Window window )
+{
+ Any nativeWindow = window.GetNativeHandle();
+
+ DALI_ASSERT_ALWAYS( !nativeWindow.Empty() && "Empty window!!!" );
+
+ HintContainer hints;
+ GetAppliedHints( window, hints );
+
+ HintContainer::iterator iter = std::find( hints.begin(), hints.end(), HINT_EFFECT_NAME );
+
+ return iter != hints.end();
+}
+
+} // namespace WindowExtensions
+
+} // namespace Dali
+
+
--- /dev/null
+#ifndef __DALI_WINDOW_EXTENSIONS_H__
+#define __DALI_WINDOW_EXTENSIONS_H__
+
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+class Window;
+
+namespace WindowExtensions
+{
+
+/**
+ * @brief Set whether the effect will enable or not.
+ *
+ * The effect will be shown when the application is launched, quit, shown and hiden.
+ *
+ * @note This function is only specified by tizen.
+ *
+ * @param[in] window The window to set.
+ * @param[in] enable True if the effect is enabled.
+ */
+DALI_IMPORT_API void EnableEffect( Window window, bool enable );
+
+/**
+ * @brief Retrieve whether the effect is enabled or not.
+ *
+ * @note This function is only specified by tizen.
+ *
+ * @param[in] window The window to set.
+ * @return True if the effect is enabled.
+ */
+DALI_IMPORT_API bool IsEffectEnabled( Window window );
+
+} // namespace WindowExtensions
+
+} // namespace Dali
+
+#endif // __DALI_WINDOW_EXTENSIONS_H__
case Dali::Window::PORTRAIT:
actor.SetParentOrigin( ParentOrigin::TOP_CENTER );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(0), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(0), Vector3::ZAXIS );
break;
case Dali::Window::PORTRAIT_INVERSE:
actor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(180), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(180), Vector3::ZAXIS );
break;
case Dali::Window::LANDSCAPE:
actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(270), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(270), Vector3::ZAXIS );
break;
case Dali::Window::LANDSCAPE_INVERSE:
actor.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- actor.SetRotation( Degree(90), Vector3::ZAXIS );
+ actor.SetOrientation( Degree(90), Vector3::ZAXIS );
break;
}
}
#include <dali-test-suite-utils.h>
-class StubImageLoaderClient : public Dali::SlpPlatform::ResourceLoadingClient
+class StubImageLoaderClient : public Dali::TizenPlatform::ResourceLoadingClient
{
public:
StubImageLoaderClient() {}
#include <dali/dali.h>
#include <dali/integration-api/bitmap.h>
-#include "platform-abstractions/slp/resource-loader/resource-loading-client.h"
+#include "platform-abstractions/tizen/resource-loader/resource-loading-client.h"
// Simple structure to close the file when finished with it.
struct AutoCloseFile
*/
struct LoadFunctions
{
- typedef bool (*LoadBitmapFunction)(FILE*, Dali::Integration::Bitmap&, Dali::ImageAttributes&, const Dali::SlpPlatform::ResourceLoadingClient& client);
+ typedef bool (*LoadBitmapFunction)(FILE*, Dali::Integration::Bitmap&, Dali::ImageAttributes&, const Dali::TizenPlatform::ResourceLoadingClient& client);
typedef bool (*LoadBitmapHeaderFunction)(FILE*, const Dali::ImageAttributes& attrs, unsigned int& width, unsigned int& height );
LoadFunctions( LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader );
#include <stdlib.h>
#include <dali-test-suite-utils.h>
-#include "platform-abstractions/slp/image-loaders/loader-gif.h"
+#include "platform-abstractions/tizen/image-loaders/loader-gif.h"
#include "image-loaders.h"
using namespace Dali;
namespace {
-static const LoadFunctions GifLoaders( SlpPlatform::LoadGifHeader, SlpPlatform::LoadBitmapFromGif );
+static const LoadFunctions GifLoaders( TizenPlatform::LoadGifHeader, TizenPlatform::LoadBitmapFromGif );
}
END_TEST;
}
+
+/**
+ * @brief Test the four-tap linear blending for single-byte modes.
+ */
+int UtcDaliImageOperationsBilinearFilter1BPP(void)
+{
+ // Zeros blend to zero:
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 0, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 32768, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 65535, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 0, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 0, 65535 ), TEST_LOCATION );
+
+ // Ones and zeros average to 0.5:
+ DALI_TEST_EQUALS( 127u, BilinearFilter1Component( 255, 0, 0, 255, 32768, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 127u, BilinearFilter1Component( 0, 255, 0, 255, 32768, 32768 ), TEST_LOCATION );
+
+ // Quarters ones average to 0.25:
+ DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 255, 0, 0, 0, 32768, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 0, 255, 0, 0, 32768, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 0, 0, 255, 0, 32768, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 0, 0, 0, 255, 32768, 32768 ), TEST_LOCATION );
+
+ // Horizontal blends:
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 255, 0, 255, 0, 32768 ), TEST_LOCATION );
+ for( unsigned y = 0; y < 65536u; y += 256 )
+ {
+ // Vertical blends don't change result in this case as there is no vertical gradient in inputs:
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 255, 0, 255, 0, y ), TEST_LOCATION );
+ }
+ DALI_TEST_EQUALS( 5u, BilinearFilter1Component( 0, 255, 0, 255, 1233, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 29u, BilinearFilter1Component( 0, 255, 0, 255, 7539, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 29u, BilinearFilter1Component( 0, 255, 0, 255, 7539, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 67u, BilinearFilter1Component( 0, 255, 0, 255, 17291, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 123u, BilinearFilter1Component( 0, 255, 0, 255, 31671, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 184u, BilinearFilter1Component( 0, 255, 0, 255, 47231, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 207u, BilinearFilter1Component( 0, 255, 0, 255, 53129, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 239u, BilinearFilter1Component( 0, 255, 0, 255, 61392, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 255u, BilinearFilter1Component( 0, 255, 0, 255, 65535, 32768 ), TEST_LOCATION );
+
+ // Vertical Blends:
+ DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 60u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 15379 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 130u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 33451 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 186u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 47836 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 244u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 62731 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 255u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 65535 ), TEST_LOCATION );
+
+ END_TEST;
+}
${${CAPI_LIB}_INCLUDE_DIRS}
../dali-adaptor/dali-test-suite-utils
../../../adaptors/tizen
- ../../../platform-abstractions/slp
+ ../../../platform-abstractions/tizen
../../../
/usr/include/freetype2
)
*/
#include "resource-collector.h"
-#include "slp-platform-abstraction.h"
+#include "tizen-platform-abstraction.h"
#include <dali/integration-api/debug.h>
namespace Dali
#include <stdlib.h>
#include <dali/dali.h>
#include <dali-test-suite-utils.h>
-#include "slp-platform-abstraction.h"
+#include "tizen-platform-abstraction.h"
#include "resource-collector.h"
using namespace Dali;
include ../../../adaptors/base/file.list
# Platform Abstraction
-slp_platform_abstraction_src_dir = ../../../platform-abstractions/slp
+tizen_platform_abstraction_src_dir = ../../../platform-abstractions/tizen
portable_platform_abstraction_src_dir = ../../../platform-abstractions/portable
-include ../../../platform-abstractions/slp/file.list
+include ../../../platform-abstractions/tizen/file.list
# Internal Common
adaptor_common_dir = ../../../adaptors/common
############# source files #############
if ASSIMP_ENABLED
-slp_platform_abstraction_src_files += $(slp_assimp_src_files)
+tizen_platform_abstraction_src_files += $(tizen_assimp_src_files)
else
-slp_platform_abstraction_src_files += $(slp_assimp_stubs_src_files)
+tizen_platform_abstraction_src_files += $(tizen_assimp_stubs_src_files)
endif # ASSIMP_ENABLED
# COMMON
endif # MOBILE_PROFILE
-# LITE
-if LITE_PROFILE
-
-adaptor_internal_src_files = $(adaptor_common_internal_src_files) \
- $(adaptor_common_internal_mobile_profile_src_files) \
- $(adaptor_tizen_internal_src_files) \
- $(adaptor_x11_tizen_internal_src_files)
-endif
-
-
# WEARABLE
if WEARABLE_PROFILE
endif
if TURBO_JPEG_IS_ON
- slp_platform_abstraction_src_files += $(slp_turbo_jpeg_loader)
+ tizen_platform_abstraction_src_files += $(tizen_turbo_jpeg_loader)
else
- slp_platform_abstraction_src_files += $(slp_jpeg_loader)
+ tizen_platform_abstraction_src_files += $(tizen_jpeg_loader)
endif
lib_LTLIBRARIES = libdali-adaptor.la
libdali_adaptor_la_SOURCES = \
$(base_adaptor_src_files) \
- $(slp_platform_abstraction_src_files) \
+ $(tizen_platform_abstraction_src_files) \
$(public_api_src_files) \
$(adaptor_internal_src_files)
libdali_adaptor_la_DEPENDENCIES =
-# List include directories with more platform-specific (slp) before portable root:
+# List include directories with more platform-specific (tizen) before portable root:
libdali_adaptor_la_includes = \
-I../../.. \
- -I../../../platform-abstractions/slp \
- -I../../../platform-abstractions/slp/resource-loader \
+ -I../../../platform-abstractions/tizen \
+ -I../../../platform-abstractions/tizen/resource-loader \
-I../../../platform-abstractions/portable \
-I../../../platform-abstractions/ \
-I../../../adaptors/public-api \
$(NATIVE_BUFFER_POOL_LIBS)
endif
-if LITE_PROFILE
-libdali_adaptor_la_CXXFLAGS += $(HAPTIC_CFLAGS)
-endif
-
if WEARABLE_PROFILE
libdali_adaptor_la_CXXFLAGS += \
$(HAPTIC_CFLAGS) \
tizenadaptorframeworkpublicapidir = $(tizenadaptorpublicapidir)/adaptor-framework
tizenadaptorframeworkpublicapi_HEADERS = $(public_api_adaptor_framework_header_files)
+if !UBUNTU_PROFILE
+
+if !WAYLAND
+tizenadaptorframeworkpublicapi_HEADERS += $(public_api_adaptor_tizen_x11_header_files)
+endif # NOT WAYLAND
+
+endif # NOT UBUNTU_PROFILE
+
tizenadaptordaliheaderdir = $(devincludepath)/dali
tizenadaptordaliheader_HEADERS = $(adaptor_dali_header_file)
AM_CONDITIONAL([USE_BULLET], [test x$BULLET = xyes && test x$enable_bullet = xyes])
AM_CONDITIONAL([USE_FEEDBACK], [test x$enable_feedback = xyes])
-DALI_ADAPTOR_CFLAGS=-DPLATFORM_SLP
+DALI_ADAPTOR_CFLAGS=-DPLATFORM_TIZEN
AC_ARG_ENABLE(exportall,
[AC_HELP_STRING([--enable-exportall],
# Tizen Profile options
AC_ARG_ENABLE([profile],
- [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,LITE,WEARABLE,TV,UBUNTU],
+ [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
[Select the variant of tizen])],
[enable_profile=$enableval],
[enable_profile=COMMON])
# Ensure valid profile selected
-if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xLITE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
+if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
AC_MSG_ERROR([$enable_profile is an invalid profile])
fi
DALI_PROFILE_CFLAGS=" -DDALI_PROFILE_${enable_profile}"
AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
-AM_CONDITIONAL([LITE_PROFILE], [test x$enable_profile = xLITE])
AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.0.33
+Version: 1.0.34
Release: 1
Group: System/Libraries
License: Apache-2.0
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.0.33
+Version: 1.0.34
Release: 1
Group: System/Libraries
License: Apache-2.0
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.0.33
+Version: 1.0.34
Release: 1
Group: System/Libraries
License: Apache-2.0
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.0.33
+Version: 1.0.34
Release: 1
Group: System/Libraries
License: Apache-2.0
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.0.33
+Version: 1.0.34
Release: 1
Group: System/Libraries
License: Apache-2.0
namespace
{
+
using Integration::Bitmap;
using Integration::BitmapPtr;
typedef unsigned char PixelBuffer;
+/**
+ * @brief 4 byte pixel structure.
+ */
+struct Pixel4Bytes
+{
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+ uint8_t a;
+} __attribute__((packed, aligned(4))); //< Tell the compiler it is okay to use a single 32 bit load.
+
+/**
+ * @brief RGB888 pixel structure.
+ */
+struct Pixel3Bytes
+{
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+} __attribute__((packed, aligned(1)));
+
+/**
+ * @brief RGB565 pixel typedefed from a short.
+ *
+ * Access fields by manual shifting and masking.
+ */
+typedef uint16_t PixelRGB565;
+
+/**
+ * @brief a Pixel composed of two independent byte components.
+ */
+struct Pixel2Bytes
+{
+ uint8_t l;
+ uint8_t a;
+} __attribute__((packed, aligned(2))); //< Tell the compiler it is okay to use a single 16 bit load.
+
+
#if defined(DEBUG_ENABLED)
/**
* Disable logging of image operations or make it verbose from the commandline
}
/**
- * @brief Construct a bitmap object from a copy of the pixel array passed in.
+ * @brief Construct a bitmap with format and dimensions requested.
*/
-BitmapPtr MakeBitmap(const uint8_t * const pixels, Pixel::Format pixelFormat, unsigned int width, unsigned int height )
+BitmapPtr MakeEmptyBitmap( Pixel::Format pixelFormat, unsigned int width, unsigned int height )
{
- DALI_ASSERT_DEBUG( pixels && "Null bitmap buffer to copy." );
DALI_ASSERT_DEBUG( Pixel::GetBytesPerPixel(pixelFormat) && "Compressed formats not supported." );
// Allocate a pixel buffer to hold the image passed in:
Integration::BitmapPtr newBitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
newBitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, width, height, width, height );
+ return newBitmap;
+}
+
+/**
+ * @brief Construct a bitmap object from a copy of the pixel array passed in.
+ */
+BitmapPtr MakeBitmap( const uint8_t * const pixels, Pixel::Format pixelFormat, unsigned int width, unsigned int height )
+{
+ DALI_ASSERT_DEBUG( pixels && "Null bitmap buffer to copy." );
+
+ // Allocate a pixel buffer to hold the image passed in:
+ Integration::BitmapPtr newBitmap = MakeEmptyBitmap( pixelFormat, width, height );
// Copy over the pixels from the downscaled image that was generated in-place in the pixel buffer of the input bitmap:
memcpy( newBitmap->GetBuffer(), pixels, width * height * Pixel::GetBytesPerPixel( pixelFormat ) );
const unsigned int filteredHeight = filteredDimensions.GetHeight();
// Run a filter to scale down the bitmap if it needs it:
- if( (filteredWidth < shrunkWidth || filteredHeight < shrunkHeight) &&
- (filterMode == ImageAttributes::Nearest || filterMode == ImageAttributes::Linear ||
- filterMode == ImageAttributes::BoxThenNearest || filterMode == ImageAttributes::BoxThenLinear) )
+ bool filtered = false;
+ if( filteredWidth < shrunkWidth || filteredHeight < shrunkHeight )
{
- ///@note If a linear filter is requested, we do our best with a point filter for now.
- PointSample( bitmap.GetBuffer(), shrunkWidth, shrunkHeight, pixelFormat, bitmap.GetBuffer(), filteredWidth, filteredHeight );
-
- outputBitmap = MakeBitmap( bitmap.GetBuffer(), pixelFormat, filteredWidth, filteredHeight );
+ if( filterMode == ImageAttributes::Linear || filterMode == ImageAttributes::BoxThenLinear ||
+ filterMode == ImageAttributes::Nearest || filterMode == ImageAttributes::BoxThenNearest )
+ {
+ outputBitmap = MakeEmptyBitmap( pixelFormat, filteredWidth, filteredHeight );
+ if( outputBitmap )
+ {
+ if( filterMode == ImageAttributes::Linear || filterMode == ImageAttributes::BoxThenLinear )
+ {
+ LinearSample( bitmap.GetBuffer(), ImageDimensions(shrunkWidth, shrunkHeight), pixelFormat, outputBitmap->GetBuffer(), filteredDimensions );
+ }
+ else
+ {
+ PointSample( bitmap.GetBuffer(), shrunkWidth, shrunkHeight, pixelFormat, outputBitmap->GetBuffer(), filteredWidth, filteredHeight );
+ }
+ filtered = true;
+ }
+ }
}
// Copy out the 2^x downscaled, box-filtered pixels if no secondary filter (point or linear) was applied:
- else if( shrunkWidth < bitmapWidth || shrunkHeight < bitmapHeight )
+ if( filtered == false && ( shrunkWidth < bitmapWidth || shrunkHeight < bitmapHeight ) )
{
outputBitmap = MakeBitmap( bitmap.GetBuffer(), pixelFormat, shrunkWidth, shrunkHeight );
}
{
Internal::Platform::DownscaleInPlacePow2SingleBytePerPixel( pixels, inputWidth, inputHeight, desiredWidth, desiredHeight, dimensionTest, outWidth, outHeight );
}
+ else
+ {
+ DALI_ASSERT_DEBUG( false == "Inner branch conditions don't match outer branch." );
+ }
}
}
else
}
}
-void DownscaleInPlacePow2RGB888( unsigned char * const pixels,
- const unsigned int inputWidth,
- const unsigned int inputHeight,
- const unsigned int desiredWidth,
- const unsigned int desiredHeight,
+void DownscaleInPlacePow2RGB888( unsigned char *pixels,
+ unsigned int inputWidth,
+ unsigned int inputHeight,
+ unsigned int desiredWidth,
+ unsigned int desiredHeight,
BoxDimensionTest dimensionTest,
unsigned& outWidth,
unsigned& outHeight )
DownscaleInPlacePow2Generic<3, HalveScanlineInPlaceRGB888, AverageScanlines3>( pixels, inputWidth, inputHeight, desiredWidth, desiredHeight, dimensionTest, outWidth, outHeight );
}
-void DownscaleInPlacePow2RGBA8888( unsigned char * const pixels,
- const unsigned int inputWidth,
- const unsigned int inputHeight,
- const unsigned int desiredWidth,
- const unsigned int desiredHeight,
+void DownscaleInPlacePow2RGBA8888( unsigned char * pixels,
+ unsigned int inputWidth,
+ unsigned int inputHeight,
+ unsigned int desiredWidth,
+ unsigned int desiredHeight,
BoxDimensionTest dimensionTest,
unsigned& outWidth,
unsigned& outHeight )
*
* For 2-byte formats such as lum8alpha8, but not packed 16 bit formats like RGB565.
*/
-void DownscaleInPlacePow2ComponentPair( unsigned char * const pixels,
- const unsigned int inputWidth,
- const unsigned int inputHeight,
- const unsigned int desiredWidth,
- const unsigned int desiredHeight,
+void DownscaleInPlacePow2ComponentPair( unsigned char *pixels,
+ unsigned int inputWidth,
+ unsigned int inputHeight,
+ unsigned int desiredWidth,
+ unsigned int desiredHeight,
BoxDimensionTest dimensionTest,
unsigned& outWidth,
unsigned& outHeight )
namespace
{
-// Point sample an image to a new resolution (like GL_NEAREST).
+/**
+ * @brief Point sample an image to a new resolution (like GL_NEAREST).
+ *
+ * Template is used purely as a type-safe code generator in this one
+ * compilation unit. Generated code is inlined into type-specific wrapper
+ * functions below which are exported to rest of module.
+ */
template<typename PIXEL>
-void PointSampleAddressablePixels( const uint8_t * inPixels,
+inline void PointSampleAddressablePixels( const uint8_t * inPixels,
unsigned int inputWidth,
unsigned int inputHeight,
uint8_t * outPixels,
}
-/*
- * RGBA8888
- */
+// RGBA8888
void PointSample4BPP( const unsigned char * inPixels,
unsigned int inputWidth,
unsigned int inputHeight,
PointSampleAddressablePixels<uint32_t>( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
}
-/*
- * RGB565, LA88
- */
+// RGB565, LA88
void PointSample2BPP( const unsigned char * inPixels,
unsigned int inputWidth,
unsigned int inputHeight,
PointSampleAddressablePixels<uint16_t>( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
}
-/*
- * L8, A8
- */
+// L8, A8
void PointSample1BPP( const unsigned char * inPixels,
unsigned int inputWidth,
unsigned int inputHeight,
PointSampleAddressablePixels<uint8_t>( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
}
-/*
- * RGB888
+/* RGB888
* RGB888 is a special case as its pixels are not aligned addressable units.
*/
void PointSample3BPP( const uint8_t * inPixels,
unsigned int inY = 0; //< 16.16 fixed-point input image y-coord.
for( unsigned int outY = 0; outY < desiredHeight; ++outY )
{
- const uint8_t* const inScanline = &inPixels[inputWidth * (inY >> 16u) * BYTES_PER_PIXEL];
+ const unsigned int integerY = (inY + (1u << 15u)) >> 16u;
+ const uint8_t* const inScanline = &inPixels[inputWidth * integerY * BYTES_PER_PIXEL];
uint8_t* const outScanline = &outPixels[desiredWidth * outY * BYTES_PER_PIXEL];
unsigned int inX = 0; //< 16.16 fixed-point input image x-coord.
for( unsigned int outX = 0; outX < desiredWidth * BYTES_PER_PIXEL; outX += BYTES_PER_PIXEL )
{
- // Truncate the fixed-point input coordinate to the address of the input pixel to sample:
- const uint8_t* const inPixelAddress = &inScanline[(inX >> 16u) * BYTES_PER_PIXEL];
+ // Round the fixed-point input coordinate to the address of the input pixel to sample:
+ const unsigned int integerX = (inX + (1u << 15u)) >> 16u;
+ const uint8_t* const inPixelAddress = &inScanline[integerX * BYTES_PER_PIXEL];
// Issue loads for all pixel color components up-front:
const unsigned int c0 = inPixelAddress[0];
const unsigned int c1 = inPixelAddress[1];
const unsigned int c2 = inPixelAddress[2];
- ///@ToDo: Benchmark one 32bit load that will be unaligned 2/3 of the time + 3 rotate and masks, versus these three aligned byte loads.
+ ///@ToDo: Optimise - Benchmark one 32bit load that will be unaligned 2/3 of the time + 3 rotate and masks, versus these three aligned byte loads, versus using an RGB packed, aligned(1) struct and letting compiler pick a strategy.
// Output the pixel components:
outScanline[outX] = c0;
// Check the pixel format is one that is supported:
if( pixelFormat == Pixel::RGBA8888 || pixelFormat == Pixel::RGB888 || pixelFormat == Pixel::RGB565 || pixelFormat == Pixel::LA88 || pixelFormat == Pixel::L8 || pixelFormat == Pixel::A8 )
{
- if( pixelFormat == Pixel::RGBA8888 )
+ if( pixelFormat == Pixel::RGB888 )
{
- PointSample4BPP( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
+ PointSample3BPP( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
}
- else if( pixelFormat == Pixel::RGB888 )
+ else if( pixelFormat == Pixel::RGBA8888 )
{
- PointSample3BPP( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
+ PointSample4BPP( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
}
else if( pixelFormat == Pixel::RGB565 || pixelFormat == Pixel::LA88 )
{
{
PointSample1BPP( inPixels, inputWidth, inputHeight, outPixels, desiredWidth, desiredHeight );
}
+ else
+ {
+ DALI_ASSERT_DEBUG( false == "Inner branch conditions don't match outer branch." );
+ }
}
else
{
}
}
+// Linear sampling group below
+
+namespace
+{
+
+/** @brief Blend 4 pixels together using horizontal and vertical weights. */
+inline uint8_t BilinearFilter1BPPByte( uint8_t tl, uint8_t tr, uint8_t bl, uint8_t br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical )
+{
+ return BilinearFilter1Component( tl, tr, bl, br, fractBlendHorizontal, fractBlendVertical );
+}
+
+/** @copydoc BilinearFilter1BPPByte */
+inline Pixel2Bytes BilinearFilter2Bytes( Pixel2Bytes tl, Pixel2Bytes tr, Pixel2Bytes bl, Pixel2Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical )
+{
+ Pixel2Bytes pixel;
+ pixel.l = BilinearFilter1Component( tl.l, tr.l, bl.l, br.l, fractBlendHorizontal, fractBlendVertical );
+ pixel.a = BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical );
+ return pixel;
+}
+
+/** @copydoc BilinearFilter1BPPByte */
+inline Pixel3Bytes BilinearFilterRGB888( Pixel3Bytes tl, Pixel3Bytes tr, Pixel3Bytes bl, Pixel3Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical )
+{
+ Pixel3Bytes pixel;
+ pixel.r = BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical );
+ pixel.g = BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical );
+ pixel.b = BilinearFilter1Component( tl.b, tr.b, bl.b, br.b, fractBlendHorizontal, fractBlendVertical );
+ return pixel;
+}
+
+/** @copydoc BilinearFilter1BPPByte */
+inline PixelRGB565 BilinearFilterRGB565( PixelRGB565 tl, PixelRGB565 tr, PixelRGB565 bl, PixelRGB565 br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical )
+{
+ const PixelRGB565 pixel = (BilinearFilter1Component( tl >> 11u, tr >> 11u, bl >> 11u, br >> 11u, fractBlendHorizontal, fractBlendVertical ) << 11u) +
+ (BilinearFilter1Component( (tl >> 5u) & 63u, (tr >> 5u) & 63u, (bl >> 5u) & 63u, (br >> 5u) & 63u, fractBlendHorizontal, fractBlendVertical ) << 5u) +
+ BilinearFilter1Component( tl & 31u, tr & 31u, bl & 31u, br & 31u, fractBlendHorizontal, fractBlendVertical );
+ return pixel;
+}
+
+/** @copydoc BilinearFilter1BPPByte */
+inline Pixel4Bytes BilinearFilter4Bytes( Pixel4Bytes tl, Pixel4Bytes tr, Pixel4Bytes bl, Pixel4Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical )
+{
+ Pixel4Bytes pixel;
+ pixel.r = BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical );
+ pixel.g = BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical );
+ pixel.b = BilinearFilter1Component( tl.b, tr.b, bl.b, br.b, fractBlendHorizontal, fractBlendVertical );
+ pixel.a = BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical );
+ return pixel;
+}
+
+/**
+ * @brief Generic version of bilinear sampling image resize function.
+ * @note Limited to one compilation unit and exposed through type-specific
+ * wrapper functions below.
+ */
+template<
+ typename PIXEL,
+ PIXEL (*BilinearFilter) ( PIXEL tl, PIXEL tr, PIXEL bl, PIXEL br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical ),
+ bool DEBUG_ASSERT_ALIGNMENT
+>
+inline void LinearSampleGeneric( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions )
+{
+ const unsigned int inputWidth = inputDimensions.GetWidth();
+ const unsigned int inputHeight = inputDimensions.GetHeight();
+ const unsigned int desiredWidth = desiredDimensions.GetWidth();
+ const unsigned int desiredHeight = desiredDimensions.GetHeight();
+
+ DALI_ASSERT_DEBUG( ((outPixels >= inPixels + inputWidth * inputHeight * sizeof(PIXEL)) ||
+ (inPixels >= outPixels + desiredWidth * desiredHeight * sizeof(PIXEL))) &&
+ "Input and output buffers cannot overlap.");
+ if( DEBUG_ASSERT_ALIGNMENT )
+ {
+ DALI_ASSERT_DEBUG( ((uint64_t) inPixels) % sizeof(PIXEL) == 0 && "Pixel pointers need to be aligned to the size of the pixels (E.g., 4 bytes for RGBA, 2 bytes for RGB565, ...)." );
+ DALI_ASSERT_DEBUG( ((uint64_t) outPixels) % sizeof(PIXEL) == 0 && "Pixel pointers need to be aligned to the size of the pixels (E.g., 4 bytes for RGBA, 2 bytes for RGB565, ...)." );
+ }
+
+ if( inputWidth < 1u || inputHeight < 1u || desiredWidth < 1u || desiredHeight < 1u )
+ {
+ return;
+ }
+ const PIXEL* const inAligned = reinterpret_cast<const PIXEL*>(inPixels);
+ PIXEL* const outAligned = reinterpret_cast<PIXEL*>(outPixels);
+ const unsigned int deltaX = (inputWidth << 16u) / desiredWidth;
+ const unsigned int deltaY = (inputHeight << 16u) / desiredHeight;
+
+ unsigned int inY = 0;
+ for( unsigned int outY = 0; outY < desiredHeight; ++outY )
+ {
+ PIXEL* const outScanline = &outAligned[desiredWidth * outY];
+
+ // Find the two scanlines to blend and the weight to blend with:
+ const unsigned int integerY1 = inY >> 16u;
+ const unsigned int integerY2 = integerY1 >= inputHeight ? integerY1 : integerY1 + 1;
+ const unsigned int inputYWeight = inY & 65535u;
+
+ DALI_ASSERT_DEBUG( integerY1 < inputHeight );
+ DALI_ASSERT_DEBUG( integerY2 < inputHeight );
+
+ const PIXEL* const inScanline1 = &inAligned[inputWidth * integerY1];
+ const PIXEL* const inScanline2 = &inAligned[inputWidth * integerY2];
+
+ unsigned int inX = 0;
+ for( unsigned int outX = 0; outX < desiredWidth; ++outX )
+ {
+ // Work out the two pixel scanline offsets for this cluster of four samples:
+ const unsigned int integerX1 = inX >> 16u;
+ const unsigned int integerX2 = integerX1 >= inputWidth ? integerX1 : integerX1 + 1;
+
+ // Execute the loads:
+ const PIXEL pixel1 = inScanline1[integerX1];
+ const PIXEL pixel2 = inScanline2[integerX1];
+ const PIXEL pixel3 = inScanline1[integerX2];
+ const PIXEL pixel4 = inScanline2[integerX2];
+ ///@ToDo Optimise - for 1 and 2 and 4 byte types to execute a single 2, 4, or 8 byte load per pair (caveat clamping) and let half of them be unaligned.
+
+ // Weighted bilinear filter:
+ const unsigned int inputXWeight = inX & 65535u;
+ outScanline[outX] = BilinearFilter( pixel1, pixel3, pixel2, pixel4, inputXWeight, inputYWeight );
+
+ inX += deltaX;
+ }
+ inY += deltaY;
+ }
+}
+
+}
+
+// Format-specific linear scaling instantiations:
+
+void LinearSample1BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions )
+{
+ LinearSampleGeneric<uint8_t, BilinearFilter1BPPByte, false>( inPixels, inputDimensions, outPixels, desiredDimensions );
+}
+
+void LinearSample2BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions )
+{
+ LinearSampleGeneric<Pixel2Bytes, BilinearFilter2Bytes, true>( inPixels, inputDimensions, outPixels, desiredDimensions );
+}
+
+void LinearSampleRGB565( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions )
+{
+ LinearSampleGeneric<PixelRGB565, BilinearFilterRGB565, true>( inPixels, inputDimensions, outPixels, desiredDimensions );
+}
+
+void LinearSample3BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions )
+{
+ LinearSampleGeneric<Pixel3Bytes, BilinearFilterRGB888, false>( inPixels, inputDimensions, outPixels, desiredDimensions );
+}
+
+void LinearSample4BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions )
+{
+ LinearSampleGeneric<Pixel4Bytes, BilinearFilter4Bytes, true>( inPixels, inputDimensions, outPixels, desiredDimensions );
+}
+
+// Dispatch to a format-appropriate linear sampling function:
+void LinearSample( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inDimensions,
+ Pixel::Format pixelFormat,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions outDimensions )
+{
+ // Check the pixel format is one that is supported:
+ if( pixelFormat == Pixel::RGB888 || pixelFormat == Pixel::RGBA8888 || pixelFormat == Pixel::L8 || pixelFormat == Pixel::A8 || pixelFormat == Pixel::LA88 || pixelFormat == Pixel::RGB565 )
+ {
+ if( pixelFormat == Pixel::RGB888 )
+ {
+ LinearSample3BPP( inPixels, inDimensions, outPixels, outDimensions );
+ }
+ else if( pixelFormat == Pixel::RGBA8888 )
+ {
+ LinearSample4BPP( inPixels, inDimensions, outPixels, outDimensions );
+ }
+ else if( pixelFormat == Pixel::L8 || pixelFormat == Pixel::A8 )
+ {
+ LinearSample1BPP( inPixels, inDimensions, outPixels, outDimensions );
+ }
+ else if( pixelFormat == Pixel::LA88 )
+ {
+ LinearSample2BPP( inPixels, inDimensions, outPixels, outDimensions );
+ }
+ else if ( pixelFormat == Pixel::RGB565 )
+ {
+ LinearSampleRGB565( inPixels, inDimensions, outPixels, outDimensions );
+ }
+ else
+ {
+ DALI_ASSERT_DEBUG( false == "Inner branch conditions don't match outer branch." );
+ }
+ }
+ else
+ {
+ DALI_LOG_INFO( gImageOpsLogFilter, Dali::Integration::Log::Verbose, "Bitmap was not linear sampled: unsupported pixel format: %u.\n", unsigned(pixelFormat) );
+ }
+}
+
} /* namespace Platform */
} /* namespace Internal */
} /* namespace Dali */
#ifndef DALI_INTERNAL_PLATFORM_IMAGE_OPERATIONS_H_
#define DALI_INTERNAL_PLATFORM_IMAGE_OPERATIONS_H_
+// EXTERNAL INCLUDES
+#include <stdint.h>
+
// INTERNAL INCLUDES
#include <dali/integration-api/bitmap.h>
#include <dali/public-api/images/image-attributes.h>
-// EXTERNAL INCLUDES
-#include <stdint.h>
-
namespace Dali
{
namespace Internal
};
/**
- * @brief Human readable text output.
- */
-std::ostream& operator<<( std::ostream& o, const Vector2Uint16& vector );
-
-/**
* @brief The integer dimensions of an image or a region of an image packed into
* 16 bits per component.
* @note This can only be used for images of up to 65535 x 65535 pixels.
unsigned int desiredWidth,
unsigned int desiredHeight );
+/**
+ * @brief Resample input image to output image using a bilinear filter.
+ *
+ * Each output pixel is formed of a weighted sum of a 2x2 block of four input
+ * pixels
+ * @pre inPixels must not alias outPixels. The input image should be a totally
+ * separate buffer from the input one.
+ */
+void LinearSample( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inDimensions,
+ Pixel::Format pixelFormat,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions outDimensions );
+
+/**
+ * @copydoc LinearSample
+ *
+ * Specialised for one byte per pixel formats.
+ */
+void LinearSample1BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions );
+
+/**
+ * @copydoc LinearSample
+ *
+ * Specialised for two byte per pixel formats.
+ */
+void LinearSample2BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions );
+
+/**
+ * @copydoc LinearSample
+ *
+ * Specialised for RGB565 16 bit pixel format.
+ */
+void LinearSampleRGB565( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions );
+
+/**
+ * @copydoc LinearSample
+ *
+ * Specialised for three byte per pixel formats like RGB888.
+ */
+void LinearSample3BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions );
+
+/**
+ * @copydoc LinearSample
+ *
+ * Specialised for four byte per pixel formats like RGBA888.
+ * @note, If used on RGBA8888, the A component will be blended independently.
+ */
+void LinearSample4BPP( const unsigned char * __restrict__ inPixels,
+ ImageDimensions inputDimensions,
+ unsigned char * __restrict__ outPixels,
+ ImageDimensions desiredDimensions );
+
/**@}*/
/**
return avg;
}
+/** @return The weighted blend of two integers as a 16.16 fixed-point number, given a 0.16 fixed-point blending factor. */
+inline unsigned int WeightedBlendIntToFixed1616(unsigned int a, unsigned int b, unsigned int fractBlend )
+{
+ DALI_ASSERT_DEBUG( fractBlend <= 65535u && "Factor should be in 0.16 fixed-point." );
+ const unsigned int weightedAFixed = a * (65535u - fractBlend);
+ const unsigned int weightedBFixed = b * fractBlend;
+ const unsigned blended = (weightedAFixed + weightedBFixed);
+ return blended;
+}
+
+/** @brief Blend two 16.16 inputs to give a 16.32 output. */
+inline uint64_t WeightedBlendFixed1616ToFixed1632(unsigned int a, unsigned int b, unsigned int fractBlend )
+{
+ DALI_ASSERT_DEBUG( fractBlend <= 65535u && "Factor should be in 0.16 fixed-point." );
+ // Blend while promoting intermediates to 16.32 fixed point:
+ const uint64_t weightedAFixed = uint64_t(a) * (65535u - fractBlend);
+ const uint64_t weightedBFixed = uint64_t(b) * fractBlend;
+ const uint64_t blended = (weightedAFixed + weightedBFixed);
+ return blended;
+}
+
+/**
+ * @brief Blend 4 taps into one value using horizontal and vertical weights.
+ */
+inline unsigned int BilinearFilter1Component(unsigned int tl, unsigned int tr, unsigned int bl, unsigned int br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical )
+{
+ DALI_ASSERT_DEBUG( fractBlendHorizontal <= 65535u && "Factor should be in 0.16 fixed-point." );
+ DALI_ASSERT_DEBUG( fractBlendVertical <= 65535u && "Factor should be in 0.16 fixed-point." );
+ //
+ const unsigned int topBlend = WeightedBlendIntToFixed1616( tl, tr, fractBlendHorizontal );
+ const unsigned int botBlend = WeightedBlendIntToFixed1616( bl, br, fractBlendHorizontal );
+ const uint64_t blended2x2 = WeightedBlendFixed1616ToFixed1632( topBlend, botBlend, fractBlendVertical );
+ const unsigned int rounded = (blended2x2 + (1u << 31u) ) >> 32u;
+ return rounded;
+}
+
/**@}*/
} /* namespace Platform */
+++ /dev/null
-# Add local source files here:
-
-slp_platform_abstraction_src_files = \
- $(slp_platform_abstraction_src_dir)/slp-platform-abstraction.cpp \
- $(slp_platform_abstraction_src_dir)/slp-logging.cpp \
- $(slp_platform_abstraction_src_dir)/slp-font-configuration-parser.cpp \
- $(slp_platform_abstraction_src_dir)/font-platform/font-controller-impl.cpp \
- $(slp_platform_abstraction_src_dir)/data-cache/data-cache-io.cpp \
- $(slp_platform_abstraction_src_dir)/data-cache/data-cache-impl.cpp \
- $(slp_platform_abstraction_src_dir)/data-cache/tests/data-cache-debug.cpp \
- $(slp_platform_abstraction_src_dir)/data-cache/data-compression.cpp \
- $(slp_platform_abstraction_src_dir)/data-cache/metrics-cache.cpp \
- $(slp_platform_abstraction_src_dir)/dynamics/dynamics-factory.cpp \
- \
- $(slp_platform_abstraction_src_dir)/resource-loader/loader-font.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-loader.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-requester-base.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-bitmap-requester.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-shader-requester.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-text-requester.cpp \
- \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-thread-base.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-thread-image.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-thread-shader.cpp \
- $(slp_platform_abstraction_src_dir)/resource-loader/resource-thread-text.cpp \
- \
- \
- $(slp_platform_abstraction_src_dir)/resource-loader/debug/resource-loader-debug.cpp \
- \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-bmp.cpp \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-gif.cpp \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-png.cpp \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-ico.cpp \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-ktx.cpp \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-wbmp.cpp \
- $(slp_platform_abstraction_src_dir)/image-loaders/image-loader.cpp \
- $(portable_platform_abstraction_src_dir)/image-operations.cpp
-
-slp_turbo_jpeg_loader = \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-jpeg-turbo.cpp
-
-slp_jpeg_loader = \
- $(slp_platform_abstraction_src_dir)/image-loaders/loader-jpeg.cpp
-
-# Add public headers here:
-
-# platform_abstraction_header_files =
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
}
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
unsigned int maxDataSize,
unsigned int maxNumberEntries)
{
- return new Dali::SlpPlatform::DataCache( mode, compressionMode, fileName, maxDataSize, maxNumberEntries );
+ return new Dali::TizenPlatform::DataCache( mode, compressionMode, fileName, maxDataSize, maxNumberEntries );
}
-#ifndef __DALI_SLP_PLATFORM_DATA_CACHE_H__
-#define __DALI_SLP_PLATFORM_DATA_CACHE_H__
+#ifndef __DALI_TIZEN_PLATFORM_DATA_CACHE_H__
+#define __DALI_TIZEN_PLATFORM_DATA_CACHE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
};
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_DATA_CACHE_H__
+#endif // __DALI_TIZEN_PLATFORM_DATA_CACHE_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace DataCacheIo
}
} // namespace DataCacheIO
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_DATA_CACHE_IO_H__
-#define __DALI_SLP_PLATFORM_DATA_CACHE_IO_H__
+#ifndef __DALI_TIZEN_PLATFORM_DATA_CACHE_IO_H__
+#define __DALI_TIZEN_PLATFORM_DATA_CACHE_IO_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
} // namespace DataCacheIO
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_DATA_CACHE_IO_H__
+#endif // __DALI_TIZEN_PLATFORM_DATA_CACHE_IO_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace DataCompression
{
} // DataCompression
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_DATA_COMPRESSION_H__
-#define __DALI_SLP_PLATFORM_DATA_COMPRESSION_H__
+#ifndef __DALI_TIZEN_PLATFORM_DATA_COMPRESSION_H__
+#define __DALI_TIZEN_PLATFORM_DATA_COMPRESSION_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace DataCompression
{
} // namespace DataCompression
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_DATA_COMPRESSION_H__
+#endif // __DALI_TIZEN_PLATFORM_DATA_COMPRESSION_H__
} // Anonymous namespace
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace MetricsCache
{
} // MetricsCache
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#ifndef DALI_SLP_PLATFORM_METRICS_CACHE_H
-#define DALI_SLP_PLATFORM_METRICS_CACHE_H
+#ifndef DALI_TIZEN_PLATFORM_METRICS_CACHE_H
+#define DALI_TIZEN_PLATFORM_METRICS_CACHE_H
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace MetricsCache
{
void Write( const std::string& fontFamily, const std::string& fontStyle, const Integration::GlyphSet& glyphSet );
} // MetricsCache
-} // SlpPlatform
+} // TizenPlatform
} // Dali
#endif //DALI_INTEGRATION_METRICS_CACHE_H
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace DataCacheIo
} // namespace DataCacheIO
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
#endif // #ifdef DATA_CACHE_DEBUG
-#ifndef __DALI_SLP_PLATFORM_DATA_CACHE_DEBUG_H__
-#define __DALI_SLP_PLATFORM_DATA_CACHE_DEBUG_H__
+#ifndef __DALI_TIZEN_PLATFORM_DATA_CACHE_DEBUG_H__
+#define __DALI_TIZEN_PLATFORM_DATA_CACHE_DEBUG_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace DataCacheIo
{
} // namespace DataCacheIO
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_DATA_CACHE_DEBUG_H__
+#endif // __DALI_TIZEN_PLATFORM_DATA_CACHE_DEBUG_H__
#endif // #ifdef DATA_CACHE_DEBUG
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
return dynamicsShape;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
}; // class DynamicsFactory
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
--- /dev/null
+# Add local source files here:
+
+tizen_platform_abstraction_src_files = \
+ $(tizen_platform_abstraction_src_dir)/tizen-platform-abstraction.cpp \
+ $(tizen_platform_abstraction_src_dir)/tizen-logging.cpp \
+ $(tizen_platform_abstraction_src_dir)/tizen-font-configuration-parser.cpp \
+ $(tizen_platform_abstraction_src_dir)/font-platform/font-controller-impl.cpp \
+ $(tizen_platform_abstraction_src_dir)/data-cache/data-cache-io.cpp \
+ $(tizen_platform_abstraction_src_dir)/data-cache/data-cache-impl.cpp \
+ $(tizen_platform_abstraction_src_dir)/data-cache/tests/data-cache-debug.cpp \
+ $(tizen_platform_abstraction_src_dir)/data-cache/data-compression.cpp \
+ $(tizen_platform_abstraction_src_dir)/data-cache/metrics-cache.cpp \
+ $(tizen_platform_abstraction_src_dir)/dynamics/dynamics-factory.cpp \
+ \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/loader-font.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-loader.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-requester-base.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-bitmap-requester.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-shader-requester.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-text-requester.cpp \
+ \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-thread-base.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-thread-image.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-thread-shader.cpp \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-thread-text.cpp \
+ \
+ \
+ $(tizen_platform_abstraction_src_dir)/resource-loader/debug/resource-loader-debug.cpp \
+ \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-bmp.cpp \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-gif.cpp \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-png.cpp \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-ico.cpp \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-ktx.cpp \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-wbmp.cpp \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/image-loader.cpp \
+ $(portable_platform_abstraction_src_dir)/image-operations.cpp
+
+tizen_turbo_jpeg_loader = \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-jpeg-turbo.cpp
+
+tizen_jpeg_loader = \
+ $(tizen_platform_abstraction_src_dir)/image-loaders/loader-jpeg.cpp
+
+# Add public headers here:
+
+# platform_abstraction_header_files =
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
#if defined(DEBUG_ENABLED)
mPreferredFonts.Clear();
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
// Implementation of Dali::Platform::FontController::New()
Dali::Platform::FontController* Dali::Platform::FontController::New()
{
- return new Dali::SlpPlatform::FontController();
+ return new Dali::TizenPlatform::FontController();
}
-#ifndef __DALI_SLP_PLATFORM_FONT_CONTROLLER_H__
-#define __DALI_SLP_PLATFORM_FONT_CONTROLLER_H__
+#ifndef __DALI_TIZEN_PLATFORM_FONT_CONTROLLER_H__
+#define __DALI_TIZEN_PLATFORM_FONT_CONTROLLER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
typedef Dali::Platform::FontController::FontList FontList;
/**
- * concrete interface for the SLP font controller.
+ * concrete interface for the TIZEN font controller.
*
* Font controller currently caches the following:
* - List of fonts on the system, if the user calls GetFontList()
};
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_FONT_CONTROLLER_H__
+#endif // __DALI_TIZEN_PLATFORM_FONT_CONTROLLER_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
}
} // ImageLoader
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#ifndef __DALI_SLP_PLATFORM_IMAGE_LOADER_H__
-#define __DALI_SLP_PLATFORM_IMAGE_LOADER_H__
+#ifndef __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
+#define __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace ImageLoader
{
Vector2 &closestSize );
} // ImageLoader
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#endif // __DALI_SLP_PLATFORM_IMAGE_LOADER_H__
+#endif // __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
{
using Integration::Bitmap;
using Dali::Integration::PixelBuffer;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
return true;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_LOADER_BMP_H__
-#define __DALI_SLP_PLATFORM_LOADER_BMP_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_BMP_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_BMP_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
struct ImageAttributes;
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceLoadingClient;
*/
bool LoadBmpHeader(FILE *fp, const ImageAttributes& attributes, unsigned int &width, unsigned int &height);
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_LOADER_BMP_H__
+#endif // __DALI_TIZEN_PLATFORM_LOADER_BMP_H__
using Integration::Bitmap;
using Dali::Integration::PixelBuffer;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
return true;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_LOADER_GIF_H__
-#define __DALI_SLP_PLATFORM_LOADER_GIF_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_GIF_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_GIF_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
struct ImageAttributes;
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceLoadingClient;
*/
bool LoadGifHeader(FILE *fp, const ImageAttributes& attributes, unsigned int &width, unsigned int &height );
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_LOADER_GIF_H__
+#endif // __DALI_TIZEN_PLATFORM_LOADER_GIF_H__
using Integration::Bitmap;
using Dali::Integration::PixelBuffer;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
-#ifndef __DALI_SLP_PLATFORM_LOADER_ICO_H__
-#define __DALI_SLP_PLATFORM_LOADER_ICO_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_ICO_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_ICO_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
}
struct ImageAttributes;
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceLoadingClient;
{
using Integration::Bitmap;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
{
using Integration::Bitmap;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
return true;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_LOADER_JPEG_H__
-#define __DALI_SLP_PLATFORM_LOADER_JPEG_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_JPEG_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_JPEG_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
struct ImageAttributes;
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceLoadingClient;
*/
bool EncodeToJpeg(const unsigned char* pixelBuffer, std::vector< unsigned char >& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat, unsigned quality = 80);
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_LOADER_JPEG_H__
+#endif // __DALI_TIZEN_PLATFORM_LOADER_JPEG_H__
using Integration::Bitmap;
using Dali::Integration::PixelBuffer;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
return true;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_LOADER_KTX_H__
-#define __DALI_SLP_PLATFORM_LOADER_KTX_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_KTX_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_KTX_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
struct ImageAttributes;
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceLoadingClient;
*/
bool LoadKtxHeader(FILE * const fp, const ImageAttributes& attributes, unsigned int &width, unsigned int &height);
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_LOADER_KTX_H__
+#endif // __DALI_TIZEN_PLATFORM_LOADER_KTX_H__
using Integration::Bitmap;
using Dali::Integration::PixelBuffer;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
* */
extern "C" void WriteData(png_structp png_ptr, png_bytep data, png_size_t length)
{
- using Dali::SlpPlatform::PngBuffer;
+ using Dali::TizenPlatform::PngBuffer;
DALI_ASSERT_DEBUG(png_ptr && data);
if(!png_ptr || !data)
{
return true;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_LOADER_PNG_H__
-#define __DALI_SLP_PLATFORM_LOADER_PNG_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_PNG_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_PNG_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
}
struct ImageAttributes;
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceLoadingClient;
*/
bool EncodeToPng( const unsigned char* pixelBuffer, PngBuffer& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat );
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_LOADER_PNG_H__
+#endif // __DALI_TIZEN_PLATFORM_LOADER_PNG_H__
{
using Integration::Bitmap;
using Dali::Integration::PixelBuffer;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
-#ifndef __DALI_SLP_PLATFORM_LOADER_WBMP_H__
-#define __DALI_SLP_PLATFORM_LOADER_WBMP_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_WBMP_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_WBMP_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
}
struct ImageAttributes;
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceLoadingClient;
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
using namespace Dali::Integration;
return textString;
}
-} //SlpPlatform
+} //TizenPlatform
} //Dali
#endif
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_LOADER_DEBUG_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_LOADER_DEBUG_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_DEBUG_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_DEBUG_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
#include <dali/integration-api/debug.h>
#if defined(DEBUG_ENABLED)
-#include <platform-abstractions/slp/resource-loader/resource-loader.h>
+#include <platform-abstractions/tizen/resource-loader/resource-loader.h>
#include <dali/integration-api/resource-cache.h>
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
extern Debug::Filter* gLoaderFilter;
std::string DebugRequestList(Integration::TextResourceType::CharacterList& chars);
std::string DebugResourceList(LoadedResource& partialResource);
-} // SlpPlatform
+} // TizenPlatform
} // Dali
#endif // defined(DEBUG_ENABLED)
-#endif //__DALI_SLP_PLATFORM_RESOURCE_LOADER_DEBUG_H__
+#endif //__DALI_TIZEN_PLATFORM_RESOURCE_LOADER_DEBUG_H__
-#ifndef __DALI_SLP_PLATFORM_IMAGE_ENCODER_H__
-#define __DALI_SLP_PLATFORM_IMAGE_ENCODER_H__
+#ifndef __DALI_TIZEN_PLATFORM_IMAGE_ENCODER_H__
+#define __DALI_TIZEN_PLATFORM_IMAGE_ENCODER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
} // namespace Dali
-#endif //__DALI_SLP_PLATFORM_IMAGE_ENCODER_H__
+#endif //__DALI_TIZEN_PLATFORM_IMAGE_ENCODER_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
using namespace Dali::Integration;
} // unnamed namespace
#endif
-static SlpFace* LoadFontFile(const std::string &fileName, FT_Library freeType)
+static TizenFace* LoadFontFile(const std::string &fileName, FT_Library freeType)
{
- SlpFace* slpFace = NULL;
+ TizenFace* tizenFace = NULL;
// Open freetype font file
FILE* fontFile = fopen(fileName.c_str(), "rb");
}
// allocate a buffer for the file (throws a memory exception on failure)
- slpFace = new SlpFace;
- slpFace->buffer = new FT_Byte[fileSize];
+ tizenFace = new TizenFace;
+ tizenFace->buffer = new FT_Byte[fileSize];
// read the file
- unsigned int bytes = fread(slpFace->buffer, 1, fileSize, fontFile);
+ unsigned int bytes = fread(tizenFace->buffer, 1, fileSize, fontFile);
if (bytes != fileSize)
{
DALI_LOG_WARNING("Number of bytes read (%d) does not match the file's size (%d)\n", bytes, fileSize);
}
// create a freetype face from the memory buffer
- FT_Error retVal = FT_New_Memory_Face(freeType, slpFace->buffer, fileSize, 0, &slpFace->face);
+ FT_Error retVal = FT_New_Memory_Face(freeType, tizenFace->buffer, fileSize, 0, &tizenFace->face);
if (retVal != FT_Err_Ok)
{
DALI_LOG_WARNING("FT_New_Face failed on %s\n", fileName.c_str());
- delete slpFace;
- slpFace = NULL;
+ delete tizenFace;
+ tizenFace = NULL;
}
}
fclose(fontFile);
}
- return slpFace;
+ return tizenFace;
}
-SlpFace* LoadFontFace(const std::string &fileName,
+TizenFace* LoadFontFace(const std::string &fileName,
const PointSize pointSize,
const unsigned int dpiHor, const unsigned int dpiVer,
FT_Library freeType)
{
- SlpFace* slpFace = LoadFontFile(fileName, freeType);
+ TizenFace* tizenFace = LoadFontFile(fileName, freeType);
- if (NULL != slpFace)
+ if (NULL != tizenFace)
{
- FT_Face face = slpFace->face;
+ FT_Face face = tizenFace->face;
// set the char size for glyph scaling
FT_Error retVal = FT_Set_Char_Size(face, 0, static_cast<unsigned int>(roundf(pointSize.value))<<6, dpiHor, dpiVer);
if (retVal != FT_Err_Ok)
{
DALI_LOG_WARNING("FT_Set_Char_Size failed on %s\n", fileName.c_str());
- delete slpFace;
- slpFace = NULL;
+ delete tizenFace;
+ tizenFace = NULL;
}
else
{
}
}
- return slpFace;
+ return tizenFace;
}
-SlpFace* LoadFontFace(const std::string &fileName,
+TizenFace* LoadFontFace(const std::string &fileName,
const PixelSize pixelSize,
FT_Library freeType)
{
- SlpFace* slpFace = LoadFontFile(fileName, freeType);
+ TizenFace* tizenFace = LoadFontFile(fileName, freeType);
- if (NULL != slpFace)
+ if (NULL != tizenFace)
{
- FT_Face face = slpFace->face;
+ FT_Face face = tizenFace->face;
// set the pixel size for glyph scaling
FT_Error retVal = FT_Set_Pixel_Sizes(face, pixelSize, pixelSize);
if (retVal != FT_Err_Ok)
{
DALI_LOG_WARNING("FT_Set_Pixel_Sizes failed on %s\n", fileName.c_str());
- delete slpFace;
- slpFace = NULL;
+ delete tizenFace;
+ tizenFace = NULL;
}
else
{
}
}
- return slpFace;
+ return tizenFace;
}
// charcode must be UTF-32 representation
return image;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_LOADER_FONT_H__
-#define __DALI_SLP_PLATFORM_LOADER_FONT_H__
+#ifndef __DALI_TIZEN_PLATFORM_LOADER_FONT_H__
+#define __DALI_TIZEN_PLATFORM_LOADER_FONT_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
class GlyphSet;
}
-namespace SlpPlatform
+namespace TizenPlatform
{
-struct SlpFace
+struct TizenFace
{
- SlpFace()
+ TizenFace()
{
face = NULL;
buffer = NULL;
}
- ~SlpFace()
+ ~TizenFace()
{
if (face)
{
* @param [in] dpiHor Horizontal dpi
* @param [in] dpiVer Vertical dpi
* @param [inout] freeType A handle to the FreeType library resource
- * @return A SlpFace pointer on success, NULL on failure
+ * @return A TizenFace pointer on success, NULL on failure
*/
-SlpFace* LoadFontFace(const std::string &fileName,
+TizenFace* LoadFontFace(const std::string &fileName,
const PointSize pointSize,
const unsigned int dpiHor, const unsigned int dpiVer,
FT_Library freeType);
* @param [in] fileName Font file name
* @param [in] pixelSize Pixel size for freetype source glyph scaling
* @param [inout] freeType A handle to the FreeType library resource
- * @return A SlpFace pointer on success, NULL on failure
+ * @return A TizenFace pointer on success, NULL on failure
*/
-SlpFace* LoadFontFace(const std::string &fileName,
+TizenFace* LoadFontFace(const std::string &fileName,
const PixelSize pixelSize,
FT_Library freeType);
*/
Integration::BitmapPtr GetGlyphBitmap( FT_Face face, FT_ULong charCode );
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_LOADER_FONT_H__
+#endif // __DALI_TIZEN_PLATFORM_LOADER_FONT_H__
-#ifndef __DALI_SLP_PLATFORM_CAPABILITIES_H__
-#define __DALI_SLP_PLATFORM_CAPABILITIES_H__
+#ifndef __DALI_TIZEN_PLATFORM_CAPABILITIES_H__
+#define __DALI_TIZEN_PLATFORM_CAPABILITIES_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
#endif
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_CAPABILITIES_H__
+#endif // __DALI_TIZEN_PLATFORM_CAPABILITIES_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
ResourceBitmapRequester::ResourceBitmapRequester( ResourceLoader& resourceLoader )
mThreadImageRemote->CancelRequest(id);
}
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
ResourceThreadImage* mThreadImageRemote; ///< Image loader thread object to download images in remote http server
};
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#endif // __DALI_SLP_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
if (!fontFamily.empty())
{
const std::string& fontFileName = GetFontPath( fontFamily, fontStyle );
- SlpFace* slpFace = LoadFontFace(fontFileName, PixelSize(capsHeight), freeType);
+ TizenFace* tizenFace = LoadFontFace(fontFileName, PixelSize(capsHeight), freeType);
- if (slpFace)
+ if (tizenFace)
{
- const float scale = static_cast<float>(capsHeight.value) / ((slpFace->face->ascender / 64.0f) * 0.95f);
+ const float scale = static_cast<float>(capsHeight.value) / ((tizenFace->face->ascender / 64.0f) * 0.95f);
- result.value = static_cast<unsigned int>(roundf(scale * (slpFace->face->height / 64.0f)));
+ result.value = static_cast<unsigned int>(roundf(scale * (tizenFace->face->height / 64.0f)));
- delete slpFace;
- slpFace = NULL;
+ delete tizenFace;
+ tizenFace = NULL;
}
}
const bool highQuality(textRequest.mQuality == TextResourceType::TextQualityHigh);
const unsigned int glyphQuality( highQuality ? GlyphMetrics::HIGH_QUALITY : GlyphMetrics::LOW_QUALITY );
- SlpFace* slpFace = LoadFontFace( fontFileName, PixelSize( HIGH_QUALITY_PIXEL_SIZE), freeType );
- if (slpFace)
+ TizenFace* tizenFace = LoadFontFace( fontFileName, PixelSize( HIGH_QUALITY_PIXEL_SIZE), freeType );
+ if (tizenFace)
{
glyphSet = new GlyphSet();
glyphSet->mFontHash = fontHash;
then = GetTimeMicroseconds();
}
#endif
- ScopedPointer< GlyphSet::Character > character( GetCharacter(slpFace->face, charCode,
+ ScopedPointer< GlyphSet::Character > character( GetCharacter(tizenFace->face, charCode,
DISTANCE_FIELD_SIZE, DISTANCE_FIELD_PADDING, textRequest.mMaxGlyphSize,
getBitmap, highQuality ) );
}
}
- delete slpFace;
+ delete tizenFace;
}
}
{
const std::string& fontFileName = GetFontPath( fontFamily, fontStyle );
- SlpFace* slpFace = LoadFontFace( fontFileName, PixelSize( HIGH_QUALITY_PIXEL_SIZE), freeType );
- if( slpFace )
+ TizenFace* tizenFace = LoadFontFace( fontFileName, PixelSize( HIGH_QUALITY_PIXEL_SIZE), freeType );
+ if( tizenFace )
{
// scale factor for unit scaled glyphs
- const float xScale = 1.0f / (slpFace->face->size->metrics.x_scale / 65536.0f);
- const float yScale = 1.0f / (slpFace->face->size->metrics.y_scale / 65536.0f);
+ const float xScale = 1.0f / (tizenFace->face->size->metrics.x_scale / 65536.0f);
+ const float yScale = 1.0f / (tizenFace->face->size->metrics.y_scale / 65536.0f);
- globalMetrics.lineHeight = slpFace->face->height * ONE_OVER_64;
- globalMetrics.ascender = slpFace->face->ascender * ONE_OVER_64;
- globalMetrics.unitsPerEM = slpFace->face->units_per_EM * ONE_OVER_64;
+ globalMetrics.lineHeight = tizenFace->face->height * ONE_OVER_64;
+ globalMetrics.ascender = tizenFace->face->ascender * ONE_OVER_64;
+ globalMetrics.unitsPerEM = tizenFace->face->units_per_EM * ONE_OVER_64;
globalMetrics.underlinePosition = -4.f;
globalMetrics.underlineThickness = 5.f * yScale;
globalMetrics.padAdjustX = DISTANCE_FIELD_PADDING * xScale;
globalMetrics.padAdjustY = DISTANCE_FIELD_PADDING * yScale;
- delete slpFace;
+ delete tizenFace;
}
}
}
Integration::BitmapPtr image;
const std::string& fontFileName = GetFontPath( fontFamily, fontStyle );
- SlpFace* slpFace = LoadFontFace( fontFileName, PixelSize( Font::PointsToPixels( fontSize ) ), freeType );
+ TizenFace* tizenFace = LoadFontFace( fontFileName, PixelSize( Font::PointsToPixels( fontSize ) ), freeType );
- if( NULL != slpFace )
+ if( NULL != tizenFace )
{
- image = GetGlyphBitmap( slpFace->face, character );
- delete slpFace;
+ image = GetGlyphBitmap( tizenFace->face, character );
+ delete tizenFace;
}
return image;
return mImpl->mFontController->GetFontPath(std::make_pair(fontFamily,fontStyle));
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_LOADER_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_LOADER_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
class FontController;
}
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
std::string& closestFontStyleMatch );
/**
- * @copydoc SlpPlatformAbstraction::GetFontLineHeightFromCapsHeight
+ * @copydoc TizenPlatformAbstraction::GetFontLineHeightFromCapsHeight
*/
PixelSize GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight, FT_Library freeType);
/**
- * @copydoc SlpPlatformAbstraction::GetFontList
+ * @copydoc TizenPlatformAbstraction::GetFontList
*/
void GetFontList( Dali::Integration::PlatformAbstraction::FontListMode mode, std::vector<std::string>& fontList );
/**
- * @copydoc SlpPlatformAbstraction::LoadFile()
+ * @copydoc TizenPlatformAbstraction::LoadFile()
*/
bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
/**
- * @copydoc SlpPlatformAbstraction::LoadFile()
+ * @copydoc TizenPlatformAbstraction::LoadFile()
*/
std::string LoadFile(const std::string& filename) const;
/**
- * @copydoc SlpPlatformAbstraction::SaveFile()
+ * @copydoc TizenPlatformAbstraction::SaveFile()
*/
static bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer);
};
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLPPLATFORM_RESOURCE_LOADER_H_
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_LOADER_H_
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
StubbedResourceLoadingClient& operator =( StubbedResourceLoadingClient& rhs );
};
-} /* namespace SlpPlatform */
+} /* namespace TizenPlatform */
} /* namespace Dali */
#endif /* _DALI_PLATFORM_RESOURCE_LOADING_CLIENT_H_ */
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
ResourceRequesterBase::ResourceRequesterBase( ResourceLoader& resourceLoader )
{
}
-} // Namespace SlpPlatform
+} // Namespace TizenPlatform
} // Namespace Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_REQUESTER_BASE_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_REQUESTER_BASE_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_REQUESTER_BASE_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_REQUESTER_BASE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*
*/
-#include <platform-abstractions/slp/resource-loader/resource-loader.h>
+#include <platform-abstractions/tizen/resource-loader/resource-loader.h>
#include <dali/integration-api/resource-request.h>
#include <dali/integration-api/resource-cache.h>
class ResourceRequest;
}
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
ResourceRequesterBase& operator=(const ResourceRequesterBase& rhs );
};
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#endif // __DALI_SLP_PLATFORM_RESOURCE_REQUESTER_BASE_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_REQUESTER_BASE_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
ResourceShaderRequester::ResourceShaderRequester( ResourceLoader& resourceLoader )
mThreadShader->CancelRequest(id);
}
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_SHADER_REQUESTER_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_SHADER_REQUESTER_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_SHADER_REQUESTER_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_SHADER_REQUESTER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
ResourceThreadShader* mThreadShader; ///< Thread to load requests
};
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#endif // __DALI_SLP_PLATFORM_RESOURCE_SHADER_REQUESTER_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_SHADER_REQUESTER_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
}
}
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_TEXT_REQUESTER_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_TEXT_REQUESTER_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_TEXT_REQUESTER_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_TEXT_REQUESTER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*
*/
-#include <platform-abstractions/slp/resource-loader/resource-requester-base.h>
+#include <platform-abstractions/tizen/resource-loader/resource-requester-base.h>
#include "resource-thread-text.h"
namespace Dali
class ResourceRequest;
}
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceTextRequester : public ResourceRequesterBase
ResourceThreadText* mThreadText; ///< Loader thread
};
-} // SlpPlatform
+} // TizenPlatform
} // Dali
-#endif // __DALI_SLP_PLATFORM_RESOURCE_TEXT_REQUESTER_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_TEXT_REQUESTER_H__
#include <dali/integration-api/debug.h>
#include "resource-thread-base.h"
-#include "slp-logging.h"
+#include "tizen-logging.h"
#include "atomics.h"
using namespace Dali::Integration;
const Integration::ResourceId NO_REQUEST_IN_FLIGHT = Integration::ResourceId(0) - 1;
const Integration::ResourceId NO_REQUEST_CANCELLED = Integration::ResourceId(0) - 2;
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
void ResourceThreadBase::InstallLogging()
{
- // resource loading thread will send its logs to SLP Platform's LogMessage handler.
- Dali::Integration::Log::InstallLogFunction(Dali::SlpPlatform::LogMessage);
+ // resource loading thread will send its logs to TIZEN Platform's LogMessage handler.
+ Dali::Integration::Log::InstallLogFunction(Dali::TizenPlatform::LogMessage);
}
void ResourceThreadBase::UninstallLogging()
///! If you need this for a subclassed thread, look to ResourceThreadImage::Decode() for an example implementation.
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_THREAD_BASE_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_THREAD_BASE_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_BASE_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_BASE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
#endif
}; // class ResourceThreadBase
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLPPLATFORM_RESOURCE_THREAD_BASE_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_BASE_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
ResourceThreadImage::ResourceThreadImage(ResourceLoader& resourceLoader, bool forRemoteImage)
}
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_THREAD_IMAGE_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_THREAD_IMAGE_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_IMAGE_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_IMAGE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceThreadImage : public ResourceThreadBase
void DecodeImageFromMemory(void* blobBytes, size_t blobSize, const Integration::ResourceRequest& request);
}; // class ResourceThreadImage
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_RESOURCE_THREAD_IMAGE_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_IMAGE_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
ResourceThreadShader::ResourceThreadShader(ResourceLoader& resourceLoader)
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_THREAD_SHADER_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_THREAD_SHADER_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_SHADER_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_SHADER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
}
}
-namespace SlpPlatform
+namespace TizenPlatform
{
class ResourceThreadShader : public ResourceThreadBase
}; // class ResourceThreadShader
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_RESOURCE_THREAD_SHADER_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_SHADER_H__
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
mDataCaches.clear();
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_RESOURCE_THREAD_TEXT_H__
-#define __DALI_SLP_PLATFORM_RESOURCE_THREAD_TEXT_H__
+#ifndef __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_TEXT_H__
+#define __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_TEXT_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
class DataCache;
}
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
* Resource loader for glyph distance fields.
}; // class ResourceThreadText
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_RESOURCE_THREAD_TEXT_H__
+#endif // __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_TEXT_H__
*
*/
-#include "slp-font-configuration-parser.h"
+#include "tizen-font-configuration-parser.h"
#include <sstream>
#include <libxml/xmlmemory.h>
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace FontConfigurationParser
#if defined(DEBUG_ENABLED)
namespace
{
-Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_SLP_FONT_CONFIGURATION_PARSER");
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TIZEN_FONT_CONFIGURATION_PARSER");
}
#endif
} // namespace FontConfParser
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_FONT_CONFIGURATION_PARSER_H__
-#define __DALI_SLP_PLATFORM_FONT_CONFIGURATION_PARSER_H__
+#ifndef __DALI_TIZEN_PLATFORM_FONT_CONFIGURATION_PARSER_H__
+#define __DALI_TIZEN_PLATFORM_FONT_CONFIGURATION_PARSER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace FontConfigurationParser
} // namespace FontConfParser
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_FONT_CONFIGURATION_PARSER_H__
+#endif // __DALI_TIZEN_PLATFORM_FONT_CONFIGURATION_PARSER_H__
*/
// FUNCTION HEADER
-#include "slp-logging.h"
+#include "tizen-logging.h"
// EXTERNAL INCLUDES
#ifndef DALI_PROFILE_UBUNTU
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
#endif // DALI_PROFILE_UBUNTU
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_LOGGING_H__
-#define __DALI_SLP_LOGGING_H__
+#ifndef __DALI_TIZEN_LOGGING_H__
+#define __DALI_TIZEN_LOGGING_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace SlpPlatform
+namespace TizenPlatform
{
/**
*/
void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_LOGGING_H__
+#endif // __DALI_TIZEN_LOGGING_H__
*
*/
-#include "slp-platform-abstraction.h"
+#include "tizen-platform-abstraction.h"
#ifndef DALI_PROFILE_UBUNTU
#include <vconf.h>
#include "resource-loader/resource-loader.h"
#include "dynamics/dynamics-factory.h"
-#include "slp-font-configuration-parser.h"
+#include "tizen-font-configuration-parser.h"
#include "data-cache/metrics-cache.h"
#include "image-loaders/image-loader.h"
Integration::PlatformAbstraction* CreatePlatformAbstraction()
{
- return new SlpPlatform::SlpPlatformAbstraction();
+ return new TizenPlatform::TizenPlatformAbstraction();
}
-namespace SlpPlatform
+namespace TizenPlatform
{
namespace
};
}
-SlpPlatformAbstraction::SlpPlatformAbstraction()
+TizenPlatformAbstraction::TizenPlatformAbstraction()
: mResourceLoader(new ResourceLoader),
mDynamicsFactory(NULL),
mDataStoragePath( "" ),
UpdateDefaultsFromDevice();
}
-SlpPlatformAbstraction::~SlpPlatformAbstraction()
+TizenPlatformAbstraction::~TizenPlatformAbstraction()
{
delete mResourceLoader;
delete mDynamicsFactory;
}
}
-void SlpPlatformAbstraction::GetTimeMicroseconds(unsigned int &seconds, unsigned int µSeconds)
+void TizenPlatformAbstraction::GetTimeMicroseconds(unsigned int &seconds, unsigned int µSeconds)
{
timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
microSeconds = time.tv_nsec / NANOSECS_TO_MICROSECS;
}
-void SlpPlatformAbstraction::Suspend()
+void TizenPlatformAbstraction::Suspend()
{
if (mResourceLoader)
{
}
}
-void SlpPlatformAbstraction::Resume()
+void TizenPlatformAbstraction::Resume()
{
if (mResourceLoader)
{
}
}
-const std::string& SlpPlatformAbstraction::GetDefaultFontFamily() const
+const std::string& TizenPlatformAbstraction::GetDefaultFontFamily() const
{
// VCC TODO: return default font style as well.
return mDefaultFontFamily;
}
-float SlpPlatformAbstraction::GetDefaultFontSize() const
+float TizenPlatformAbstraction::GetDefaultFontSize() const
{
return mDefaultFontSize;
}
-PixelSize SlpPlatformAbstraction::GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const
+PixelSize TizenPlatformAbstraction::GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const
{
PixelSize result(0);
return result;
}
-Integration::GlyphSet* SlpPlatformAbstraction::GetGlyphData ( const Dali::Integration::TextResourceType& textRequest,
+Integration::GlyphSet* TizenPlatformAbstraction::GetGlyphData ( const Dali::Integration::TextResourceType& textRequest,
const std::string& fontFamily,
bool getBitmap) const
{
return NULL;
}
-Integration::GlyphSet* SlpPlatformAbstraction::GetCachedGlyphData( const Integration::TextResourceType& textRequest,
+Integration::GlyphSet* TizenPlatformAbstraction::GetCachedGlyphData( const Integration::TextResourceType& textRequest,
const std::string& fontFamily ) const
{
if (mResourceLoader)
}
-void SlpPlatformAbstraction::GetGlobalMetrics( const std::string& fontFamily, const std::string& fontStyle, Integration::GlobalMetrics& globalMetrics ) const
+void TizenPlatformAbstraction::GetGlobalMetrics( const std::string& fontFamily, const std::string& fontStyle, Integration::GlobalMetrics& globalMetrics ) const
{
if( mResourceLoader )
{
}
}
-void SlpPlatformAbstraction::GetClosestImageSize( const std::string& filename,
+void TizenPlatformAbstraction::GetClosestImageSize( const std::string& filename,
const ImageAttributes& attributes,
Vector2& closestSize )
{
ImageLoader::GetClosestImageSize(filename, attributes, closestSize );
}
-void SlpPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
+void TizenPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
const ImageAttributes& attributes,
Vector2& closestSize )
{
}
-void SlpPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
+void TizenPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
{
if (mResourceLoader)
{
}
}
-Integration::ResourcePointer SlpPlatformAbstraction::LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath)
+Integration::ResourcePointer TizenPlatformAbstraction::LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath)
{
return ImageLoader::LoadResourceSynchronously( resourceType, resourcePath );
}
-void SlpPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
+void TizenPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
{
if (mResourceLoader)
{
}
}
-void SlpPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
+void TizenPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
{
if (mResourceLoader)
{
}
}
-bool SlpPlatformAbstraction::IsLoading()
+bool TizenPlatformAbstraction::IsLoading()
{
if (mResourceLoader)
{
return false;
}
-void SlpPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
+void TizenPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
{
if (mResourceLoader)
{
}
}
-void SlpPlatformAbstraction::SetDpi(unsigned int dpiHor, unsigned int dpiVer)
+void TizenPlatformAbstraction::SetDpi(unsigned int dpiHor, unsigned int dpiVer)
{
if (mResourceLoader)
{
}
}
-const std::string& SlpPlatformAbstraction::GetFontFamilyForChars(const Integration::TextArray& charsRequested) const
+const std::string& TizenPlatformAbstraction::GetFontFamilyForChars(const Integration::TextArray& charsRequested) const
{
if( mResourceLoader )
{
return NULL_FONT_FAMILY_NAME;
}
-bool SlpPlatformAbstraction::AllGlyphsSupported(const std::string &fontFamily, const std::string& fontStyle, const Integration::TextArray& charsRequested) const
+bool TizenPlatformAbstraction::AllGlyphsSupported(const std::string &fontFamily, const std::string& fontStyle, const Integration::TextArray& charsRequested) const
{
bool ret = false;
if (mResourceLoader)
return ret;
}
-bool SlpPlatformAbstraction::ValidateFontFamilyName(const std::string& fontFamily, const std::string& fontStyle, bool& isDefaultSystemFont, std::string& closestMatch, std::string& closestStyleMatch) const
+bool TizenPlatformAbstraction::ValidateFontFamilyName(const std::string& fontFamily, const std::string& fontStyle, bool& isDefaultSystemFont, std::string& closestMatch, std::string& closestStyleMatch) const
{
bool ret = false;
if( mResourceLoader )
return ret;
}
-void SlpPlatformAbstraction::GetFontList( Dali::Integration::PlatformAbstraction::FontListMode mode, std::vector<std::string>& fontList ) const
+void TizenPlatformAbstraction::GetFontList( Dali::Integration::PlatformAbstraction::FontListMode mode, std::vector<std::string>& fontList ) const
{
if( mResourceLoader )
{
}
}
-bool SlpPlatformAbstraction::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+bool TizenPlatformAbstraction::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
{
bool result = false;
return result;
}
-std::string SlpPlatformAbstraction::LoadFile( const std::string& filename )
+std::string TizenPlatformAbstraction::LoadFile( const std::string& filename )
{
std::string result;
if (mResourceLoader)
return result;
}
-bool SlpPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
+bool TizenPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
{
bool result = false;
return result;
}
-void SlpPlatformAbstraction::JoinLoaderThreads()
+void TizenPlatformAbstraction::JoinLoaderThreads()
{
delete mResourceLoader;
mResourceLoader = NULL;
}
-void SlpPlatformAbstraction::UpdateDefaultsFromDevice()
+void TizenPlatformAbstraction::UpdateDefaultsFromDevice()
{
// FontConfigurationParser::Parse sets the default font family and the default font style.
// If the isn't a configuration file or is invalid, or it doesn't have any tag with the default
mDefaultFontSize = FONT_SIZE_TABLE[fontSize];
}
-Integration::DynamicsFactory* SlpPlatformAbstraction::GetDynamicsFactory()
+Integration::DynamicsFactory* TizenPlatformAbstraction::GetDynamicsFactory()
{
if( NULL == mDynamicsFactory )
{
return mDynamicsFactory;
}
-bool SlpPlatformAbstraction::ReadGlobalMetricsFromCache( const std::string& fontFamily,
+bool TizenPlatformAbstraction::ReadGlobalMetricsFromCache( const std::string& fontFamily,
const std::string& fontStyle,
Integration::GlobalMetrics& globalMetrics )
{
return MetricsCache::ReadGlobal( fontFamily, fontStyle, globalMetrics );
}
-void SlpPlatformAbstraction::WriteGlobalMetricsToCache( const std::string& fontFamily,
+void TizenPlatformAbstraction::WriteGlobalMetricsToCache( const std::string& fontFamily,
const std::string& fontStyle,
const Integration::GlobalMetrics& globalMetrics )
{
MetricsCache::WriteGlobal( fontFamily, fontStyle, globalMetrics);
}
-bool SlpPlatformAbstraction::ReadMetricsFromCache( const std::string& fontFamily,
+bool TizenPlatformAbstraction::ReadMetricsFromCache( const std::string& fontFamily,
const std::string& fontStyle,
std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
{
return MetricsCache::Read( fontFamily, fontStyle, glyphMetricsContainer );
}
-void SlpPlatformAbstraction::WriteMetricsToCache( const std::string& fontFamily,
+void TizenPlatformAbstraction::WriteMetricsToCache( const std::string& fontFamily,
const std::string& fontStyle,
const Integration::GlyphSet& glyphSet )
{
MetricsCache::Write( fontFamily, fontStyle, glyphSet );
}
-void SlpPlatformAbstraction::GetFileNamesFromDirectory( const std::string& directoryName,
+void TizenPlatformAbstraction::GetFileNamesFromDirectory( const std::string& directoryName,
std::vector<std::string>& fileNames )
{
dirent* de = NULL;
}
}
-Integration::BitmapPtr SlpPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, const float fontSize, const uint32_t character ) const
+Integration::BitmapPtr TizenPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, const float fontSize, const uint32_t character ) const
{
Integration::BitmapPtr glyphImage;
return glyphImage;
}
-bool SlpPlatformAbstraction::LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+bool TizenPlatformAbstraction::LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
{
bool result = false;
return result;
}
-void SlpPlatformAbstraction::SetDataStoragePath( const std::string& path )
+void TizenPlatformAbstraction::SetDataStoragePath( const std::string& path )
{
mDataStoragePath = path;
}
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#ifndef __DALI_SLP_PLATFORM_ABSTRACTION_H__
-#define __DALI_SLP_PLATFORM_ABSTRACTION_H__
+#ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
+#define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*/
Integration::PlatformAbstraction* CreatePlatformAbstraction();
-namespace SlpPlatform
+namespace TizenPlatform
{
class DynamicsFactory;
/**
* Concrete implementation of the platform abstraction class.
*/
-class SlpPlatformAbstraction : public Integration::PlatformAbstraction
+class TizenPlatformAbstraction : public Integration::PlatformAbstraction
{
public: // Construction & Destruction
/**
* Constructor
*/
- SlpPlatformAbstraction();
+ TizenPlatformAbstraction();
/**
* Destructor
*/
- virtual ~SlpPlatformAbstraction();
+ virtual ~TizenPlatformAbstraction();
public: // PlatformAbstraction overrides
float mDefaultFontSize;
};
-} // namespace SlpPlatform
+} // namespace TizenPlatform
} // namespace Dali
-#endif // __DALI_SLP_PLATFORM_ABSTRACTION_H__
+#endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__