Merge "Add support for new accessibility actions" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 25 Jun 2015 15:30:08 +0000 (08:30 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 25 Jun 2015 15:30:08 +0000 (08:30 -0700)
33 files changed:
adaptors/base/environment-options.cpp
adaptors/base/environment-options.h
adaptors/base/environment-variables.h
adaptors/base/update-thread.cpp
adaptors/base/update-thread.h
adaptors/common/adaptor-impl.cpp
adaptors/common/events/tap-gesture-detector.cpp
adaptors/common/object-profiler.cpp
adaptors/common/object-profiler.h
adaptors/public-api/dali-adaptor-version.cpp
adaptors/x11/clipboard-impl-x.cpp
adaptors/x11/event-handler-x.cpp
adaptors/x11/file.list
automated-tests/src/dali-platform-abstraction/utc-image-loading-cancel-all-loads.cpp
automated-tests/src/dali-platform-abstraction/utc-image-loading-cancel-some-loads.cpp
automated-tests/src/dali-platform-abstraction/utc-image-loading-common.cpp
automated-tests/src/dali-platform-abstraction/utc-image-loading-common.h
build/tizen/adaptor/Makefile.am
build/tizen/configure.ac
packaging/dali-adaptor-common.spec
packaging/dali-adaptor-mobile.spec
packaging/dali-adaptor-tv.spec
packaging/dali-adaptor-wearable.spec
packaging/dali-adaptor.spec
platform-abstractions/tizen/file.list
platform-abstractions/tizen/image-loaders/loader-bmp.h
platform-abstractions/tizen/image-loaders/loader-gif.h
platform-abstractions/tizen/image-loaders/loader-ico.h
platform-abstractions/tizen/image-loaders/loader-jpeg.cpp [deleted file]
platform-abstractions/tizen/image-loaders/loader-jpeg.h
platform-abstractions/tizen/image-loaders/loader-ktx.h
platform-abstractions/tizen/image-loaders/loader-png.h
platform-abstractions/tizen/image-loaders/loader-wbmp.h

index 2df0b2b..8344e05 100644 (file)
@@ -87,8 +87,9 @@ EnvironmentOptions::EnvironmentOptions()
   mNetworkControl(0),
   mFpsFrequency(0),
   mUpdateStatusFrequency(0),
+  mObjectProfilerInterval( 0 ),
   mPerformanceStatsLevel(0),
-  mPerformanceStatsFrequency( DEFAULT_STATISTICS_LOG_FREQUENCY),
+  mPerformanceStatsFrequency( DEFAULT_STATISTICS_LOG_FREQUENCY ),
   mPerformanceTimeStampOutput(0),
   mPanGestureLoggingLevel(0),
   mPanGesturePredictionMode(-1),
@@ -140,6 +141,11 @@ unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
   return mUpdateStatusFrequency;
 }
 
+unsigned int EnvironmentOptions::GetObjectProfilerInterval() const
+{
+  return mObjectProfilerInterval;
+}
+
 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingOptions() const
 {
   return mPerformanceStatsLevel;
@@ -230,7 +236,7 @@ const std::string& EnvironmentOptions::GetWindowClassName() const
 
 bool EnvironmentOptions::PerformanceServerRequired() const
 {
-  return ( (GetPerformanceStatsLoggingOptions() > 0) ||
+  return ( ( GetPerformanceStatsLoggingOptions() > 0) ||
            ( GetPerformanceTimeStampOutput() > 0 ) ||
            ( GetNetworkControlMode() > 0) );
 }
@@ -240,6 +246,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
   // get logging options
   mFpsFrequency = GetIntegerEnvironmentVariable( DALI_ENV_FPS_TRACKING, 0 );
   mUpdateStatusFrequency = GetIntegerEnvironmentVariable( DALI_ENV_UPDATE_STATUS_INTERVAL, 0 );
+  mObjectProfilerInterval = GetIntegerEnvironmentVariable( DALI_ENV_OBJECT_PROFILER_INTERVAL, 0 );
   mPerformanceStatsLevel = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE_STATS, 0 );
   mPerformanceStatsFrequency = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE_STATS_FREQUENCY, 0 );
   mPerformanceTimeStampOutput = GetIntegerEnvironmentVariable( DALI_ENV_PERFORMANCE_TIMESTAMP_OUTPUT, 0 );
index b553ba8..29aa9bf 100644 (file)
@@ -79,6 +79,11 @@ public:
   unsigned int GetUpdateStatusLoggingFrequency() const;
 
   /**
+   * @return object profiler status interval ( 0 == off )
+   */
+  unsigned int GetObjectProfilerInterval() const;
+
+  /**
    * @return performance statistics log level ( 0 == off )
    */
   unsigned int GetPerformanceStatsLoggingOptions() const;
@@ -195,6 +200,7 @@ private: // Data
   unsigned int mNetworkControl;                   ///< whether network control is enabled
   unsigned int mFpsFrequency;                     ///< how often fps is logged out in seconds
   unsigned int mUpdateStatusFrequency;            ///< how often update status is logged out in frames
+  unsigned int mObjectProfilerInterval;           ///< how often object counts are logged out in seconds
   unsigned int mPerformanceStatsLevel;            ///< performance statistics logging bitmask
   unsigned int mPerformanceStatsFrequency;        ///< performance statistics logging frequency (seconds)
   unsigned int mPerformanceTimeStampOutput;       ///< performance time stamp output ( bitmask)
index a1190c4..3b8f663 100644 (file)
@@ -56,6 +56,8 @@ namespace Adaptor
 // environment variable for enabling/disabling fps tracking
 #define DALI_ENV_UPDATE_STATUS_INTERVAL "DALI_UPDATE_STATUS_INTERVAL"
 
+#define DALI_ENV_OBJECT_PROFILER_INTERVAL "DALI_OBJECT_PROFILER_INTERVAL"
+
 #define DALI_ENV_LOG_PAN_GESTURE "DALI_LOG_PAN_GESTURE"
 
 #define DALI_ENV_PAN_PREDICTION_MODE "DALI_PAN_PREDICTION_MODE"
index a60f6ef..7c84964 100644 (file)
@@ -40,7 +40,6 @@ namespace Adaptor
 namespace
 {
 const char* DALI_TEMP_UPDATE_FPS_FILE( "/tmp/dalifps.txt" );
-const unsigned int MICROSECONDS_PER_MILLISECOND( 1000 );
 
 #if defined(DEBUG_ENABLED)
 Integration::Log::Filter* gUpdateLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_UPDATE_THREAD");
@@ -52,23 +51,19 @@ UpdateThread::UpdateThread( UpdateRenderSynchronization& sync,
                             const EnvironmentOptions& environmentOptions )
 : mUpdateRenderSync( sync ),
   mCore( adaptorInterfaces.GetCore()),
-  mFpsTrackingSeconds( environmentOptions.GetFrameRateLoggingFrequency() ),
+  mFpsTrackingSeconds( fabsf( environmentOptions.GetFrameRateLoggingFrequency() ) ),
+  mFrameCount( 0.0f ),
   mElapsedTime( 0.0f ),
-  mElapsedSeconds( 0u ),
   mStatusLogInterval( environmentOptions.GetUpdateStatusLoggingFrequency() ),
   mStatusLogCount( 0u ),
   mThread( NULL ),
   mEnvironmentOptions( environmentOptions )
 {
-  if( mFpsTrackingSeconds > 0 )
-  {
-    mFpsRecord.resize( mFpsTrackingSeconds, 0.0f );
-  }
 }
 
 UpdateThread::~UpdateThread()
 {
-  if(mFpsTrackingSeconds > 0)
+  if( mFpsTrackingSeconds > 0.f )
   {
     OutputFPSRecord();
   }
@@ -127,7 +122,7 @@ bool UpdateThread::Run()
 
     mCore.Update( lastFrameDelta, lastSyncTime, nextSyncTime, status );
 
-    if( mFpsTrackingSeconds > 0 )
+    if( mFpsTrackingSeconds > 0.f )
     {
       FPSTracking(status.SecondsFromLastFrame());
     }
@@ -169,63 +164,33 @@ bool UpdateThread::Run()
   return true;
 }
 
-void UpdateThread::FPSTracking(float secondsFromLastFrame)
+void UpdateThread::FPSTracking( float secondsFromLastFrame )
 {
-  if (mElapsedSeconds < mFpsTrackingSeconds)
+  if ( mElapsedTime < mFpsTrackingSeconds )
   {
     mElapsedTime += secondsFromLastFrame;
-    if( secondsFromLastFrame  > 1.0 )
-    {
-      int seconds = floor(mElapsedTime);
-      mElapsedSeconds += seconds;
-      mElapsedTime -= static_cast<float>(seconds);
-    }
-    else
-    {
-      if( mElapsedTime>=1.0f )
-      {
-        mElapsedTime -= 1.0f;
-        mFpsRecord[mElapsedSeconds] += 1.0f - mElapsedTime/secondsFromLastFrame;
-        mElapsedSeconds++;
-        mFpsRecord[mElapsedSeconds] += mElapsedTime/secondsFromLastFrame;
-      }
-      else
-      {
-        mFpsRecord[mElapsedSeconds] += 1.0f;
-      }
-    }
+    mFrameCount += 1.f;
   }
   else
   {
     OutputFPSRecord();
-    mFpsRecord.clear();
-    mFpsTrackingSeconds = 0;
+    mFrameCount = 0.f;
+    mElapsedTime = 0.f;
   }
 }
 
 void UpdateThread::OutputFPSRecord()
 {
-  for(unsigned int i = 0; i < mElapsedSeconds; i++)
-  {
-    DALI_LOG_FPS("fps( %d ):%f\n",i ,mFpsRecord[i]);
-  }
+  float fps = mFrameCount / mElapsedTime;
+  DALI_LOG_FPS("Frame count %.0f, elapsed time %.1fs, FPS: %.2f\n", mFrameCount, mElapsedTime, fps );
 
-  // Dumps out the DALI_FPS_TRACKING worth of frame rates.
-  // E.g. if we run:   DALI_FPS_TRACKING=30  dali-demo
-  // it will dump out the first 30 seconds of FPS information to a temp file
-  FILE* outfile = fopen( DALI_TEMP_UPDATE_FPS_FILE, "w");
+  // Dumps out the frame rate.
+  FILE* outfile = fopen( DALI_TEMP_UPDATE_FPS_FILE, "w" );
   if( outfile )
   {
-    for(unsigned int i = 0; i < mElapsedSeconds; i++)
-    {
-      char fpsString[10];
-      snprintf(fpsString,sizeof(fpsString),"%.2f \n",mFpsRecord[i]);
-      int ret = fputs( fpsString, outfile );
-      if( ret < 0)
-      {
-        break;
-      }
-    }
+    char fpsString[10];
+    snprintf(fpsString,sizeof(fpsString),"%.2f \n", fps );
+    fputs( fpsString, outfile ); // ignore the error on purpose
     fclose( outfile );
   }
 }
index fda142e..d81f623 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_UPDATE_THREAD_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
  *
  */
 
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-
 namespace boost
 {
-
 class thread;
-
 } // namespace boost
 
 namespace Dali
@@ -112,10 +107,9 @@ private: // Data
 
   Dali::Integration::Core&            mCore;                ///< Dali core reference
 
-  unsigned int                        mFpsTrackingSeconds;  ///< fps tracking time length in seconds
-  std::vector<float>                  mFpsRecord;           ///< Record of frame rate
-  float                               mElapsedTime;         ///< time elapsed within current second
-  unsigned int                        mElapsedSeconds;      ///< seconds elapsed since the fps tracking started
+  float                               mFpsTrackingSeconds;  ///< fps tracking time length in seconds
+  float                               mFrameCount;          ///< how many frames occurred during tracking period
+  float                               mElapsedTime;         ///< time elapsed from previous fps tracking output
 
   unsigned int                        mStatusLogInterval;   ///< Interval in frames between status debug prints
   unsigned int                        mStatusLogCount;      ///< Used to count frames between status debug prints
index 5fdd1be..fe957ae 100644 (file)
@@ -141,7 +141,11 @@ void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
 
   mCore = Integration::Core::New( *this, *mPlatformAbstraction, *mGLES, *eglSyncImpl, *mGestureManager, dataRetentionPolicy );
 
-  mObjectProfiler = new ObjectProfiler();
+  const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
+  if( 0u < timeInterval )
+  {
+    mObjectProfiler = new ObjectProfiler( timeInterval );
+  }
 
   mNotificationTrigger = new TriggerEvent( MakeCallback( this, &Adaptor::ProcessCoreEvents ) );
 
index 6981f88..06bce59 100644 (file)
@@ -105,8 +105,7 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
           {
             mLastTapTime = event.time;
             EmitSingleTap( event.time, point );
-            mState = Clear;
-            break;
+            mState = Registered;
           }
           else
           {
@@ -114,14 +113,13 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
             EmitGesture( Gesture::Started, event.time );
             mState = Clear;
           }
-          break;
         }
-        if (pointState == TouchPoint::Down)
+        else if (pointState == TouchPoint::Down)
         {
           Vector2 distanceDelta(abs(mTouchPosition.x - point.screen.x),
                                 abs(mTouchPosition.y - point.screen.y));
 
-          unsigned long timeDelta = abs( mTouchTime - mLastTapTime );
+          unsigned long timeDelta = abs( event.time - mLastTapTime );
 
           if (distanceDelta.x > MAXIMUM_MOTION_ALLOWED ||
               distanceDelta.y > MAXIMUM_MOTION_ALLOWED ||
index f91468a..a5f101c 100644 (file)
@@ -38,28 +38,18 @@ namespace Internal
 namespace Adaptor
 {
 
-ObjectProfiler::ObjectProfiler()
-: mIsActive(false)
+ObjectProfiler::ObjectProfiler( unsigned int timeInterval )
 {
   // This class must be created after the Stage; this means it doesn't count the initial objects
   // that are created by the stage (base layer, default camera actor)
   mObjectRegistry = Dali::Stage::GetCurrent().GetObjectRegistry();
 
-  char* profile = getenv("PROFILE_DALI_OBJECTS");
-  if( profile != NULL )
-  {
-    mIsActive = true;
-    int timeInterval = atoi(profile);
-    if( timeInterval > 0 )
-    {
-      mTimer = Dali::Timer::New(timeInterval*1000);
-      mTimer.TickSignal().Connect( this, &ObjectProfiler::OnTimeout );
-      mTimer.Start();
-    }
+  mTimer = Dali::Timer::New( timeInterval * 1000 );
+  mTimer.TickSignal().Connect( this, &ObjectProfiler::OnTimeout );
+  mTimer.Start();
 
-    mObjectRegistry.ObjectCreatedSignal().Connect( this, &ObjectProfiler::OnObjectCreated );
-    mObjectRegistry.ObjectDestroyedSignal().Connect( this, &ObjectProfiler::OnObjectDestroyed );
-  }
+  mObjectRegistry.ObjectCreatedSignal().Connect( this, &ObjectProfiler::OnObjectCreated );
+  mObjectRegistry.ObjectDestroyedSignal().Connect( this, &ObjectProfiler::OnObjectDestroyed );
 }
 
 ObjectProfiler::~ObjectProfiler()
index 8308664..eca7972 100644 (file)
@@ -40,10 +40,12 @@ namespace Adaptor
 class ObjectProfiler : public ConnectionTracker
 {
 public:
+
   /**
    * Constructor
+   * @param timeInterval to specify the frequency of reporting
    */
-  ObjectProfiler();
+  ObjectProfiler( unsigned int timeInterval );
 
   /**
    * Destructor
@@ -89,7 +91,6 @@ private:
   Dali::Timer             mTimer;
   InstanceCountMap        mInstanceCountMap;
   InstanceTypes           mInstanceTypes;
-  bool                    mIsActive;
 };
 
 } // Adaptor
index ca5b867..7d2fd67 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 0;
-const unsigned int ADAPTOR_MICRO_VERSION = 45;
+const unsigned int ADAPTOR_MICRO_VERSION = 46;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index fdb3650..eafd12a 100644 (file)
@@ -173,7 +173,7 @@ unsigned int Clipboard::NumberOfItems()
   Ecore_X_Atom xAtomCbhmCountGet = ecore_x_atom_get( CBHM_cCOUNT );
 
   std::string ret( ECore::WindowInterface::GetWindowProperty( xAtomCbhmCountGet, NULL, 0 ) );
-  int count = -1;
+  int count = 0;
 
   if ( !ret.empty() )
   {
index a2d3e3c..bd31ebf 100644 (file)
@@ -383,6 +383,13 @@ struct EventHandler::Impl
             {
               DALI_LOG_INFO( gImfLogging, Debug::General, "Failed to Select Events\n" );
             }
+
+            free( xiEventMask.mask );
+
+            if( deviceInfo != NULL )
+            {
+              XIFreeDeviceInfo( deviceInfo );
+            }
           }
         }
         else
index 98ec298..9d66ebf 100644 (file)
@@ -35,5 +35,5 @@ 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 = \
+devel_api_adaptor_tizen_x11_header_files = \
   $(adaptor_x11_dir)/window-extensions.h
index 0c6d007..aa4d8b5 100644 (file)
@@ -55,7 +55,7 @@ int UtcDaliCancelAllLoads(void)
     // Issue load requests for a batch of images:
     for( unsigned validImage = 0; validImage < NUM_VALID_IMAGES; ++validImage )
     {
-      const ImageAttributes & loadParams = gCancelAttributes[ loadsLaunched % gCancelAttributes.size() ];
+      const ImageParameters & loadParams = gCancelAttributes[ loadsLaunched % gCancelAttributes.size() ];
       const BitmapResourceType bitmapResourceType( loadParams.first, loadParams.second.first, loadParams.second.second.first, loadParams.second.second.second );
       const ResourceId resourceId = loadGroup * NUM_VALID_IMAGES + validImage + 1;
       gAbstraction->LoadResource( ResourceRequest( resourceId, bitmapResourceType, VALID_IMAGES[validImage], priority ) );
index ed58204..9a6d98e 100644 (file)
@@ -54,7 +54,7 @@ int UtcDaliCancelSomeLoads(void)
     // Issue load requests for a batch of images:
     for( unsigned validImage = 0; validImage < NUM_VALID_IMAGES; ++validImage )
     {
-      const ImageAttributes & loadParams = gCancelAttributes[ loadsLaunched % gCancelAttributes.size() ];
+      const ImageParameters & loadParams = gCancelAttributes[ loadsLaunched % gCancelAttributes.size() ];
       const BitmapResourceType bitmapResourceType( loadParams.first, loadParams.second.first, loadParams.second.second.first, loadParams.second.second.second );
       const ResourceId resourceId = loadGroup * NUM_VALID_IMAGES + validImage + 1;
       gAbstraction->LoadResource( ResourceRequest( resourceId, bitmapResourceType, VALID_IMAGES[validImage], priority ) );
index d53c0fb..3d80c50 100644 (file)
 /** Live platform abstraction recreated for each test case. */
 Integration::PlatformAbstraction * gAbstraction = 0;
 
-/** A variety of ImageAttributes to reach different code paths that have embedded code paths. */
-std::vector<ImageAttributes> gCancelAttributes;
+/** A variety of parameters to reach different code paths in image loading code. */
+std::vector<ImageParameters> gCancelAttributes;
 
 void utc_dali_loading_startup(void)
 {
   test_return_value = TET_UNDEF;
   gAbstraction = CreatePlatformAbstraction();
 
-  // Setup some ImageAttributes to engage post-processing stages:
+  // Setup some loading parameters to engage post-processing stages:
 
-  ImageAttributes scaleToFillAttributes;
+  ImageParameters scaleToFillAttributes;
   scaleToFillAttributes.second.first = FittingMode::SCALE_TO_FILL;
   scaleToFillAttributes.first = ImageDimensions( 160, 120 );
   gCancelAttributes.push_back( scaleToFillAttributes );
 
   // Hit the derived dimensions code:
-  ImageAttributes scaleToFillAttributesDeriveWidth = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesDeriveWidth = scaleToFillAttributes;
   scaleToFillAttributesDeriveWidth.first = ImageDimensions( 0, 120 );
   gCancelAttributes.push_back( scaleToFillAttributesDeriveWidth );
 
-  ImageAttributes scaleToFillAttributesDeriveHeight = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesDeriveHeight = scaleToFillAttributes;
   scaleToFillAttributesDeriveHeight.first = ImageDimensions( 160, 0 );
   gCancelAttributes.push_back( scaleToFillAttributesDeriveHeight );
 
   // Try to push a tall crop:
-  ImageAttributes scaleToFillAttributesTall = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesTall = scaleToFillAttributes;
   scaleToFillAttributesTall.first = ImageDimensions( 160, 480 );
-  ImageAttributes scaleToFillAttributesTall2 = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesTall2 = scaleToFillAttributes;
   scaleToFillAttributesTall2.first = ImageDimensions( 160, 509 );
-  ImageAttributes scaleToFillAttributesTall3 = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesTall3 = scaleToFillAttributes;
   scaleToFillAttributesTall3.first = ImageDimensions( 37, 251 );
   gCancelAttributes.push_back( scaleToFillAttributesTall );
   gCancelAttributes.push_back( scaleToFillAttributesTall2 );
   gCancelAttributes.push_back( scaleToFillAttributesTall3 );
 
   // Try to push a wide crop:
-  ImageAttributes scaleToFillAttributesWide = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesWide = scaleToFillAttributes;
   scaleToFillAttributesWide.first = ImageDimensions( 320, 60 );
-  ImageAttributes scaleToFillAttributesWide2 = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesWide2 = scaleToFillAttributes;
   scaleToFillAttributesWide2.first = ImageDimensions( 317, 60 );
-  ImageAttributes scaleToFillAttributesWide3 = scaleToFillAttributes;
+  ImageParameters scaleToFillAttributesWide3 = scaleToFillAttributes;
   scaleToFillAttributesWide3.first = ImageDimensions( 317, 53 );
   gCancelAttributes.push_back( scaleToFillAttributesWide );
   gCancelAttributes.push_back( scaleToFillAttributesWide2 );
   gCancelAttributes.push_back( scaleToFillAttributesWide3 );
 
-  ImageAttributes shrinkToFitAttributes = scaleToFillAttributes;
+  ImageParameters shrinkToFitAttributes = scaleToFillAttributes;
   shrinkToFitAttributes.second.first = FittingMode::SHRINK_TO_FIT;
   gCancelAttributes.push_back( shrinkToFitAttributes );
 
-  ImageAttributes fitWidthAttributes = scaleToFillAttributes;
+  ImageParameters fitWidthAttributes = scaleToFillAttributes;
   fitWidthAttributes.second.first = FittingMode::FIT_WIDTH;
   gCancelAttributes.push_back( fitWidthAttributes );
 
-  ImageAttributes fitHeightAttributes = scaleToFillAttributes;
+  ImageParameters fitHeightAttributes = scaleToFillAttributes;
   fitHeightAttributes.second.first = FittingMode::FIT_HEIGHT;
   gCancelAttributes.push_back( fitHeightAttributes );
 
index 4bec44b..9afcf8d 100644 (file)
@@ -77,9 +77,9 @@ double GetTimeMilliseconds( Integration::PlatformAbstraction& abstraction )
 /** Live platform abstraction recreated for each test case. */
 extern Integration::PlatformAbstraction * gAbstraction;
 
-/** A variety of ImageAttributes to reach different code paths that have embedded code paths. */
-typedef std::pair<ImageDimensions, std::pair<FittingMode::Type, std::pair<SamplingMode::Type, bool> > > ImageAttributes;
-extern std::vector<ImageAttributes> gCancelAttributes;
+/** A variety of parameters to reach different code paths in the image loading. */
+typedef std::pair<ImageDimensions, std::pair<FittingMode::Type, std::pair<SamplingMode::Type, bool> > > ImageParameters;
+extern std::vector<ImageParameters> gCancelAttributes;
 
 
 void utc_dali_loading_startup(void);
index f61b4f8..d4504a9 100644 (file)
@@ -181,12 +181,6 @@ dalifeedbackthemedir = ${dataReadOnlyDir}/themes/feedback-themes/
 dalifeedbacktheme_DATA = ${dali_plugin_theme_files}
 endif
 
-if TURBO_JPEG_IS_ON
-  tizen_platform_abstraction_src_files += $(tizen_turbo_jpeg_loader)
-else
-  tizen_platform_abstraction_src_files += $(tizen_jpeg_loader)
-endif
-
 lib_LTLIBRARIES = libdali-adaptor.la
 
 libdali_adaptor_la_SOURCES = \
@@ -279,6 +273,8 @@ libdali_adaptor_la_CXXFLAGS = \
                       $(CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS) \
                       $(ELDBUS_CFLAGS)
 
+libdali_adaptor_la_CFLAGS = $(libdali_adaptor_la_CXXFLAGS)
+
 libdali_adaptor_la_LIBADD = \
                       $(DALICORE_LIBS) \
                       $(OPENGLES20_LIBS) \
@@ -302,7 +298,8 @@ libdali_adaptor_la_LIBADD = \
                       $(CAPI_SYSTEM_INFO_LIBS) \
                       $(ELDBUS_LIBS) \
                       -lgif \
-                      -lboost_thread
+                      -lboost_thread \
+                      -lturbojpeg
 
 if WAYLAND
 libdali_adaptor_la_CXXFLAGS += $(WAYLAND_CFLAGS)
@@ -341,16 +338,10 @@ libdali_adaptor_la_CXXFLAGS += $(HAPTIC_CFLAGS)
 libdali_adaptor_la_LIBADD +=
 endif
 
-if TURBO_JPEG_IS_ON
-libdali_adaptor_la_LIBADD += -lturbojpeg
-CFLAGS += -D_TURBO_JPEG_LOADER
 if UBUNTU_PROFILE
 libdali_adaptor_la_LIBADD += -ljpeg
 CFLAGS += -fPIC
 endif
-else
-libdali_adaptor_la_LIBADD += -ljpeg
-endif
 
 tizenadaptorpublicapidir = $(devincludepath)/dali/public-api
 tizenadaptorpublicapi_HEADERS = $(public_api_header_files)
@@ -380,7 +371,7 @@ tizentextabstractiondevelapi_HEADERS = $(text_abstraction_header_files)
 if !UBUNTU_PROFILE
 
 if !WAYLAND
-tizenadaptorframeworkpublicapi_HEADERS += $(public_api_adaptor_tizen_x11_header_files)
+tizenadaptorframeworkdevelapi_HEADERS += $(devel_api_adaptor_tizen_x11_header_files)
 endif # NOT WAYLAND
 
 endif # NOT UBUNTU_PROFILE
index 0e94e91..e5a7caa 100644 (file)
@@ -142,14 +142,6 @@ AC_ARG_ENABLE([gles],
 
 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
 
-AC_ARG_WITH([jpeg-turbo],
-            [AC_HELP_STRING([--with-jpeg-turbo],
-                            [Use the JPEG Turbo library])],
-            [with_jpeg_turbo=$withval],
-            [with_jpeg_turbo=yes])
-
-AM_CONDITIONAL(TURBO_JPEG_IS_ON, test $with_jpeg_turbo = yes)
-
 AC_ARG_WITH([over-tizen_2_2],
             [AC_HELP_STRING([--with-over-tizen_2_2],
                             [Use tizen API over ver. 2.2])],
@@ -186,11 +178,7 @@ AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
 # should not disable features. This allows the developer to override
 # features through the command line.
 
-if test "x$enable_profile" = "xMOBILE"; then
-PKG_CHECK_MODULES(OPENGLES20, gles20)
-else
 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
-fi
 
 if test "x$enable_profile" != "xUBUNTU"; then
 PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application)
@@ -292,7 +280,6 @@ Configuration
   Debug Build:                      $enable_debug
   Compile flags                     $DALI_ADAPTOR_CFLAGS
   Using Assimp Library:             $enable_assimp
-  Using JPEG Turbo Library:         $with_jpeg_turbo
   Freetype bitmap support (Emoji):  $freetype_bitmap_support
   Profile:                          $enable_profile
   Data Dir (Read/Write):            $dataReadWriteDir
index 76885c1..1bae0b5 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.0.45
+Version:    1.0.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 92dbf20..fcbe91f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.0.45
+Version:    1.0.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
@@ -48,7 +48,7 @@ BuildRequires:  libdrm-devel
 BuildRequires:  pkgconfig(libexif)
 BuildRequires:  pkgconfig(capi-system-system-settings)
 BuildRequires:  pkgconfig(libpng)
-BuildRequires:  pkgconfig(gles20)
+BuildRequires:  pkgconfig(glesv2)
 BuildRequires:  pkgconfig(efl-assist)
 BuildRequires:  libcurl-devel
 BuildRequires:  pkgconfig(harfbuzz)
index 0d4649a..e1647dc 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.0.45
+Version:    1.0.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 373a669..503cff1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.0.45
+Version:    1.0.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 8b58180..062b90b 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.0.45
+Version:    1.0.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 0056d8a..a8c36a4 100755 (executable)
@@ -20,19 +20,14 @@ tizen_platform_abstraction_src_files = \
   \
   $(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-ico.cpp \
+  $(tizen_platform_abstraction_src_dir)/image-loaders/loader-jpeg-turbo.cpp \
   $(tizen_platform_abstraction_src_dir)/image-loaders/loader-ktx.cpp \
+  $(tizen_platform_abstraction_src_dir)/image-loaders/loader-png.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 =
index c5f9957..41872aa 100644 (file)
@@ -29,8 +29,6 @@ namespace Integration
 class Bitmap;
 }
 
-struct ImageAttributes;
-
 namespace TizenPlatform
 {
 
index 9b9c330..d2afd3b 100644 (file)
@@ -29,8 +29,6 @@ namespace Integration
   class Bitmap;
 }
 
-struct ImageAttributes;
-
 namespace TizenPlatform
 {
 
index d844e77..7b56737 100644 (file)
@@ -28,7 +28,6 @@ namespace Integration
 {
   class Bitmap;
 }
-struct ImageAttributes;
 
 namespace TizenPlatform
 {
diff --git a/platform-abstractions/tizen/image-loaders/loader-jpeg.cpp b/platform-abstractions/tizen/image-loaders/loader-jpeg.cpp
deleted file mode 100644 (file)
index 357f213..0000000
+++ /dev/null
@@ -1,819 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "loader-jpeg.h"
-
-#include <stdio.h>
-#include <jpeglib.h>
-#include <stdlib.h>
-
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/public-api/math/math-utils.h>
-#include <dali/public-api/math/vector2.h>
-
-#include "platform-capabilities.h"
-#include <cstring>
-#include <libexif/exif-data.h>
-#include <libexif/exif-tag.h>
-
-namespace Dali
-{
-using Integration::Bitmap;
-
-namespace TizenPlatform
-{
-
-namespace
-{
-
-typedef enum {
-  JPGFORM_NONE = 1,  /* no transformation 0th-Row = top & 0th-Column = left */
-  JPGFORM_FLIP_H ,   /* horizontal flip       0th-Row = top & 0th-Column = right */
-  JPGFORM_FLIP_V,    /* vertical flip     0th-Row = bottom & 0th-Column = right*/
-  JPGFORM_TRANSPOSE, /* transpose across UL-to-LR axis   0th-Row = bottom & 0th-Column = left*/
-  JPGFORM_TRANSVERSE,/* transpose across UR-to-LL axis   0th-Row = left      & 0th-Column = top*/
-  JPGFORM_ROT_90 ,   /* 90-degree clockwise rotation  0th-Row = right  & 0th-Column = top*/
-  JPGFORM_ROT_180,   /* 180-degree rotation  0th-Row = right  & 0th-Column = bottom*/
-  JPGFORM_ROT_270    /* 270-degree clockwise (or 90 ccw)  0th-Row = left  & 0th-Column = bottom*/
-} JPGFORM_CODE;
-
-
-typedef struct {
-   char R;
-   char G;
-   char B;
-}RGB888Type;
-typedef struct {
-   char R;
-   char G;
-   char B;
-   char A;
-}RGBA8888Type;
-typedef struct
-{
-  char RG;
-  char GB;
-}RGB565Type;
-typedef struct
-{
-  char gray;
-}L8Type;
-
-// simple class to enforce clean-up of JPEG structures
-struct auto_jpg
-{
-  auto_jpg(struct jpeg_decompress_struct& _cinfo)
-  : cinfo(_cinfo),
-    compression_started(false)
-  {
-  }
-
-  ~auto_jpg()
-  {
-    // clean up JPG resources
-    if( compression_started )
-    {
-      // finish decompression if started
-      jpeg_finish_decompress(&cinfo);
-    }
-
-    jpeg_destroy_decompress (&cinfo);
-  }
-
-  bool start_decompress()
-  {
-    // store flag indicating compression has started
-    compression_started = jpeg_start_decompress(&cinfo);
-    return compression_started;
-  }
-
-  void abort_decompress()
-  {
-    if( compression_started )
-    {
-      // abort decompression if started
-      jpeg_abort_decompress(&cinfo);
-      // clear compression started flag
-      compression_started = false;
-    }
-  }
-
-  struct jpeg_decompress_struct& cinfo;
-  bool compression_started;
-}; // struct auto_jpg;
-
-static void JpegFatalErrorHandler (j_common_ptr cinfo)
-{
-  /* LibJpeg causes an assert if this happens but we do not want that */
-}
-
-static void JpegOutputMessageHandler (j_common_ptr cinfo)
-{
-  /* Stop libjpeg from printing to stderr - Do Nothing */
-}
-
-bool LoadJpegHeader(FILE *fp, unsigned int &width, unsigned int &height, jpeg_decompress_struct &cinfo, jpeg_error_mgr &jerr)
-{
-    cinfo.err = jpeg_std_error(&jerr);
-
-    jerr.output_message = JpegOutputMessageHandler;
-    jerr.error_exit = JpegFatalErrorHandler;
-
-    jpeg_create_decompress(&cinfo);
-
-    jpeg_stdio_src(&cinfo, fp);
-
-    // Check header to see if it is  JPEG file
-    if (jpeg_read_header(&cinfo, TRUE) != JPEG_HEADER_OK)
-    {
-      return false;
-    }
-
-    width = (float)cinfo.image_width;
-    height = (float)cinfo.image_height;
-
-    return true;
-}
-
-// Simple struct to ensure xif data is deleted
-struct ExifAutoPtr
-{
-  ExifAutoPtr( ExifData* data)
-  :mData( data )
-  {}
-
-  ~ExifAutoPtr()
-  {
-    exif_data_free( mData);
-  }
-  ExifData *mData;
-};
-
-
-} // unnamed namespace
-
-bool JpegRotate90(unsigned char *buffer, int width, int height, int bpp);
-bool JpegRotate180(unsigned char *buffer, int width, int height, int bpp);
-bool JpegRotate270(unsigned char *buffer, int width, int height, int bpp);
-bool LoadJpegHeader(FILE *fp, unsigned int &width, unsigned int &height)
-{
-  struct jpeg_decompress_struct cinfo;
-  struct jpeg_error_mgr jerr;
-  auto_jpg autoJpg(cinfo);
-
-  return LoadJpegHeader(fp, width, height, cinfo, jerr);
-}
-
-bool LoadBitmapFromJpeg(FILE *fp, Bitmap& bitmap, ImageAttributes& attributes)
-{
-  JPGFORM_CODE transform = JPGFORM_NONE;
-  struct jpeg_decompress_struct cinfo;
-  struct jpeg_error_mgr jerr;
-  auto_jpg autoJpg(cinfo);
-
-  if( fseek(fp,0,SEEK_END) )
-  {
-    DALI_LOG_ERROR("Error seeking to end of file\n");
-    return false;
-  }
-
-  long positionIndicator = ftell(fp);
-  unsigned int jpegbufsize( 0u );
-  if( positionIndicator > -1L )
-  {
-    jpegbufsize = static_cast<unsigned int>(positionIndicator);
-  }
-
-  if( 0u == jpegbufsize )
-  {
-    return false;
-  }
-
-  if( fseek(fp, 0, SEEK_SET) )
-  {
-    DALI_LOG_ERROR("Error seeking to end of file\n");
-    return false;
-  }
-
-  std::vector<unsigned char> jpegbuf(jpegbufsize);
-  unsigned char *jpegbufPtr = &jpegbuf[0];
-  if(fread(jpegbufPtr, 1, jpegbufsize, fp) != jpegbufsize)
-  {
-    return false;
-  }
-
-  if( fseek(fp, 0, SEEK_SET) )
-  {
-    DALI_LOG_ERROR("Error seeking to end of file\n");
-    return false;
-  }
-
-  ExifAutoPtr exifData( exif_data_new_from_data(jpegbufPtr, jpegbufsize) );
-  ExifEntry *entry;
-  ExifTag tag = EXIF_TAG_ORIENTATION;
-  entry = exif_data_get_entry(exifData.mData, tag);
-  int orientation = 0;
-  if(entry)
-  {
-    orientation = exif_get_short(entry->data, exif_data_get_byte_order(entry->parent->parent));
-    switch(orientation)
-    {
-    case 1:
-      transform = JPGFORM_NONE;
-      break;
-    case 2:
-      transform = JPGFORM_FLIP_H;
-      break;
-    case 3:
-      transform = JPGFORM_FLIP_V;
-      break;
-    case 4:
-      transform = JPGFORM_TRANSPOSE;
-      break;
-    case 5:
-      transform = JPGFORM_TRANSVERSE;
-      break;
-    case 6:
-      transform = JPGFORM_ROT_90;
-      break;
-    case 7:
-      transform = JPGFORM_ROT_180;
-      break;
-    case 8:
-      transform = JPGFORM_ROT_270;
-      break;
-    default:
-      break;
-    }
-  }
-
-  // Load the header info
-  unsigned int width, height;
-  if (!LoadJpegHeader(fp, width, height, cinfo, jerr))
-  {
-      return false;
-  }
-
-  // set scaling if image request is not zero (which means full image)
-  // and requested size is smaller than actual size
-  if( ( attributes.GetWidth() > 0 )&&( attributes.GetHeight() > 0 ) &&
-      ( attributes.GetWidth()  < cinfo.image_width )           &&
-      ( attributes.GetHeight() < cinfo.image_height ))
-  {
-    // jpeg only supports scaling by 1/2, 1/4, 1/8, 1/16
-    // calculate width and height scale between (fitted) request and original
-    Size req = attributes.GetSize();
-    Size orig((float)cinfo.image_width, (float)cinfo.image_height);
-    Size fitted = FitInside(req, orig);
-    int widthScale = cinfo.image_width / fitted.width;
-    int heightScale = cinfo.image_height / fitted.height;
-    // pick the smallest one of those as we want to scale as close as possible
-    int scale = std::min( widthScale, heightScale );
-    // if the scale is not power of two make it
-    if( !IsPowerOfTwo( scale ) )
-    {
-      scale = NextPowerOfTwo( scale );
-    }
-    // finally set the scale 1 / scale
-    cinfo.scale_num = 1;
-    cinfo.scale_denom = scale;
-  }
-
-  Pixel::Format pixelFormat = Pixel::RGBA8888;
-  if (!autoJpg.start_decompress())
-  {
-   // @todo renable this log LOG_WARNING("error during jpeg_start_decompress\n");
-    return false;
-  }
-
-  int bytes_per_pixel   = cinfo.out_color_components;
-
-  // JPEG doesn't support transparency
-  if (bytes_per_pixel == 3)
-  {
-    pixelFormat = Pixel::RGB888;
-  }
-  else if (bytes_per_pixel == 2)
-  {
-    pixelFormat = Pixel::RGB565;
-  }
-  else if (bytes_per_pixel == 1)
-  {
-    pixelFormat = Pixel::L8;
-  }
-  else
-  {
-    DALI_LOG_WARNING ("Unsupported jpeg format\n");
-    autoJpg.abort_decompress();
-    return false;
-  }
-
-  width                      = cinfo.output_width;
-  height                     = cinfo.output_height;
-  unsigned int  bufferWidth  = GetTextureDimension( width );
-  unsigned int  bufferHeight = GetTextureDimension( height );
-  unsigned int  stride       = bufferWidth * bytes_per_pixel;
-
-  unsigned char *pixels      = NULL;
-  unsigned char *lptr        = NULL;
-
-  /// @todo support more scaling types
-  bool fitInside = attributes.GetScalingMode() == Dali::ImageAttributes::ShrinkToFit &&
-                   attributes.GetWidth() != 0 &&
-                   attributes.GetHeight() != 0 &&
-                  (attributes.GetWidth() < cinfo.output_width || attributes.GetHeight() < cinfo.output_height);
-  bool crop = attributes.GetScalingMode() == Dali::ImageAttributes::ScaleToFill;
-
-  if (fitInside || crop)
-  {
-    // create temporary decompression buffer
-    pixels = new unsigned char[stride*bufferHeight];
-    lptr   = pixels;
-  }
-  else
-  {
-    // decode the whole image into bitmap buffer
-    switch(transform)
-    {
-    case JPGFORM_NONE:
-    case JPGFORM_FLIP_H:
-    case JPGFORM_FLIP_V:
-    case JPGFORM_TRANSPOSE:
-    case JPGFORM_TRANSVERSE:
-    case JPGFORM_ROT_180:
-      pixels = bitmap.ReserveBuffer(pixelFormat, width, height, bufferWidth, bufferHeight);
-      break;
-    case JPGFORM_ROT_270:
-    case JPGFORM_ROT_90:
-      pixels = bitmap.ReserveBuffer(pixelFormat, height,width, bufferHeight,bufferWidth);
-    default:
-      break;
-    }
-    lptr   = pixels;
-  }
-
-  // decode jpeg
-  while (cinfo.output_scanline < cinfo.output_height)
-  {
-    lptr = pixels + (stride * cinfo.output_scanline);
-    jpeg_read_scanlines(&cinfo, &lptr, 1);
-  }
-  DALI_ASSERT_DEBUG(pixels);
-
-  switch(transform)
-  {
-  case JPGFORM_NONE:
-  case JPGFORM_FLIP_H:
-  case JPGFORM_FLIP_V:
-  case JPGFORM_TRANSPOSE:
-  case JPGFORM_TRANSVERSE:
-    break;
-  case JPGFORM_ROT_180:
-    JpegRotate180(pixels, bufferWidth, bufferHeight, bytes_per_pixel);
-    break;
-  case JPGFORM_ROT_270:
-    JpegRotate270(pixels, bufferWidth, bufferHeight, bytes_per_pixel);
-    break;
-  case JPGFORM_ROT_90:
-    JpegRotate90(pixels, bufferWidth, bufferHeight, bytes_per_pixel);
-    break;
-  default:
-    break;
-  }
-  // fit image completely inside requested size (maintaining aspect ratio)?
-  if (fitInside)
-  {
-    Size req = attributes.GetSize();
-    Size orig((float)cinfo.output_width, (float)cinfo.output_height);
-    switch(transform)
-    {
-    case JPGFORM_NONE:
-    case JPGFORM_FLIP_H:
-    case JPGFORM_FLIP_V:
-    case JPGFORM_TRANSPOSE:
-    case JPGFORM_TRANSVERSE:
-    case JPGFORM_ROT_180:
-      break;
-    case JPGFORM_ROT_270:
-    case JPGFORM_ROT_90:
-      orig = Vector2 ((float)cinfo.output_height, (float)cinfo.output_width);
-      stride = bufferHeight * bytes_per_pixel;
-      break;
-    default:
-      break;
-    }
-    // calculate actual width, height
-    req = FitInside(req, orig);
-
-    attributes.SetSize((int) req.width, (int) req.height);
-    attributes.SetPixelFormat(pixelFormat);
-
-    bufferWidth  = GetTextureDimension( attributes.GetWidth() );
-    bufferHeight = GetTextureDimension( attributes.GetHeight() );
-
-    // scaled buffer's stride
-    int lstride = bufferWidth*bytes_per_pixel;
-
-    // allocate bitmap buffer using requested size
-    unsigned char *bitmapBuffer = bitmap.ReserveBuffer(pixelFormat, attributes.GetWidth(), attributes.GetHeight(), bufferWidth, bufferHeight);
-
-    // scale original image to fit requested size
-    float xRatio = (float)cinfo.output_width / (float)attributes.GetWidth();
-    float yRatio = (float)cinfo.output_height / (float)attributes.GetHeight();
-    switch(transform)
-    {
-    case JPGFORM_NONE:
-    case JPGFORM_FLIP_H:
-    case JPGFORM_FLIP_V:
-    case JPGFORM_TRANSPOSE:
-    case JPGFORM_TRANSVERSE:
-    case JPGFORM_ROT_180:
-      break;
-    case JPGFORM_ROT_270:
-    case JPGFORM_ROT_90:
-      xRatio = (float)cinfo.output_height / (float)attributes.GetWidth();
-      yRatio = (float)cinfo.output_width / (float)attributes.GetHeight();
-      break;
-    default:
-      break;
-    }
-    // @todo Add a quality setting to ImageAttributes and use suitable shrink algorithm
-    unsigned char *bufptr = bitmapBuffer;
-    for (unsigned int y = 0; y < attributes.GetHeight(); ++y)
-    {
-      unsigned char* dest = bufptr;
-      lptr = pixels + (stride * (unsigned int)(floorf(yRatio * y)));
-      for (unsigned int x = 0; x < attributes.GetWidth(); ++x)
-      {
-        unsigned char* src = lptr + (unsigned int)(floorf(xRatio * x)) * bytes_per_pixel;
-        *dest++ = *src++;
-        if (bytes_per_pixel >= 2)
-        {
-          *dest++ = *src++;
-          if (bytes_per_pixel >= 3)
-          {
-            *dest++ = *src++;
-          }
-        }
-      }
-      bufptr += lstride;
-    }
-
-    delete[] pixels;
-  }
-  // copy part of the buffer to bitmap?
-  else if (crop)
-  {
-    Size req = attributes.GetSize();
-    const Size orig ((float)cinfo.output_width, (float)cinfo.output_height);
-
-    // calculate actual width, height
-    req = FitScaleToFill(req, orig);
-
-    // modify attributes with result
-    attributes.SetSize((int) req.width, (int) req.height);
-    attributes.SetPixelFormat(pixelFormat);
-
-    bufferWidth  = GetTextureDimension( attributes.GetWidth() );
-    bufferHeight = GetTextureDimension( attributes.GetHeight() );
-
-    // cropped buffer's stride
-    int lstride = bufferWidth*bytes_per_pixel;
-
-    // calculate offsets
-    int x_offset = ((cinfo.output_width  - attributes.GetWidth())  / 2) * bytes_per_pixel;
-    int y_offset = ((cinfo.output_height - attributes.GetHeight()) / 2) * stride;
-
-    // allocate bitmap buffer using requested size
-    unsigned char *bitmapBuffer = bitmap.ReserveBuffer(pixelFormat, attributes.GetWidth(), attributes.GetHeight(), bufferWidth, bufferHeight);
-
-    // crop center of original image to fit requested size
-    unsigned char *bufptr = bitmapBuffer;
-    lptr = pixels+y_offset+x_offset;
-    for (unsigned int i = 0; i < attributes.GetHeight(); ++i)
-    {
-      memcpy (bufptr, lptr, attributes.GetWidth()*bytes_per_pixel);
-      bufptr += lstride;
-      lptr += stride;
-    }
-
-    delete[] pixels;
-  }
-  else
-  {
-    // set the attributes
-    switch(transform)
-    {
-    case JPGFORM_NONE:
-    case JPGFORM_FLIP_H:
-    case JPGFORM_FLIP_V:
-    case JPGFORM_TRANSPOSE:
-    case JPGFORM_TRANSVERSE:
-    case JPGFORM_ROT_180:
-      attributes.SetSize(width, height);
-      break;
-    case JPGFORM_ROT_270:
-    case JPGFORM_ROT_90:
-      attributes.SetSize(height, width);
-      break;
-    default:
-      break;
-    }
-
-    attributes.SetPixelFormat(pixelFormat);
-  }
-
-  return true;
-}
-
-bool JpegRotate180(unsigned char *buffer, int width, int height, int bpp)
-{
-  int  ix, iw, ih, hw = 0;
-  iw = width;
-  ih = height;
-  hw = iw * ih;
-  ix = hw;
-
-  switch(bpp)
-  {
-  case 4:
-  {
-    RGBA8888Type *from, *to;
-    RGBA8888Type tmp;
-    from = ((RGBA8888Type * )buffer) + hw - 1;
-    to = (RGBA8888Type *)buffer;
-    for(; --ix >= (hw / 2); )
-    {
-      tmp = *to;
-      *to = *from;
-      *from = tmp;
-      to ++;
-      from --;
-    }
-    break;
-  }
-  case 3:
-  {
-    RGB888Type *from, *to;
-    RGB888Type tmp;
-    from = ((RGB888Type * )buffer) + hw - 1;
-    to = (RGB888Type *)buffer;
-    for(; --ix >= (hw / 2); )
-    {
-      tmp = *to;
-      *to = *from;
-      *from = tmp;
-      to ++;
-      from --;
-    }
-    break;
-  }
-  case 2:
-  {
-    RGB565Type *from, *to;
-    RGB565Type tmp;
-    from = ((RGB565Type * )buffer) + hw - 1;
-    to = (RGB565Type *)buffer;
-    for(; --ix >= (hw / 2); )
-    {
-      tmp = *to;
-      *to = *from;
-      *from = tmp;
-      to ++;
-      from --;
-    }
-    break;
-  }
-  case 1:
-  {
-    L8Type *from, *to;
-    L8Type tmp;
-    from = ((L8Type * )buffer) + hw - 1;
-    to = (L8Type *)buffer;
-    for(; --ix >= (hw / 2); )
-    {
-      tmp = *to;
-      *to = *from;
-      *from = tmp;
-      to ++;
-      from --;
-    }
-    break;
-  }
-  default:
-    break;
-  }
-
-  return true;
-}
-
-bool JpegRotate270(unsigned char *buffer, int width, int height, int bpp)
-{
-  int  w, iw, ih, hw = 0;
-  int ix, iy = 0;
-
-  iw = width;
-  ih = height;
-  std::vector<unsigned char> data(width * height * bpp);
-  unsigned char *dataPtr = &data[0];
-  memcpy(dataPtr, buffer, width * height * bpp);
-  w = ih;
-  ih = iw;
-  iw = w;
-  hw = iw * ih;
-
-  switch(bpp)
-  {
-  case 4:
-  {
-    RGBA8888Type *from, *to;
-    to = ((RGBA8888Type * )buffer) + hw  - iw;
-    w = -w;
-    hw =  hw + 1;
-    from = (RGBA8888Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += w;
-      }
-      to += hw;
-    }
-    break;
-  }
-  case 3:
-  {
-    RGB888Type *from, *to;
-    to = ((RGB888Type * )buffer) + hw  - iw;
-    w = -w;
-    hw =  hw + 1;
-    from = (RGB888Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += w;
-      }
-      to += hw;
-    }
-    break;
-  }
-  case 2:
-  {
-    RGB565Type *from, *to;
-    to = ((RGB565Type * )buffer) + hw  - iw;
-    w = -w;
-    hw =  hw + 1;
-    from = (RGB565Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += w;
-      }
-      to += hw;
-    }
-    break;
-  }
-  case 1:
-  {
-    L8Type *from, *to;
-    to = ((L8Type * )buffer) + hw  - iw;
-    w = -w;
-    hw =  hw + 1;
-    from = (L8Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += w;
-      }
-      to += hw;
-    }
-    break;
-  }
-  default:
-    break;
-  }
-
-  return true;
-}
-
-bool JpegRotate90(unsigned char *buffer, int width, int height, int bpp)
-{
-  int  w, iw, ih, hw = 0;
-  int ix, iy = 0;
-  iw = width;
-  ih = height;
-  std::vector<unsigned char> data(width * height * bpp);
-  unsigned char *dataPtr = &data[0];
-  memcpy(dataPtr, buffer, width * height * bpp);
-  w = ih;
-  ih = iw;
-  iw = w;
-  hw = iw * ih;
-  hw = - hw - 1;
-  switch(bpp)
-  {
-  case 4:
-  {
-    RGBA8888Type *from, *to;
-    to = ((RGBA8888Type * )buffer) + iw  - 1;
-    from = (RGBA8888Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += iw;
-      }
-      to += hw;
-    }
-    break;
-  }
-  case 3:
-  {
-    RGB888Type *from, *to;
-    to = ((RGB888Type * )buffer) + iw  - 1;
-    from = (RGB888Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += iw;
-      }
-      to += hw;
-    }
-    break;
-  }
-  case 2:
-  {
-    RGB565Type *from, *to;
-    to = ((RGB565Type * )buffer) + iw  - 1;
-    from = (RGB565Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += iw;
-      }
-      to += hw;
-    }
-    break;
-  }
-  case 1:
-  {
-    L8Type *from, *to;
-    to = ((L8Type * )buffer) + iw  - 1;
-    from = (L8Type *)dataPtr;
-    for(ix = iw; -- ix >= 0;)
-    {
-      for(iy = ih; -- iy >= 0;)
-      {
-        *to = *from;
-        from += 1;
-        to += iw;
-      }
-      to += hw;
-    }
-    break;
-  }
-  default:
-    break;
-  }
-
-  return true;
-}
-
-} // namespace TizenPlatform
-
-} // namespace Dali
-
index 4c6d783..c233fd5 100644 (file)
@@ -32,8 +32,6 @@ namespace Integration
   class Bitmap;
 }
 
-struct ImageAttributes;
-
 namespace TizenPlatform
 {
 
index e69d13c..c521ad2 100644 (file)
@@ -29,8 +29,6 @@ namespace Integration
   class Bitmap;
 }
 
-struct ImageAttributes;
-
 namespace TizenPlatform
 {
 
index 77b9422..484226b 100644 (file)
@@ -31,7 +31,6 @@ namespace Integration
 {
   class Bitmap;
 }
-struct ImageAttributes;
 
 namespace TizenPlatform
 {
index 6298cfc..30c94a5 100755 (executable)
@@ -28,7 +28,6 @@ namespace Integration
 {
   class Bitmap;
 }
-struct ImageAttributes;
 
 namespace TizenPlatform
 {