evas_object_image_data_set() is removed when a surface is destroyed
authorBongjoo Seo <bongjoo.seo@samsung.com>
Tue, 21 May 2013 01:59:54 +0000 (10:59 +0900)
committerBongjoo Seo <bongjoo.seo@samsung.com>
Tue, 21 May 2013 01:59:54 +0000 (10:59 +0900)
Change-Id: I64c1c48c9450b26d4649ff1e40398d4c7a947952
Signed-off-by: Bongjoo Seo <bongjoo.seo@samsung.com>
src/ui/animations/FUiAnim_EflNode.cpp
src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp

index fad204d..0588808 100644 (file)
@@ -672,23 +672,10 @@ _EflNode::RemoveChild(_INativeNode& child)
 result
 _EflNode::SetFlushNeeded(void)
 {
-#if 0
-       evas_damage_rectangle_add(
-               __pEvas,
-               static_cast< int >(floorf(dirtyRectangle.x)),
-               static_cast< int >(floorf(dirtyRectangle.y)),
-               static_cast< int >(ceilf(dirtyRectangle.width)),
-               static_cast< int >(ceilf(dirtyRectangle.height))
-               );
-#endif
-
        if (!__pSurface || !_VisualElementSurfaceImpl::GetInstance(*__pSurface))
        {
                return E_INVALID_STATE;
        }
-#if 0
-       evas_object_image_pixels_dirty_set(reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*__pSurface)->GetNativeHandle()), true);
-#else
 
        Evas_Object* pImageObject = reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*__pSharedSurface)->GetNativeHandle());
 
@@ -697,50 +684,15 @@ _EflNode::SetFlushNeeded(void)
                int imageWidth = 0;
                int imageHeight = 0;
 
-               evas_object_image_data_set(pImageObject, evas_object_image_data_get(pImageObject, 1));
-
                evas_object_image_size_get(pImageObject, &imageWidth, &imageHeight);
                evas_object_image_data_update_add(pImageObject, 0, 0, imageWidth, imageHeight);
        }
 
-#endif
-
        if(__pLayer)
        {
                __pLayer->SetFlushNeeded();
        }
 
-#if 0
-       //contentChanged = false;
-       bool contentChanged = false;
-
-       if (contentChanged)
-       {
-               evas_object_image_pixels_dirty_set((Evas_Object*) _VisualElementSurfaceImpl::GetInstance(*__pSurface)->GetNativeHandle(), true);
-       }
-       else
-       {
-               evas_object_image_data_update_add(
-                       (Evas_Object*) _VisualElementSurfaceImpl::GetInstance(*__pSurface)->GetNativeHandle(),
-                       dirtyRectangle.x,
-                       dirtyRectangle.y,
-                       dirtyRectangle.width,
-                       dirtyRectangle.height
-               );
-
-#if 1
-               evas_object_image_data_update_add(
-                       (Evas_Object*) _VisualElementSurfaceImpl::GetInstance(*__pSharedSurface)->GetNativeHandle(),
-                       dirtyRectangle.x,
-                       dirtyRectangle.y,
-                       dirtyRectangle.width,
-                       dirtyRectangle.height
-               );
-#endif
-       }
-
-#endif
-
        return E_SUCCESS;
 }
 
@@ -761,18 +713,12 @@ _EflNode::Flush(void)
 _Colorf
 _EflNode::GetBackgroundColor(void) const
 {
-//     if (!__pRectangleObject)
-//             return _Colorf();   // CHECKME: Default background color ?
-
        return __backgroundColor;
 }
 
 result
 _EflNode::SetBackgroundColor(const _Colorf& backgroundColor)
 {
-//     if (!__pRectangleObject)
-//             return E_INVALID_STATE;
-
        __backgroundColor = backgroundColor;
 
        return E_SUCCESS;
@@ -959,7 +905,7 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen
                                        if (pEflVisualElementSurfaceImpl && pEflVisualElementSurfaceImpl->__pBuffer != null)
                                        {
                                                evas_object_image_source_set(pImageObject, pImageObjectNew);
-#if 0
+#if 0  // needed if evas_object_show() has not been called  in ctor of _EflVisualElementSurfaceImpl
                                                evas_object_show(pImageObjectNew);
                                                evas_object_image_source_visible_set(pImageObject, EINA_FALSE);
 #endif
@@ -1125,32 +1071,6 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen
                        __realBounds.x += clipX;
                        __realBounds.y += clipY;
                        _VisualElementCoordinateSystem::MakeIntegralPoint(__realBounds.x, __realBounds.y, newX, newY);
-
-#if 0
-                       int evasOutputW, evasOutputH;
-                       evas_output_size_get(__pEvas, &evasOutputW, &evasOutputH);
-
-//                     if (newX >= 480 || newY >= 800 || newX + newW < 0 || newY + newH < 0)
-//                     if ((newX >= SCREEN_WIDTH || newY >= SCREEN_HEIGHT || newX + newW < 0 || newY + newH < 0) ||
-                       if ((newX >= evasOutputW || newY >= evasOutputH || newX + newW < 0 || newY + newH < 0) ||
-                               (likely(pParentClipper) && (newX >= clipX + clipW || newY >= clipY + clipH || newX + newW < clipX || newY + newH < clipY)))
-                       {
-                               if (isEvasVisible)
-                                       evas_object_hide(__pSmartObject);
-
-                               element.__pSharedData->invalidatedNativeProps = 0;
-
-                               goto finished;
-                       }
-#endif
-
-#if 0
-                       if (likely(pParentClipper))
-                       {
-                               if (likely(newX >= clipX) && likely(newY >= clipY) && likely(newX + newW <= clipX + clipW) && likely(newY + newH <= clipY + clipH))
-                                       pParentClipper = null;
-                       }
-#endif
                }
                else
                {
@@ -1553,16 +1473,9 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen
                        {
                                evas_object_render_op_set(pImageObjectNew, GetRenderOperation(element.__renderOperation));
                        }
-//
-//                     if (unlikely(__renderOperation == VisualElement::RENDER_OPERATION_COPY))
-//                     {
-//                             evas_object_color_set(pImageObjectNew, 255, 255, 255, 255);
-//                     }
-//                     else
-//                     {
-                               int premultipliedColor =  static_cast< int >(255.0f * alpha); // white color
-                               evas_object_color_set(pImageObjectNew, premultipliedColor, premultipliedColor, premultipliedColor, premultipliedColor);
-//                     }
+
+                       int premultipliedColor =  static_cast< int >(255.0f * alpha); // white color
+                       evas_object_color_set(pImageObjectNew, premultipliedColor, premultipliedColor, premultipliedColor, premultipliedColor);
                }
 
 
index c72c8fe..c946a81 100644 (file)
@@ -125,6 +125,29 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c
 #endif
 }
 
+_EflVisualElementSurfaceImpl::~_EflVisualElementSurfaceImpl(void)
+{
+       if (__pEvasImage != null)
+       {
+               evas_object_hide(__pEvasImage);
+
+               // * DO NOT delete object which has been created from other modules.
+               if (!__fromOutside)
+               {
+                       evas_object_del(__pEvasImage);
+               }
+               evas_object_smart_member_del(__pEvasImage);
+       }
+
+       if (__pBuffer != null)
+       {
+               delete []__pBuffer;
+       }
+
+       __pBuffer = null;
+       __pEvasImage = null;
+}
+
 result
 _EflVisualElementSurfaceImpl::SetImage(const String& fileName)
 {
@@ -152,30 +175,6 @@ _EflVisualElementSurfaceImpl::SetImage(const String& fileName)
        return E_SUCCESS;
 }
 
-_EflVisualElementSurfaceImpl::~_EflVisualElementSurfaceImpl(void)
-{
-       if (__pEvasImage != null)
-       {
-               evas_object_hide(__pEvasImage);
-
-               // * DO NOT delete object which has been created from other modules.
-               if (!__fromOutside)
-               {
-                       evas_object_image_data_set(__pEvasImage, null);
-                       evas_object_del(__pEvasImage);
-               }
-               evas_object_smart_member_del(__pEvasImage);
-       }
-
-       if (__pBuffer != null)
-       {
-               delete []__pBuffer;
-       }
-
-       __pBuffer = null;
-       __pEvasImage = null;
-}
-
 Handle
 _EflVisualElementSurfaceImpl::GetNativeHandle(void) const
 {
@@ -222,15 +221,6 @@ _EflVisualElementSurfaceImpl::GetPhysicalSize(void) const
 
        evas_object_image_size_get(pSource, &w, &h);
 
-#if 0
-       _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance();
-       _ICoordinateTransformer* pXformer = pCoordSystem->GetInverseTransformer();
-       SysTryReturn(NID_UI_ANIM, pXformer, Dimension(-1, -1), E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to load coordinate transformer.");
-
-       w = pXformer->Transform(w);
-       h = pXformer->Transform(h);
-#endif
-
        return Tizen::Graphics::Dimension(w, h);
 }