summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/aura/root_window.cc3
-rw-r--r--ui/aura/root_window_host.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 13e1ac2..ad146e5 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -528,7 +528,8 @@ void RootWindow::SetFocusWhenShown(bool focused) {
bool RootWindow::GrabSnapshot(const gfx::Rect& snapshot_bounds,
std::vector<unsigned char>* png_representation) {
DCHECK(bounds().Contains(snapshot_bounds));
- return host_->GrabSnapshot(snapshot_bounds, png_representation);
+ gfx::Rect snapshot_pixels = ui::ConvertRectToPixel(layer(), snapshot_bounds);
+ return host_->GrabSnapshot(snapshot_pixels, png_representation);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/ui/aura/root_window_host.h b/ui/aura/root_window_host.h
index c63e0b9..877c66a 100644
--- a/ui/aura/root_window_host.h
+++ b/ui/aura/root_window_host.h
@@ -91,6 +91,7 @@ class RootWindowHost {
virtual void SetFocusWhenShown(bool focus_when_shown) = 0;
// Grabs the snapshot of the root window by using the platform-dependent APIs.
+ // The bounds need to be in physical pixels.
virtual bool GrabSnapshot(
const gfx::Rect& snapshot_bounds,
std::vector<unsigned char>* png_representation) = 0;