From: joogab yun Date: Mon, 22 Jun 2020 10:55:48 +0000 (+0000) Subject: Merge "The advance of the letters is too narrow. So, remove the floor." into devel... X-Git-Tag: dali_1.9.18~6 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=fc7f0b361ec4c41e38ce5197dc5685c44fde80a6;hp=81691c01db9669685179b799bd88b9178d56e2c5 Merge "The advance of the letters is too narrow. So, remove the floor." into devel/master --- diff --git a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt index e0b5869..4513301 100755 --- a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt @@ -27,6 +27,7 @@ SET(TC_SOURCES utc-Dali-Text-Typesetter.cpp utc-Dali-Text-ViewModel.cpp utc-Dali-TextField-internal.cpp + utc-Dali-TextSelectionPopup-internal.cpp utc-Dali-TextureManager.cpp utc-Dali-Visuals-internal.cpp utc-Dali-VisualModel.cpp diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextSelectionPopup-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextSelectionPopup-internal.cpp new file mode 100644 index 0000000..13c7ca8 --- /dev/null +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextSelectionPopup-internal.cpp @@ -0,0 +1,51 @@ +/* + * 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 +#include +#include + +// THIS IS THE HEADER WE ARE TESTING +#define private public // To access private members of class, just in the internal test cases +#include +#undef private + +using namespace Dali; +using namespace Toolkit; + +void dali_textselectionpopupinternal_startup(void) +{ + test_return_value = TET_UNDEF; +} + +void dali_textselectionpopupinternal_cleanup(void) +{ + test_return_value = TET_PASS; +} + +int UtcDaliToolkitTextSelectionPopupIconPropertiesN(void) +{ + ToolkitTestApplication application; + TextSelectionPopup popup = TextSelectionPopup::New(nullptr); + + Toolkit::Internal::TextSelectionPopup& popupImpl = GetImpl(popup); + DALI_TEST_EQUALS(std::string(), popupImpl.GetButtonImage(Toolkit::TextSelectionPopup::NONE), TEST_LOCATION); + DALI_TEST_EQUALS(std::string(), popupImpl.GetButtonImage(Toolkit::TextSelectionPopup::Buttons(-1)), TEST_LOCATION); + + END_TEST; +} + diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp index e8c0d12..b2a3fb9 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp @@ -26,13 +26,15 @@ TestApplication::TestApplication( uint32_t surfaceWidth, uint32_t surfaceHeight, uint32_t horizontalDpi, uint32_t verticalDpi, - bool initialize ) + bool initialize, + bool enablePartialUpdate ) : mCore( NULL ), mSurfaceWidth( surfaceWidth ), mSurfaceHeight( surfaceHeight ), mFrame( 0u ), mDpi{ horizontalDpi, verticalDpi }, - mLastVSyncTime(0u) + mLastVSyncTime(0u), + mPartialUpdateEnabled(enablePartialUpdate) { if( initialize ) { @@ -59,7 +61,8 @@ void TestApplication::CreateCore() mGlContextHelperAbstraction, Integration::RenderToFrameBuffer::FALSE, Integration::DepthBufferAvailable::TRUE, - Integration::StencilBufferAvailable::TRUE ); + Integration::StencilBufferAvailable::TRUE, + mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE ); mCore->ContextCreated(); @@ -193,8 +196,8 @@ bool TestApplication::Render( uint32_t intervalMilliseconds, const char* locatio mRenderStatus.SetNeedsPostRender( false ); mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ ); - mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/); - mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/); + mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ ); + mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ ); mCore->PostRender( false /*do not skip rendering*/ ); mFrame++; @@ -202,6 +205,27 @@ bool TestApplication::Render( uint32_t intervalMilliseconds, const char* locatio return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate(); } +bool TestApplication::PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector>& damagedRects) +{ + DoUpdate(intervalMilliseconds, location); + + mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ ); + mCore->PreRender(mScene, damagedRects); + + return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate(); +} + +bool TestApplication::RenderWithPartialUpdate(std::vector>& damagedRects, Rect& clippingRect) +{ + mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/, clippingRect); + mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect); + mCore->PostRender(false /*do not skip rendering*/); + + mFrame++; + + return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate(); +} + uint32_t TestApplication::GetUpdateStatus() { return mStatus.KeepUpdating(); @@ -227,8 +251,8 @@ bool TestApplication::RenderOnly( ) { // Update Time values mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ ); - mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/); - mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/); + mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ ); + mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ ); mCore->PostRender( false /*do not skip rendering*/ ); mFrame++; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h index e96f759..1df0743 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h @@ -51,7 +51,8 @@ public: uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT, uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI, uint32_t verticalDpi = DEFAULT_VERTICAL_DPI, - bool initialize = true ); + bool initialize = true, + bool enablePartialUpdate = false ); void Initialize(); void CreateCore(); @@ -69,6 +70,8 @@ public: void ProcessEvent(const Integration::Event& event); void SendNotification(); bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL ); + bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector>& damagedRects); + bool RenderWithPartialUpdate(std::vector>& damagedRects, Rect& clippingRect); uint32_t GetUpdateStatus(); bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL ); bool RenderOnly( ); @@ -108,6 +111,7 @@ protected: struct { uint32_t x; uint32_t y; } mDpi; uint32_t mLastVSyncTime; + bool mPartialUpdateEnabled; static bool mLoggingEnabled; }; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h index b466cfc..52c11c2 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h @@ -49,9 +49,9 @@ public: virtual void StartRender() {}; - virtual bool PreRender( bool resizingSurface ) { return false; }; + virtual bool PreRender( bool resizingSurface, const std::vector>& damagedRects, Rect& clippingRect ) { return false; }; - virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {}; + virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector>& damagedRects ) {}; virtual void StopRender() {}; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp index b09f171..c6bce30 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp @@ -230,8 +230,6 @@ int UtcDaliToolkitTextSelectionToolBarScrollView(void) END_TEST; } - - int UtcDaliToolkitTextSelectionPopupIconProperties(void) { ToolkitTestApplication application; @@ -252,3 +250,25 @@ int UtcDaliToolkitTextSelectionPopupIconProperties(void) END_TEST; } + +int UtcDaliToolkitTextSelectionPopupSizeProperties(void) +{ + ToolkitTestApplication application; + TextSelectionPopup popup = TextSelectionPopup::New(nullptr); + + const Vector2 popupMaxSize(200.0f, 300.0f); + const Vector2 optionMaxSize(50.0f, 100.0f); + const Vector2 optionMinSize(10.0f, 10.0f); + const Vector2 optionDividerSize(5.0f, 5.0f); + popup.SetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE, popupMaxSize); + popup.SetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE, optionMaxSize); + popup.SetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE, optionMinSize); + popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE, optionDividerSize); + + DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE).Get(), popupMaxSize, TEST_LOCATION); + DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE).Get(), optionMaxSize, TEST_LOCATION); + DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE).Get(), optionMinSize, TEST_LOCATION); + DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE).Get(), optionDividerSize, TEST_LOCATION); + + END_TEST; +} diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp index f35dd4b..8b851f0 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp @@ -494,7 +494,7 @@ void TextSelectionPopup::SetDimensionToCustomise( const PopupCustomisations& set } // switch } -Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise ) +Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise ) const { switch( settingToCustomise ) { @@ -567,48 +567,49 @@ void TextSelectionPopup::SetButtonImage( Toolkit::TextSelectionPopup::Buttons bu } // switch } -std::string TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) +const std::string& TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) const { - std::string buttonImageUrl; switch ( button ) { - case Toolkit::TextSelectionPopup::CLIPBOARD : + case Toolkit::TextSelectionPopup::CLIPBOARD: { - buttonImageUrl = mClipboardIconImage; + return mClipboardIconImage; break; } - case Toolkit::TextSelectionPopup::CUT : + case Toolkit::TextSelectionPopup::CUT: { - buttonImageUrl = mCutIconImage; + return mCutIconImage; break; } - case Toolkit::TextSelectionPopup::COPY : + case Toolkit::TextSelectionPopup::COPY: { - buttonImageUrl = mCopyIconImage; + return mCopyIconImage; break; } - case Toolkit::TextSelectionPopup::PASTE : + case Toolkit::TextSelectionPopup::PASTE: { - buttonImageUrl = mPasteIconImage; + return mPasteIconImage; break; } - case Toolkit::TextSelectionPopup::SELECT : + case Toolkit::TextSelectionPopup::SELECT: { - buttonImageUrl = mSelectIconImage; + return mSelectIconImage; break; } - case Toolkit::TextSelectionPopup::SELECT_ALL : + case Toolkit::TextSelectionPopup::SELECT_ALL: { - buttonImageUrl = mSelectAllIconImage; + return mSelectAllIconImage; break; } - default : + case Toolkit::TextSelectionPopup::NONE: { - DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" ); + break; } } // switch - return buttonImageUrl; + DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" ); + static std::string empty; + return empty; } void TextSelectionPopup::SetPressedImage( const std::string& filename ) @@ -740,7 +741,7 @@ std::string TextSelectionPopup::GetPressedImage() const } } - std::size_t TextSelectionPopup::GetNumberOfEnabledOptions() + std::size_t TextSelectionPopup::GetNumberOfEnabledOptions() const { std::size_t numberOfOptions = 0u; for( std::vector::const_iterator it = mOrderListOfButtons.begin(), endIt = mOrderListOfButtons.end(); ( it != endIt ); ++it ) diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h index 9cd7ab7..9db95c6 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h @@ -200,7 +200,7 @@ private: // Implementation * * @param[in] setting The setting from the PopupCustomisations enum */ - Size GetDimensionToCustomise( const PopupCustomisations& setting ); + Size GetDimensionToCustomise( const PopupCustomisations& setting ) const; /** * @brief Sets the image for the given button of the Popup. @@ -216,7 +216,7 @@ private: // Implementation * @param[in] button The button to get the image from * @return The image used for that button. */ - std::string GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ); + const std::string& GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) const; /** * @brief Sets the image for the pressed state of a popup option. @@ -236,7 +236,7 @@ private: // Implementation void AddOption( const ButtonRequirement& button, bool showDivider, bool showIcons, bool showCaption ); - std::size_t GetNumberOfEnabledOptions(); + std::size_t GetNumberOfEnabledOptions() const; void AddPopupOptionsToToolbar( bool showIcons, bool showCaptions ); diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index 53f0ddd..d1adcb7 100644 --- a/dali-toolkit/public-api/dali-toolkit-version.cpp +++ b/dali-toolkit/public-api/dali-toolkit-version.cpp @@ -31,7 +31,7 @@ namespace Toolkit const unsigned int TOOLKIT_MAJOR_VERSION = 1; const unsigned int TOOLKIT_MINOR_VERSION = 9; -const unsigned int TOOLKIT_MICRO_VERSION = 16; +const unsigned int TOOLKIT_MICRO_VERSION = 17; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 8092c6b..cd075ce 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali2-toolkit Summary: Dali 3D engine Toolkit -Version: 1.9.16 +Version: 1.9.17 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT