From 876fa1b581c24256a12ebd0ed6ed3948ac487fe4 Mon Sep 17 00:00:00 2001 From: Bongjoo Seo Date: Thu, 23 May 2013 18:13:49 +0900 Subject: [PATCH] Fixed a evas abort issue regarding WebControl Change-Id: Ie26610c40c6125c0e5a3b25b42c7334a3c633812 Signed-off-by: Bongjoo Seo --- src/ui/animations/FUiAnim_EflNode.cpp | 48 ++++++++++++++-------- .../FUiAnim_EflVisualElementSurfaceImpl.cpp | 9 ++++ .../FUiAnim_EflVisualElementSurfaceImpl.h | 1 + 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/src/ui/animations/FUiAnim_EflNode.cpp b/src/ui/animations/FUiAnim_EflNode.cpp index 0588808..4dbd192 100644 --- a/src/ui/animations/FUiAnim_EflNode.cpp +++ b/src/ui/animations/FUiAnim_EflNode.cpp @@ -672,7 +672,13 @@ _EflNode::RemoveChild(_INativeNode& child) result _EflNode::SetFlushNeeded(void) { - if (!__pSurface || !_VisualElementSurfaceImpl::GetInstance(*__pSurface)) + _EflVisualElementSurfaceImpl* pSurfaceImpl = null; + if (!__pSurface) + { + return E_INVALID_STATE; + } + pSurfaceImpl = dynamic_cast<_EflVisualElementSurfaceImpl*>(_VisualElementSurfaceImpl::GetInstance(*__pSurface)); + if (!pSurfaceImpl) { return E_INVALID_STATE; } @@ -684,8 +690,11 @@ _EflNode::SetFlushNeeded(void) int imageWidth = 0; int imageHeight = 0; - evas_object_image_size_get(pImageObject, &imageWidth, &imageHeight); - evas_object_image_data_update_add(pImageObject, 0, 0, imageWidth, imageHeight); + if (pSurfaceImpl->__isImageObject) + { + evas_object_image_size_get(pImageObject, &imageWidth, &imageHeight); + evas_object_image_data_update_add(pImageObject, 0, 0, imageWidth, imageHeight); + } } if(__pLayer) @@ -802,9 +811,13 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen invalidatedNativeProps &= nativeProps; + + _EflVisualElementSurfaceImpl* pSurfaceImpl = null; + if (likely(pSurface) && likely(_VisualElementSurfaceImpl::GetInstance(*pSurface))) { pImageObjectNew = reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*pSurface)->GetNativeHandle()); + pSurfaceImpl = dynamic_cast<_EflVisualElementSurfaceImpl*>(_VisualElementSurfaceImpl::GetInstance(*pSurface)); } if (likely(__pSharedSurface) && likely(_VisualElementSurfaceImpl::GetInstance(*__pSharedSurface))) @@ -817,8 +830,6 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen { bool createNewObject = true; - evas_object_image_size_get(pImageObjectNew, &imageWidth, &imageHeight); - if (likely(__pSurface)) { // if the surfaces are same, change the size @@ -900,9 +911,7 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen evas_object_hide(pImageObject); } - - _EflVisualElementSurfaceImpl* pEflVisualElementSurfaceImpl = dynamic_cast<_EflVisualElementSurfaceImpl*>(_VisualElementSurfaceImpl::GetInstance(*pSurface)); - if (pEflVisualElementSurfaceImpl && pEflVisualElementSurfaceImpl->__pBuffer != null) + if (pSurfaceImpl && pSurfaceImpl->__pBuffer != null) { evas_object_image_source_set(pImageObject, pImageObjectNew); #if 0 // needed if evas_object_show() has not been called in ctor of _EflVisualElementSurfaceImpl @@ -1431,13 +1440,17 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen if (likely(contentBoundsAdjusted.width > 0) && likely(contentBoundsAdjusted.height > 0)) { - evas_object_image_fill_set( - pImageObjectNew, - contentBoundsAdjusted.x, - contentBoundsAdjusted.y, - contentBoundsAdjusted.width, - contentBoundsAdjusted.height - ); + + if (pSurfaceImpl && pSurfaceImpl->__isImageObject) + { + evas_object_image_fill_set( + pImageObjectNew, + contentBoundsAdjusted.x, + contentBoundsAdjusted.y, + contentBoundsAdjusted.width, + contentBoundsAdjusted.height + ); + } needDefaultFillSet = false; } @@ -1445,7 +1458,10 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen if (likely(needDefaultFillSet)) { - evas_object_image_fill_set(pImageObjectNew, 0, 0, newW, newH); + if (pSurfaceImpl && pSurfaceImpl->__isImageObject) + { + evas_object_image_fill_set(pImageObjectNew, 0, 0, newW, newH); + } } } diff --git a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp index c946a81..db61fe9 100644 --- a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp +++ b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp @@ -49,6 +49,7 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c , __pEvasImage(null) , __pBuffer(null) , __fromOutside(false) + , __isImageObject(true) { ClearLastResult(); @@ -108,6 +109,7 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c , __pEvasImage(null) , __pBuffer(null) , __fromOutside(true) + , __isImageObject(true) { ClearLastResult(); @@ -119,6 +121,13 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c } SysTryReturnVoidResult(NID_UI_ANIM, __pEvasImage, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to create a new surface."); + // type check + const char* pType = evas_object_type_get(__pEvasImage); + if (strcmp("image", pType)) + { + __isImageObject = false; + } + #if 1 // Todo : Temporary code(regarding the visibility of evas source object) evas_object_show(__pEvasImage); evas_object_move(__pEvasImage, -999999, -999999); diff --git a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h index cc118f0..4b3b0ce 100644 --- a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h +++ b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h @@ -64,6 +64,7 @@ private: Evas_Object* __pEvasImage; unsigned char* __pBuffer; bool __fromOutside; + bool __isImageObject; friend class _VisualElementSurfaceImpl; friend class _VisualElementImpl; -- 2.7.4