Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2951)

Unified Diff: chrome/browser/ui/window_snapshot/window_snapshot_aura.cc

Issue 10221028: Move DIP translation from ui/aura to ui/compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/window_snapshot/window_snapshot_aura.cc
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc b/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc
index d17cb602e6c25e8b452c9329f07ff9f6973754a4..ba1b6e0e252048b397f4993406459c46ed2d9691 100644
--- a/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc
+++ b/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc
@@ -9,6 +9,7 @@
#include "ui/aura/window.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/compositor/compositor.h"
+#include "ui/gfx/compositor/dip_util.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/rect.h"
@@ -25,6 +26,8 @@ bool GrabWindowSnapshot(gfx::NativeWindow window,
// the desktop.
read_pixels_bounds.set_origin(
snapshot_bounds.origin().Add(window->bounds().origin()));
+ read_pixels_bounds =
+ ui::ConvertRectToPixel(window->layer(), read_pixels_bounds);
DCHECK_GE(compositor->size().width(), read_pixels_bounds.right());
DCHECK_GE(compositor->size().height(), read_pixels_bounds.bottom());

Powered by Google App Engine
This is Rietveld 408576698