X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fcontroller%2Ftext-controller-relayouter.cpp;h=d323bd817653e8c7d63f8f4d3a02909d3c6da1f0;hb=0cb9c3ad5c6d497c1d53d49d05c52c695c9e0f85;hp=48df46eae725ecc2fc75077be9070dcfb98ba357;hpb=109ff97930de99f9ac96bcf2f54395dcd97cc573;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp b/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp index 48df46e..d323bd8 100644 --- a/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp +++ b/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDES #include +#include +#include #include // INTERNAL INCLUDES @@ -33,6 +35,8 @@ namespace Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_CONTROLS"); #endif +DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_TEXT_PERFORMANCE_MARKER, false); + constexpr float MAX_FLOAT = std::numeric_limits::max(); float ConvertToEven(float value) @@ -95,6 +99,13 @@ Size Controller::Relayouter::CalculateLayoutSizeOnRequiredControllerSize(Control if(!isEditable) { + if(NO_OPERATION != (VALIDATE_FONTS & operationsPending) && + textUpdateInfo.mCharacterIndex == static_cast(-1)) + { + impl.ClearFontData(); + updateInfoCharIndexBackup = textUpdateInfo.mCharacterIndex; + } + impl.UpdateModel(onlyOnceOperations); // Layout the text for the new width. @@ -156,6 +167,7 @@ Size Controller::Relayouter::CalculateLayoutSizeOnRequiredControllerSize(Control Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller) { DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::GetNaturalSize\n"); + DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_GET_NATURAL_SIZE"); Vector3 naturalSizeVec3; // Make sure the model is up-to-date before layouting @@ -244,6 +256,7 @@ void Controller::Relayouter::FitPointSizeforLayout(Controller& controller, const const OperationsMask operations = impl.mOperationsPending; if(NO_OPERATION != (UPDATE_LAYOUT_SIZE & operations) || impl.mTextFitContentSize != layoutSize) { + DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_FIT_LAYOUT"); ModelPtr& model = impl.mModel; bool actualellipsis = model->mElideEnabled; @@ -307,7 +320,7 @@ void Controller::Relayouter::FitPointSizeforLayout(Controller& controller, const } model->mElideEnabled = actualellipsis; - if(currentFitPointSize != bestPointSize) + if(!Dali::Equals(currentFitPointSize, bestPointSize)) { impl.mTextFitChanged = true; } @@ -320,6 +333,7 @@ void Controller::Relayouter::FitPointSizeforLayout(Controller& controller, const float Controller::Relayouter::GetHeightForWidth(Controller& controller, float width) { DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::GetHeightForWidth %p width %f\n", &controller, width); + DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_GET_HEIGHT_FOR_WIDTH"); // Make sure the model is up-to-date before layouting EventHandler::ProcessModifyEvents(controller); @@ -360,6 +374,7 @@ Controller::UpdateTextType Controller::Relayouter::Relayout(Controller& controll TextUpdateInfo& textUpdateInfo = impl.mTextUpdateInfo; DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f, autoScroll[%s]\n", &controller, size.width, size.height, impl.mIsAutoScrollEnabled ? "true" : "false"); + DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_RELAYOUT"); UpdateTextType updateTextType = NONE_UPDATED; @@ -537,6 +552,7 @@ Controller::UpdateTextType Controller::Relayouter::Relayout(Controller& controll bool Controller::Relayouter::DoRelayout(Controller::Impl& impl, const Size& size, OperationsMask operationsRequired, Size& layoutSize) { DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::Relayouter::DoRelayout %p size %f,%f\n", &impl, size.width, size.height); + DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_DORELAYOUT"); bool viewUpdated(false); // Calculate the operations to be done. @@ -843,7 +859,7 @@ void Controller::Relayouter::CalculateVerticalOffset(Controller::Impl& impl, con // Whether the text control is editable const bool isEditable = NULL != impl.mEventData; - if(isEditable && layoutSize.height != defaultFontLineHeight && impl.IsShowingPlaceholderText()) + if(isEditable && !Dali::Equals(layoutSize.height, defaultFontLineHeight) && impl.IsShowingPlaceholderText()) { // This code prevents the wrong positioning of cursor when the layout size is bigger/smaller than defaultFontLineHeight. // This situation occurs when the size of placeholder text is different from the default text.