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;
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
}