From: Hyun Lee Date: Tue, 23 Apr 2013 08:08:29 +0000 (+0900) Subject: Fix for canvas issue X-Git-Tag: 2.1b_release~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e46a6cb5a58cc66ec7af3e88ea81ba970cc06e1;p=framework%2Fosp%2Fweb.git Fix for canvas issue Change-Id: I7f0f39a6592e3d561864a626d87910ff017ac6d1 Signed-off-by: Hyun Lee --- diff --git a/src/controls/FWebCtrl_Web.cpp b/src/controls/FWebCtrl_Web.cpp index c5f7f8c..8c34951 100755 --- a/src/controls/FWebCtrl_Web.cpp +++ b/src/controls/FWebCtrl_Web.cpp @@ -629,17 +629,24 @@ _Web::OnCanvasRequestedFN(const FloatRectangle& bounds) EINA_RECTANGLE_SET(&rect, absPoint.x, absPoint.y, absSize.width, absSize.height); Evas_Object* pScreenShot = ewk_view_screenshot_contents_get(pWebFrame, rect, 1.0f, evas_object_evas_get(pWebFrame)); - SysTryReturn(NID_WEB_CTRL, pScreenShot, null, E_SYSTEM, "[%s] A system error has been occurred. Failed to get snapshot of Web control", GetErrorMessage(E_SYSTEM)); - - r = _Utility::GetPixelBufferFromEvasObject(pScreenShot, bufferInfo); - evas_object_del(pScreenShot); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] propagating", GetErrorMessage(r)); std::unique_ptr pCanvas(new (std::nothrow) Canvas()); SysTryReturn(NID_WEB_CTRL, pCanvas.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); - r = pCanvas->Construct(bufferInfo); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] propagating", GetErrorMessage(r)); + if (pScreenShot) + { + r = _Utility::GetPixelBufferFromEvasObject(pScreenShot, bufferInfo); + evas_object_del(pScreenShot); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] propagating", GetErrorMessage(r)); + + r = pCanvas->Construct(bufferInfo); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] propagating", GetErrorMessage(r)); + } + else + { + r = pCanvas->Construct(bounds); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] propagating", GetErrorMessage(r)); + } return pCanvas.release(); }