Reintroduce removed ewk_view_screenshot_contents_get api call. 12/45812/4 accepted/tizen/tv/20150826.015718 submit/tizen_tv/20150825.231341
authorMarcin Lapinski <m.lapinski@samsung.com>
Mon, 10 Aug 2015 09:18:01 +0000 (11:18 +0200)
committerJanusz Majnert <j.majnert@samsung.com>
Tue, 25 Aug 2015 06:17:27 +0000 (23:17 -0700)
[Issue#]    https://bugs.tizen.org/jira/browse/TT-89
[Problem]   Bookmark items do not show its thumbnail.
[Cause]     N/A
[Sollution] Put ewk_view_screenshot_contents_get call back as it
            was moved to public api.
[Verify]    Bookmark items thumbnalis should be visible.

Change-Id: I50538f737eebbce566565f5c6052266125d52610

services/WebKitEngineService/WebView.cpp

index 4bb27ed..89ef166 100644 (file)
@@ -429,7 +429,7 @@ void WebView::confirmationResult(WebConfirmationPtr confirmation)
 
 std::shared_ptr<tizen_browser::tools::BrowserImage> WebView::captureSnapshot(int targetWidth, int targetHeight)
 {
-    BROWSER_LOGD("%s:%d %s NOT IMPLEMENTED, returning empty BrowserImage object", __FILE__, __LINE__, __func__);
+    BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
     M_ASSERT(m_ewkView);
     M_ASSERT(targetWidth);
     M_ASSERT(targetHeight);
@@ -458,13 +458,12 @@ std::shared_ptr<tizen_browser::tools::BrowserImage> WebView::captureSnapshot(int
     if (area.w == 0 || area.h == 0)
         return noImage;
 
-    double scaleW = (double)targetWidth / (double)(area.w);
-    double scaleH = (double)targetHeight / (double)(area.h);
 
+    BROWSER_LOGD("[%s:%d] Before snapshot (screenshot) - look at the time of taking snapshot below",__func__, __LINE__);
 #if defined(USE_EWEBKIT)
 #if PLATFORM(TIZEN)
-    Evas_Object *snapshot = nullptr;
-    // TODO use ewk_view_screenshot_contents_get_async API here
+    Evas_Object *snapshot = ewk_view_screenshot_contents_get( m_ewkView, area, 1.0, evas_object_evas_get(m_ewkView));
+    BROWSER_LOGD("[%s:%d] Snapshot (screenshot) catched, evas pointer: %p",__func__, __LINE__, snapshot);
     if (snapshot)
         return tizen_browser::tools::EflTools::getBrowserImage(snapshot);
 #endif