Fixed a SetSurface() issue
authorBongjoo Seo <bongjoo.seo@samsung.com>
Fri, 15 Mar 2013 12:23:59 +0000 (21:23 +0900)
committerBongjoo Seo <bongjoo.seo@samsung.com>
Mon, 18 Mar 2013 02:23:04 +0000 (11:23 +0900)
Change-Id: I57840e2dc35a65cfc62d60d29b095e93bd1088c7
Signed-off-by: Bongjoo Seo <bongjoo.seo@samsung.com>
src/ui/animations/FUiAnim_VisualElementImpl.cpp
src/ui/animations/FUiAnim_VisualElementSharedData.cpp
src/ui/inc/FUiAnim_VisualElementSharedData.h

index f223418..ac31831 100644 (file)
@@ -1014,6 +1014,12 @@ _VisualElementImpl::SetSurfaceChanged(void)
        {
                if(__pPresentation)
                {
+                       _VisualElementImpl* pElement = __pPresentation;
+                       while (pElement)
+                       {
+                               pElement->GetSharedData().childrenSurfaceChanged = true;
+                               pElement = pElement->__pParent;
+                       }
 #ifdef OLD
                        __pPresentation->InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false);
 #endif
@@ -1021,6 +1027,12 @@ _VisualElementImpl::SetSurfaceChanged(void)
        }
        else
        {
+               _VisualElementImpl* pElement = this;
+               while (pElement)
+               {
+                       pElement->GetSharedData().childrenSurfaceChanged = true;
+                       pElement = pElement->__pParent;
+               }
 #ifdef OLD
                InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false);
 #endif
@@ -2180,7 +2192,7 @@ _VisualElementImpl::SetTransformMatrixI(const FloatMatrix4& xform, bool updateDe
        {
                FloatMatrix4 currentValue = __pPresentation->__transform;
 
-               const String* subProperties[] = {       pVeSubPropTransformRotationX,
+               static const String* subProperties[] = {        pVeSubPropTransformRotationX,
                                                                                        pVeSubPropTransformRotationY,
                                                                                        pVeSubPropTransformRotationZ,
                                                                                        pVeSubPropTransformScaleX,
@@ -3681,9 +3693,7 @@ _VisualElementImpl::GetCanvasN(const FloatRectangle& bounds)
        //      because 'bounds' is for the VE does not comply with size of surface.
        //      (in which case the surface will be displayed scaled)
 
-       _VisualElementImpl* pRenderTarget = null;
-
-       pRenderTarget = GetRenderTarget();
+       _VisualElementImpl* pRenderTarget = GetRenderTarget();
        SysTryReturn(NID_UI_ANIM, pRenderTarget, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Target VisualElement is not available.");
        SysTryReturn(NID_UI_ANIM, pRenderTarget->__pSharedData, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Target VisualElement is not constructed.");
 
@@ -5276,7 +5286,7 @@ _VisualElementImpl::UpdateHierarchyProps(void)
        const int mask = HIERARCHY_PROPERTY_MASK;
 #endif
 
-       if (unlikely((__childrenNeedsUpdateProps & mask) == 0))
+       if (unlikely((__childrenNeedsUpdateProps & mask) == 0 && GetSharedData().childrenSurfaceChanged == false))
                return;
 
        // Node will be reconfigured later(before OnDraw, or DrawRectangle, ...)
@@ -5286,12 +5296,13 @@ _VisualElementImpl::UpdateHierarchyProps(void)
        // WARNING:
        //      __childrenNeedsUpdateProps should be cleared *ONLY AFTER* flushing native nodes !
        __childrenNeedsUpdateProps &= ~mask;
+       GetSharedData().childrenSurfaceChanged = false;
 
        int count = __children.GetCount();
        for (int i = 0; i < count; i++)
        {
                _VisualElementImpl* pChild = __children.GetChildAt(i);
-               if (likely((pChild->__childrenNeedsUpdateProps & mask) != 0))
+               if (likely((pChild->__childrenNeedsUpdateProps & mask) != 0 || pChild->GetSharedData().childrenSurfaceChanged == true))
                        pChild->UpdateHierarchyProps();
        }
 }
@@ -5819,12 +5830,11 @@ _VisualElementImpl::DrawRectangle(const FloatRectangle& drawRect)
 
        if (needDraw)
        {
-               Canvas* pCanvas = null;
-               pCanvas = GetCanvasN();
+               Canvas* pCanvas = GetCanvasN();
 
                if (pCanvas)
                {
-                       result r = pCanvas->SetClipBounds(Rectangle(drawRectVisible.x,
+                       result r = pCanvas->SetClipBounds(FloatRectangle(drawRectVisible.x,
                                                                                                                drawRectVisible.y,
                                                                                                                drawRectVisible.width,
                                                                                                                drawRectVisible.height));
@@ -6078,13 +6088,11 @@ _VisualElementImpl::ScrollByPoint(const FloatPoint& pointOffset, bool scrollSelf
        }
        else if (scrollSelf)
        {
-               Canvas* pCanvas = null;
-               _CanvasImpl* pCanvasImpl = null;
+               Canvas* pCanvas = GetCanvasN(); // TODO: clip rect......
 
-               pCanvas = GetCanvasN(); // TODO: clip rect......
                if (pCanvas)
                {
-                       pCanvasImpl = _CanvasImpl::GetInstance(*pCanvas);
+                       _CanvasImpl* pCanvasImpl = _CanvasImpl::GetInstance(*pCanvas);
                        if (pCanvasImpl)
                        {
                                Point pointDest;
@@ -6465,7 +6473,7 @@ _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDes
                        point.y = rectDest.y + bounds.y;
 
                        //pOutput->FillRectangle(color, Rectangle(drawRect.x + bounds.x, drawRect.y + bounds.y, drawRect.width, drawRect.height));
-                       pOutput->FillRectangle(color, Rectangle(point.x, point.y, drawRect.width, drawRect.height));
+                       pOutput->FillRectangle(color, FloatRectangle(point.x, point.y, drawRect.width, drawRect.height));
                }
        }
 
index c4d8da8..4cc1cf6 100644 (file)
@@ -41,6 +41,7 @@ namespace Tizen { namespace Ui { namespace Animations
 _VisualElementSharedData::_VisualElementSharedData(void)
        : invalidatedNativeProps(-1)
        , childrenInvalidated(false)
+       , childrenSurfaceChanged(false)
        , surfaceChanged(false)
        , pNativeNode(null)
        , pSurface(null)
index 8c13d72..6cffb45 100644 (file)
@@ -64,13 +64,14 @@ public:
 
        bool NeedNativeReconfigure(void) const
        {
-               return (invalidatedNativeProps != 0 || surfaceChanged);
+               return (invalidatedNativeProps != 0 || childrenSurfaceChanged);
        }
 
 
 public:
        int invalidatedNativeProps;
        bool childrenInvalidated;
+       bool childrenSurfaceChanged;
        bool surfaceChanged;
        _INativeNode* pNativeNode;
        VisualElementSurface* pSurface;