From aa14d777c6b7efcc689079c3a27d837e0260fb16 Mon Sep 17 00:00:00 2001 From: Jaewon Cho Date: Sat, 29 Jun 2013 17:20:18 +0900 Subject: [PATCH] Rollback - Apply Perforcemance improvement for GetAbsoluteBounds() function Change-Id: I4d7e7e4fcfbaedd0bb2fadda7f56da4a9a4aae70 Signed-off-by: Jaewon Cho --- src/ui/FUi_Control.cpp | 42 +----------------------------------------- src/ui/inc/FUi_Control.h | 6 +----- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index f154744..7acccf2 100644 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -1071,25 +1071,6 @@ _Control::InvalidateHierarchyRootWindow(void) } void -_Control::InvalidateHierarchyAbsoluteBounds(void) -{ - struct _Visitor - : public Visitor - { - virtual VisitType Visit(_Control& control) - { - control.__needRecalcAbsBounds = true; - control.__needRecalcAbsBoundsF = true; - - return VISIT_DOWNWARD; - } - }; - - _Visitor visitor; - Accept(visitor); -} - -void _Control::Draw(bool recursive) { ClearLastResult(); @@ -1816,7 +1797,6 @@ _Control::EndAttaching(_Control& child) { child.SetParent(this); child.InvalidateHierarchyRootWindow(); - child.InvalidateHierarchyAbsoluteBounds(); FloatRectangle floatBounds(child.GetBoundsF().x, child.GetBoundsF().y, child.GetBoundsF().width, child.GetBoundsF().height); @@ -3282,11 +3262,6 @@ _Control::SetBoundsFinal(const FloatRectangle& newBounds, bool changeLayoutBaseR } } - if (moved || resized) - { - InvalidateHierarchyAbsoluteBounds(); - } - ClearLastResult(); return E_SUCCESS; } @@ -3680,9 +3655,6 @@ _Control::GetClientBoundsF(const Tizen::Graphics::FloatDimension& size) const Rectangle _Control::GetAbsoluteBounds(void) const { - if (!__needRecalcAbsBounds) - return __absoluteBounds; - Point accumPoint; Rectangle absoluteBounds; Rectangle clientBounds; @@ -3720,18 +3692,12 @@ _Control::GetAbsoluteBounds(void) const absoluteBounds.width = __bounds.width; absoluteBounds.height = __bounds.height; - const_cast<_Control*>(this)->__absoluteBounds = absoluteBounds; - const_cast<_Control*>(this)->__needRecalcAbsBounds = false; - return absoluteBounds; } FloatRectangle _Control::GetAbsoluteBoundsF(void) const { - if (!__needRecalcAbsBoundsF) - return __absoluteBoundsF; - FloatPoint accumPoint; FloatRectangle absoluteBounds; FloatRectangle clientBounds; @@ -3769,9 +3735,6 @@ _Control::GetAbsoluteBoundsF(void) const absoluteBounds.width = __bounds.width; absoluteBounds.height = __bounds.height; - const_cast<_Control*>(this)->__absoluteBoundsF = absoluteBounds; - const_cast<_Control*>(this)->__needRecalcAbsBoundsF = false; - return absoluteBounds; } @@ -3942,8 +3905,6 @@ _Control::DisposeControl(void) // E_SYSTEM _Control::_Control(void) : __needRecalcRootWindow(true) - , __needRecalcAbsBounds(true) - , __needRecalcAbsBoundsF(true) , __pRootWindow(null) , __name(L"") , __pParent(null) @@ -3952,8 +3913,7 @@ _Control::_Control(void) , __bounds(0.0f, 0.0f, 0.0f, 0.0f) , __contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f) , __clientBounds(0.0f, 0.0f, 0.0f, 0.0f) - , __absoluteBounds(0, 0, 0, 0) - , __absoluteBoundsF(0.0f, 0.0f, 0.0f, 0.0f) + , __absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f) , __invalidatedBounds(0.0f, 0.0f, 0.0f, 0.0f) , __minSize(FloatDimension(0.0f, 0.0f)) , __maxSize(FloatDimension(MAX_LENGTH, MAX_LENGTH)) diff --git a/src/ui/inc/FUi_Control.h b/src/ui/inc/FUi_Control.h index 4a5e240..458f402 100644 --- a/src/ui/inc/FUi_Control.h +++ b/src/ui/inc/FUi_Control.h @@ -478,7 +478,6 @@ public: Tizen::Graphics::FloatRectangle GetClientBoundsF(const Tizen::Graphics::FloatDimension& size) const; Tizen::Graphics::Rectangle GetAbsoluteBounds(void) const; Tizen::Graphics::FloatRectangle GetAbsoluteBoundsF(void) const; - void InvalidateHierarchyAbsoluteBounds(void); result SetClientBounds(const Tizen::Graphics::Rectangle& bounds); result SetClientBounds(const Tizen::Graphics::FloatRectangle& bounds); bool IsCalledSetClientBounds(void); @@ -634,8 +633,6 @@ private: private: bool __needRecalcRootWindow; - bool __needRecalcAbsBounds; - bool __needRecalcAbsBoundsF; _Window* __pRootWindow; _ControlHandle __controlHandle; @@ -648,8 +645,7 @@ private: Tizen::Graphics::FloatRectangle __bounds; Tizen::Graphics::FloatRectangle __contentAreaBounds; Tizen::Graphics::FloatRectangle __clientBounds; - Tizen::Graphics::Rectangle __absoluteBounds; - Tizen::Graphics::FloatRectangle __absoluteBoundsF; + Tizen::Graphics::FloatRectangle __absoluteBounds; Tizen::Graphics::FloatRectangle __invalidatedBounds; Tizen::Graphics::FloatDimension __minSize; Tizen::Graphics::FloatDimension __maxSize; -- 2.7.4