Removed Image (and derived classes) Usage 72/235572/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 5 Jun 2020 14:08:07 +0000 (15:08 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 5 Jun 2020 17:25:49 +0000 (18:25 +0100)
Change-Id: Ib306cb9bbd910f946e7f9faee06072a6d15f314a

builder/dali-builder.cpp
examples/builder/examples.cpp
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
examples/text-memory-profiling/text-memory-profiling-example.cpp

index 433112d..b0e3248 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -240,7 +240,7 @@ private:
 
         RenderTask defaultTask = taskList.GetTask(0);
         defaultTask.SetSourceActor( stage.GetRootLayer() );
-        defaultTask.SetTargetFrameBuffer( FrameBufferImage() );
+        defaultTask.SetFrameBuffer( FrameBuffer() );
       }
     }
 
index e0ebc07..6aae5ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -411,7 +411,7 @@ public:
 
       RenderTask defaultTask = taskList.GetTask(0);
       defaultTask.SetSourceActor( stage.GetRootLayer() );
-      defaultTask.SetTargetFrameBuffer( FrameBufferImage() );
+      defaultTask.SetFrameBuffer( FrameBuffer() );
     }
 
     unsigned int numChildren = layer.GetChildCount();
index 7c7a0f0..bd02a6e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -194,26 +194,6 @@ public:
     background.SetProperty( Actor::Property::SIZE, stage.GetSize() );
     stage.Add( background );
 
-    BufferImage heightBackground = BufferImage::WHITE();
-    PixelBuffer* const heightPixel = heightBackground.GetBuffer();
-    heightPixel[0] = 0x8f;
-    heightPixel[1] = 0x8f;
-    heightPixel[2] = 0x8f;
-
-    BufferImage widthBackground = BufferImage::WHITE();
-    PixelBuffer* const widthPixel = widthBackground.GetBuffer();
-    widthPixel[0] = 0x4f;
-    widthPixel[1] = 0x4f;
-    widthPixel[2] = 0x4f;
-
-    mHeightBox = Toolkit::ImageView::New( heightBackground );
-    mHeightBox.SetProperty( DevelActor::Property::OPACITY, 0.2f );
-    background.Add( mHeightBox );
-
-    mWidthBox = Toolkit::ImageView::New( widthBackground );
-    mWidthBox.SetProperty( DevelActor::Property::OPACITY, 0.2f );
-    background.Add( mWidthBox );
-
     mDesiredBox = Toolkit::ImageView::New( BORDER_IMAGE );
     background.Add( mDesiredBox );
 
@@ -221,14 +201,6 @@ public:
     mDesiredBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     mDesiredBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
 
-    mHeightBox.SetProperty( Actor::Property::SIZE, Vector2( stage.GetSize().width,  (stage.GetSize() * mImageStageScale).height ) );
-    mHeightBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
-    mHeightBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
-
-    mWidthBox.SetProperty( Actor::Property::SIZE, Vector2( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ) );
-    mWidthBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
-    mWidthBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
-
     // Initialize the actor
     mImageView = Toolkit::ImageView::New( IMAGE_PATHS[ 0 ] );
 
@@ -697,16 +669,11 @@ private:
     // Border size needs to be modified to take into account the width of the frame.
     Vector2 borderScale( ( imageSize + Vector2( BORDER_WIDTH * 2.0f, BORDER_WIDTH * 2.0f ) ) / stage.GetSize() );
     mDesiredBox.SetProperty( Actor::Property::SIZE, stage.GetSize() * borderScale );
-
-    mHeightBox.SetProperty( Actor::Property::SIZE, Vector2( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ) );
-    mWidthBox.SetProperty( Actor::Property::SIZE, Vector2( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ) );
   }
 
 private:
   Application&  mApplication;
   Toolkit::ImageView mDesiredBox; //< Background rectangle to show requested image size.
-  Toolkit::ImageView mHeightBox;  //< Background horizontal stripe to show requested image height.
-  Toolkit::ImageView mWidthBox;   //< Background vertical stripe to show requested image width.
   Toolkit::PushButton mFittingModeButton;
   Toolkit::PushButton mSamplingModeButton;
   Toolkit::Popup mPopup;
index 176ebed..453e579 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -247,29 +247,6 @@ public:
   {
     Stage stage = Stage::GetCurrent();
 
-    // Render tasks may have been setup last load so remove them
-    RenderTaskList taskList = stage.GetRenderTaskList();
-    if( taskList.GetTaskCount() > 1 )
-    {
-      typedef std::vector<RenderTask> Collection;
-      typedef Collection::iterator ColIter;
-      Collection tasks;
-
-      for( unsigned int i = 1; i < taskList.GetTaskCount(); ++i )
-      {
-        tasks.push_back( taskList.GetTask(i) );
-      }
-
-      for( ColIter iter = tasks.begin(); iter != tasks.end(); ++iter )
-      {
-        taskList.RemoveTask(*iter);
-      }
-
-      RenderTask defaultTask = taskList.GetTask( 0 );
-      defaultTask.SetSourceActor( stage.GetRootLayer() );
-      defaultTask.SetTargetFrameBuffer( FrameBufferImage() );
-    }
-
     // Delete any existing text labels
     unsigned int numChildren = mLayer.GetChildCount();