Merge "[AT-SPI] Remove GetBoundAccessibilityObject" into devel/master
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 24 Jan 2022 05:37:44 +0000 (05:37 +0000)
committerGerrit Code Review <gerrit@review>
Mon, 24 Jan 2022 05:37:44 +0000 (05:37 +0000)
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/visuals/text/text-visual.cpp

index 440270a..2862284 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -82,8 +82,9 @@ void TestApplication::CreateScene()
   // Create render target for the scene
   Graphics::RenderTargetCreateInfo rtInfo{};
   rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight});
-  mRenderTarget = mGraphicsController.CreateRenderTarget(rtInfo, nullptr);
-  mScene.SetSurfaceRenderTarget(mRenderTarget.get());
+  rtInfo.SetSurface(&mSurfaceWidth); // Can point to anything, really.
+
+  mScene.SetSurfaceRenderTarget(rtInfo);
 }
 
 void TestApplication::InitializeCore()
index fb2afda..3ed6b56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -1028,9 +1028,11 @@ void TestGraphicsController::BindPipeline(TestGraphicsPipeline* pipeline)
  */
 void TestGraphicsController::PresentRenderTarget(Graphics::RenderTarget* renderTarget)
 {
+  auto*                       rt = static_cast<const TestGraphicsRenderTarget*>(renderTarget);
   TraceCallStack::NamedParams namedParams;
   namedParams["renderTarget"] << std::hex << renderTarget;
-  mCallStack.PushCall("PresentRenderTarget", "", namedParams);
+  namedParams["surface"] << std::hex << rt->mCreateInfo.surface;
+  mCallStack.PushCall("PresentRenderTarget", namedParams.str(), namedParams);
 }
 
 /**
@@ -1237,7 +1239,10 @@ Graphics::UniquePtr<Graphics::Sampler> TestGraphicsController::CreateSampler(con
 
 Graphics::UniquePtr<Graphics::RenderTarget> TestGraphicsController::CreateRenderTarget(const Graphics::RenderTargetCreateInfo& renderTargetCreateInfo, Graphics::UniquePtr<Graphics::RenderTarget>&& oldRenderTarget)
 {
-  mCallStack.PushCall("CreateRenderTarget", "");
+  TraceCallStack::NamedParams namedParams;
+  namedParams["surface"] << std::hex << renderTargetCreateInfo.surface;
+  mCallStack.PushCall("CreateRenderTarget", namedParams.str(), namedParams);
+
   return Graphics::MakeUnique<TestGraphicsRenderTarget>(mGl, renderTargetCreateInfo);
 }
 
index 7631630..6f720c5 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_TRACE_CALL_STACK_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -121,6 +121,25 @@ public:
       }
     }
 
+    const std::ostringstream& operator[](std::string name) const
+    {
+      static std::ostringstream empty;
+      auto                      iter = mParams.begin();
+      for(; iter != mParams.end(); ++iter)
+      {
+        if(!iter->parameterName.compare(name))
+        {
+          break;
+        }
+      }
+
+      if(iter != mParams.end())
+      {
+        return iter->value;
+      }
+      return empty;
+    }
+
     std::string str() const
     {
       std::ostringstream out;
index cccb922..07b1013 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
 
 // INTERNAL INCLUDES
 #include <dali-test-suite-utils.h>
-#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
 #include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
 #include <toolkit-adaptor-impl.h>
 #include <toolkit-lifecycle-controller.h>
 
 namespace Dali
 {
-
 using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
 
-ToolkitTestApplication::ToolkitTestApplication( size_t surfaceWidth, size_t surfaceHeight, float  horizontalDpi, float verticalDpi )
-: TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi, false /* Do not Initialize Core */ ),
-  mMainWindow( new Dali::Window ),
-  mAdaptor( &AdaptorImpl::New() ) // Need to create Adaptor first as many singletons in dali-adaptor need it
+ToolkitTestApplication::ToolkitTestApplication(size_t surfaceWidth, size_t surfaceHeight, float horizontalDpi, float verticalDpi)
+: TestApplication(surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi, false /* Do not Initialize Core */),
+  mMainWindow(new Dali::Window),
+  mAdaptor(&AdaptorImpl::New()) // Need to create Adaptor first as many singletons in dali-adaptor need it
 {
   // Create Core next
   CreateCore();
 
   // Override Scene creation in TestApplication by creating a window.
   // The window will create a Scene & surface and set up the scene's surface appropriately.
-  *mMainWindow = Window::New( PositionSize( 0, 0, surfaceWidth, surfaceHeight ), "" );
-  mScene = AdaptorImpl::GetScene( *mMainWindow );
-  mScene.SetDpi( Vector2( horizontalDpi, verticalDpi ) );
+  *mMainWindow = Window::New(PositionSize(0, 0, surfaceWidth, surfaceHeight), "");
+  mScene       = AdaptorImpl::GetScene(*mMainWindow);
+  mScene.SetDpi(Vector2(horizontalDpi, verticalDpi));
 
   // Create render target for the scene
   Graphics::RenderTargetCreateInfo rtInfo{};
-  rtInfo.SetExtent( {mSurfaceWidth, mSurfaceHeight });
-  mRenderTarget = mGraphicsController.CreateRenderTarget( rtInfo, nullptr );
-  mScene.SetSurfaceRenderTarget( mRenderTarget.get() );
+  rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight});
+  mScene.SetSurfaceRenderTarget(rtInfo);
 
   // Core needs to be initialized next before we start the adaptor
   InitializeCore();
   Accessibility::Accessible::SetObjectRegistry(mCore->GetObjectRegistry());
 
   // This will also emit the window created signals
-  AdaptorImpl::GetImpl( *mAdaptor ).Start( *mMainWindow );
-  AdaptorImpl::GetImpl( *mAdaptor ).SetApplication( *this );
+  AdaptorImpl::GetImpl(*mAdaptor).Start(*mMainWindow);
+  AdaptorImpl::GetImpl(*mAdaptor).SetApplication(*this);
 
   Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
   lifecycleController.InitSignal().Emit();
 
   // set the DPI value for font rendering
   TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
-  if( fontClient )
+  if(fontClient)
   {
-    fontClient.SetDpi( mDpi.x, mDpi.y );
+    fontClient.SetDpi(mDpi.x, mDpi.y);
   }
 }
 
@@ -80,7 +78,7 @@ ToolkitTestApplication::~ToolkitTestApplication()
 
 void ToolkitTestApplication::RunIdles()
 {
-  AdaptorImpl::GetImpl( *mAdaptor.get() ).RunIdles();
+  AdaptorImpl::GetImpl(*mAdaptor.get()).RunIdles();
 }
 
 } // namespace Dali
index 12faee1..a646e92 100644 (file)
@@ -351,6 +351,7 @@ struct Controller::Impl
     mShadowSetByString(false),
     mOutlineSetByString(false),
     mFontStyleSetByString(false),
+    mStrikethroughSetByString(false),
     mShouldClearFocusOnEscape(true),
     mLayoutDirection(LayoutDirection::LEFT_TO_RIGHT),
     mTextFitMinSize(DEFAULT_TEXTFIT_MIN),
index 7720aa2..b8d848d 100644 (file)
@@ -614,7 +614,7 @@ void TextVisual::CreateTextureSet(TilingInfo& info, Renderer& renderer, Sampler&
     ++textureSetIndex;
   }
 
-  if(styleEnabled && isOverlayStyle)
+  if(styleEnabled && isOverlayStyle && info.styleBuffer)
   {
     PixelData overlayStyleData = ConvertToPixelData(info.styleBuffer, info.width, info.height, info.offsetPosition, Pixel::RGBA8888);
     AddTexture(textureSet, overlayStyleData, sampler, textureSetIndex);