Revert "fixup! Porting of async snapshot functionality for Tizen platform"
authormohan <mohan.reddy@samsung.com>
Tue, 27 Jan 2015 13:39:00 +0000 (19:09 +0530)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
This reverts commit 0e84589d308fd0639af0ed7b846a2963a283aa86.

Change-Id: I64865d81da00c84a3f5ea6857a26427101a87e9c
Signed-off-by: mohan <mohan.reddy@samsung.com>
tizen_src/impl/eweb_view.cc

index 4170c74..6214f7b 100644 (file)
@@ -1615,11 +1615,8 @@ void EWebView::FindAndRunSnapshotCallback(Evas_Object* image, int snapshotId) {
   screen_capture_cb_map_.Remove(snapshotId);
 }
 
-bool EWebView::GetSnapshotAsync(Eina_Rectangle rect,
-    Evas* canvas,
-    tizen_webview::Web_App_Screenshot_Captured_Callback callback,
-    void* user_data) {
-#ifdef OS_TIZEN
+bool EWebView::GetSnapshotAsync(Eina_Rectangle rect, Evas* canvas, tizen_webview::Web_App_Screenshot_Captured_Callback callback, void* user_data) {
+ #ifdef OS_TIZEN
   if (!rwhv())
     return false;
   int width = rect.w;
@@ -1627,33 +1624,17 @@ bool EWebView::GetSnapshotAsync(Eina_Rectangle rect,
   int x = rect.x;
   int y = rect.y;
 
-  int device_x, device_y;
-  int view_x, view_y;
-
-  evas_object_geometry_get(evas_object(),
-                           &device_x,
-                           &device_y,
-                           NULL,
-                           NULL);
-
-  if (width > device_x + rwhv()->GetViewBoundsInPix().width() - rect.x)
-    width = device_x + rwhv()->GetViewBoundsInPix().width() - rect.x;
-  if (height > device_y + rwhv()->GetViewBoundsInPix().height() - rect.y)
-    height = device_y + rwhv()->GetViewBoundsInPix().height() - rect.y;
-
-  EvasToBlinkCords(x, y, &view_x, &view_y);
-
-  if (rwhv()->device_scale_factor()) {
-    width /= rwhv()->device_scale_factor();
-    height /= rwhv()->device_scale_factor();
-  }
+  if (width > rwhv()->GetViewBoundsInPix().width() - rect.x)
+    width = rwhv()->GetViewBoundsInPix().width() - rect.x;
+  if (height > rwhv()->GetViewBoundsInPix().height() - rect.y)
+    height = rwhv()->GetViewBoundsInPix().height() - rect.y;
 
-  WebAppScreenshotCapturedCallback* cb =
-      new WebAppScreenshotCapturedCallback(callback, user_data, canvas);
+  WebAppScreenshotCapturedCallback* cb = new WebAppScreenshotCapturedCallback(callback, user_data, canvas);
 
   int cbId = screen_capture_cb_map_.Add(cb);
 
-  rwhv()->GetSnapshotAsync(gfx::Rect(view_x, view_y, width, height), cbId);
+  gfx::Rect rect1(x, y, width, height);
+  rwhv()->GetSnapshotAsync(gfx::Rect(x, y, width, height), cbId);
   return true;
 #endif
 }