return _DisplayManager::GetInstance()->Flush();
}
-result
-_VisualElementImpl::SetImageSource(const String& filePath)
-{
- result r = E_SUCCESS;
- RebuildHierarchyProps(0, true, true);
-
- SysTryReturnResult(NID_UI_ANIM, HAVE_SURFACE(this), E_SYSTEM, "Realizing back-buffer surface failed.");
-
- if (!filePath.IsEmpty())
- {
- r = GetSharedData().SetImage(filePath);
- SysTryLog(NID_UI_ANIM, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
- }
-
- __imageFilePath = filePath;
-
- return r;
-}
-
-
bool
_VisualElementImpl::CreateImplicitAnimationIfNeeded( const String& property,
const Variant& newValue, const Variant& currentPresentationValue, const String** pSubProperties)
return E_SUCCESS;
}
+result
+_VisualElementImpl::SetImageSource(const String& filePath)
+{
+ result r = E_SUCCESS;
+
+ // Delete the old surface
+ if (GetSharedData().pSurface)
+ {
+ delete GetSharedData().pSurface;
+ }
+
+ __needRecreateSurface = true;
+
+ GetSharedData().pSurface = null;
+ GetSharedData().fixedSurfaceSize = false;
+
+ // Fully invalidate because new surface should be allocated and redrawn
+ GetSharedData().invalidatedRegion.SetBounds(0.0f, 0.0f, __bounds.width, __bounds.height);
+
+
+ RebuildHierarchyProps(0, true, true);
+
+ SysTryReturnResult(NID_UI_ANIM, HAVE_SURFACE(this), E_SYSTEM, "Realizing back-buffer surface failed.");
+
+ if (!filePath.IsEmpty())
+ {
+ r = GetSharedData().SetImage(filePath);
+ SysTryLog(NID_UI_ANIM, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ __imageFilePath = filePath;
+
+ return r;
+}
+
void
_VisualElementImpl::SetSurfaceChanged(void)
{