From cac397373193c1ec9211df684ebb917d1da4cacc Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 31 Dec 2013 14:40:42 +0800 Subject: [PATCH] Flip the y axis in CapturePage API, fixes #148. --- browser/native_window.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/native_window.cc b/browser/native_window.cc index 2411464a723c..8aa0a266e3aa 100644 --- a/browser/native_window.cc +++ b/browser/native_window.cc @@ -213,8 +213,11 @@ base::ProcessHandle NativeWindow::GetRenderProcessHandle() { void NativeWindow::CapturePage(const gfx::Rect& rect, const CapturePageCallback& callback) { + gfx::Rect flipped_y_rect = rect; + flipped_y_rect.set_y(-rect.y()); + GetWebContents()->GetRenderViewHost()->CopyFromBackingStore( - rect, + flipped_y_rect, gfx::Size(), base::Bind(&NativeWindow::OnCapturePageDone, weak_factory_.GetWeakPtr(),