From 8e34d61d2a3466c3a306a5d07ccbcc292256d897 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 18 May 2023 17:30:03 +0900 Subject: [PATCH] Remove forceProcess and forceUpdate flag We don't need them now because we change to process events regardless of state Change-Id: I0416a79c4fdbb8aa12b2be5cabeb3da525216a6c --- .../test-render-controller.cpp | 6 +++--- .../dali-test-suite-utils/test-render-controller.h | 6 +++--- dali/integration-api/render-controller.h | 6 +++--- dali/internal/common/core-impl.cpp | 23 ++++------------------ dali/internal/common/core-impl.h | 13 +----------- dali/internal/event/common/event-thread-services.h | 12 ----------- .../event/events/gesture-event-processor.cpp | 2 +- dali/internal/event/rendering/texture-impl.cpp | 8 -------- .../size-negotiation/relayout-controller-impl.cpp | 2 +- .../internal/update/queue/update-message-queue.cpp | 2 +- 10 files changed, 17 insertions(+), 63 deletions(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.cpp index 1b90e0c..ae9dd7b 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -28,12 +28,12 @@ TestRenderController::~TestRenderController() { } -void TestRenderController::RequestUpdate(bool forceUpdate) +void TestRenderController::RequestUpdate() { mRequestUpdateCalled = true; } -void TestRenderController::RequestProcessEventsOnIdle(bool forceProcess) +void TestRenderController::RequestProcessEventsOnIdle() { mRequestProcessEventsOnIdleCalled = true; } diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.h b/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.h index f7cafa4..2774df3 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-render-controller.h @@ -2,7 +2,7 @@ #define TEST_RENDER_CONTROLLER_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -30,8 +30,8 @@ public: TestRenderController(); ~TestRenderController() override; - void RequestUpdate(bool forceUpdate) override; - void RequestProcessEventsOnIdle(bool forceProcess) override; + void RequestUpdate() override; + void RequestProcessEventsOnIdle() override; typedef enum { diff --git a/dali/integration-api/render-controller.h b/dali/integration-api/render-controller.h index f337dd6..ccb5dd6 100644 --- a/dali/integration-api/render-controller.h +++ b/dali/integration-api/render-controller.h @@ -2,7 +2,7 @@ #define DALI_INTEGRATION_RENDER_CONTROLLER_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -41,14 +41,14 @@ public: * Multi-threading note: this method will be called from the main thread only. * @param[in] forceUpdate true to update forcely. */ - virtual void RequestUpdate(bool forceUpdate) = 0; + virtual void RequestUpdate() = 0; /** * Requests a future call to Dali::Integration::Core::ProcessEvents(), when the application is idle. * Multi-threading note: this method will be called from the main thread only. * @param[in] forceProcess true to process events forcely. */ - virtual void RequestProcessEventsOnIdle(bool forceProcess) = 0; + virtual void RequestProcessEventsOnIdle() = 0; }; } // namespace Integration diff --git a/dali/internal/common/core-impl.cpp b/dali/internal/common/core-impl.cpp index 44f193b..34836e5 100644 --- a/dali/internal/common/core-impl.cpp +++ b/dali/internal/common/core-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -89,7 +89,6 @@ Core::Core(RenderController& renderController, mPlatform(platform), mGraphicsController(graphicsController), mProcessingEvent(false), - mForceNextUpdate(false), mProcessorUnregistered(false), mPostProcessorUnregistered(false) { @@ -265,7 +264,7 @@ void Core::ProcessEvents() if(mProcessingEvent) { DALI_LOG_ERROR("ProcessEvents should not be called from within ProcessEvents!\n"); - mRenderController.RequestProcessEventsOnIdle(false); + mRenderController.RequestProcessEventsOnIdle(); return; } @@ -313,13 +312,11 @@ void Core::ProcessEvents() // Check if the touch or gestures require updates. const bool gestureNeedsUpdate = mGestureEventProcessor->NeedsUpdate(); - // Check if the next update is forced. - const bool forceUpdate = IsNextUpdateForced(); - if(messagesToProcess || gestureNeedsUpdate || forceUpdate) + if(messagesToProcess || gestureNeedsUpdate) { // tell the render controller to keep update thread running - mRenderController.RequestUpdate(forceUpdate); + mRenderController.RequestUpdate(); } mRelayoutController->SetProcessingCoreEvents(false); @@ -592,18 +589,6 @@ BufferIndex Core::GetEventBufferIndex() const return mUpdateManager->GetEventBufferIndex(); } -void Core::ForceNextUpdate() -{ - mForceNextUpdate = true; -} - -bool Core::IsNextUpdateForced() -{ - bool nextUpdateForced = mForceNextUpdate; - mForceNextUpdate = false; - return nextUpdateForced; -} - } // namespace Internal } // namespace Dali diff --git a/dali/internal/common/core-impl.h b/dali/internal/common/core-impl.h index ba7b74b..3aea733 100644 --- a/dali/internal/common/core-impl.h +++ b/dali/internal/common/core-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_CORE_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -233,16 +233,6 @@ public: // Implementation of EventThreadServices */ BufferIndex GetEventBufferIndex() const override; - /** - * @copydoc EventThreadServices::ForceNextUpdate - */ - void ForceNextUpdate() override; - - /** - * @copydoc EventThreadServices::IsNextUpdateForced - */ - bool IsNextUpdateForced() override; - private: /** * Run each registered processor @@ -362,7 +352,6 @@ private: Graphics::Controller& mGraphicsController; bool mProcessingEvent : 1; ///< True during ProcessEvents() - bool mForceNextUpdate : 1; ///< True if the next rendering is really required. bool mProcessorUnregistered : 1; ///< True if the processor is unregistered during RunProcessors() bool mPostProcessorUnregistered : 1; ///< True if the post-processor is unregistered during RunPostProcessors() diff --git a/dali/internal/event/common/event-thread-services.h b/dali/internal/event/common/event-thread-services.h index f2c6ae7..758e940 100644 --- a/dali/internal/event/common/event-thread-services.h +++ b/dali/internal/event/common/event-thread-services.h @@ -103,18 +103,6 @@ public: virtual BufferIndex GetEventBufferIndex() const = 0; /** - * @brief Indicate that the next rendering is really required. - */ - virtual void ForceNextUpdate() = 0; - - /** - * @brief Check if the next rendering is really required. - * - * @return true if the next rendering is really required. - */ - virtual bool IsNextUpdateForced() = 0; - - /** * @return true if core is still running and we can send messages * @note It returns false if it is called from a thread other than the main thread. */ diff --git a/dali/internal/event/events/gesture-event-processor.cpp b/dali/internal/event/events/gesture-event-processor.cpp index 260170f..2ca9caf 100644 --- a/dali/internal/event/events/gesture-event-processor.cpp +++ b/dali/internal/event/events/gesture-event-processor.cpp @@ -187,7 +187,7 @@ void GestureEventProcessor::SetGestureProperties(const Dali::Gesture& gesture) if(mPanGestureProcessor.SetPanGestureProperties(pan)) { // We may not be updating so we need to ask the render controller for an update. - mRenderController.RequestUpdate(false); + mRenderController.RequestUpdate(); } } diff --git a/dali/internal/event/rendering/texture-impl.cpp b/dali/internal/event/rendering/texture-impl.cpp index 3a0fd17..c8a69b2 100644 --- a/dali/internal/event/rendering/texture-impl.cpp +++ b/dali/internal/event/rendering/texture-impl.cpp @@ -40,10 +40,6 @@ TexturePtr Texture::New(NativeImageInterface& nativeImageInterface) { TexturePtr texture(new Texture(&nativeImageInterface)); texture->Initialize(); - - // Request event processing and update forcely. - texture->mEventThreadServices.GetRenderController().RequestProcessEventsOnIdle(true); - texture->mEventThreadServices.ForceNextUpdate(); return texture; } @@ -201,10 +197,6 @@ bool Texture::UploadSubPixelData(PixelDataPtr pixelData, static_cast(height)}; UploadTextureMessage(mEventThreadServices.GetUpdateManager(), mTextureKey, pixelData, params); - // Request event processing and update forcely - mEventThreadServices.GetRenderController().RequestProcessEventsOnIdle(true); - mEventThreadServices.ForceNextUpdate(); - result = true; } } diff --git a/dali/internal/event/size-negotiation/relayout-controller-impl.cpp b/dali/internal/event/size-negotiation/relayout-controller-impl.cpp index 2d639f5..4f333de 100644 --- a/dali/internal/event/size-negotiation/relayout-controller-impl.cpp +++ b/dali/internal/event/size-negotiation/relayout-controller-impl.cpp @@ -203,7 +203,7 @@ void RelayoutController::RequestRelayout(Dali::Actor& actor, Dimension::Type dim if(!mProcessingCoreEvents) { - mRenderController.RequestProcessEventsOnIdle(false); + mRenderController.RequestProcessEventsOnIdle(); } } diff --git a/dali/internal/update/queue/update-message-queue.cpp b/dali/internal/update/queue/update-message-queue.cpp index 6f24a68..b814715 100644 --- a/dali/internal/update/queue/update-message-queue.cpp +++ b/dali/internal/update/queue/update-message-queue.cpp @@ -189,7 +189,7 @@ uint32_t* MessageQueue::ReserveMessageSlot(uint32_t requestedSize, bool updateSc // If we are outside, then we have to request a call to Core::ProcessEvents() on idle. if(false == mImpl->processingEvents) { - mImpl->renderController.RequestProcessEventsOnIdle(false); + mImpl->renderController.RequestProcessEventsOnIdle(); } return mImpl->currentMessageBuffer->ReserveMessageSlot(requestedSize); -- 2.7.4