Flip the y axis in CapturePage API, fixes #148.

This commit is contained in:
Cheng Zhao 2013-12-31 14:40:42 +08:00
parent 19a35b58f0
commit cac3973731

View file

@ -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(),