diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 22:28:56 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 22:28:56 +0000 |
commit | 6b757ce2647a9570d090011fc1c66153d349b492 (patch) | |
tree | faf97a7f81b4cf5a01952630c9121a1e4a0b3ca5 /chrome/browser/ui | |
parent | 5879d18c09f538dde037af4211ab0d800718bc34 (diff) | |
download | chromium_src-6b757ce2647a9570d090011fc1c66153d349b492.zip chromium_src-6b757ce2647a9570d090011fc1c66153d349b492.tar.gz chromium_src-6b757ce2647a9570d090011fc1c66153d349b492.tar.bz2 |
Fixes taking a screenshot of a page in high DPI
Also tagged read_pixel_bounds with _in_pixel to make it more clear what coordinate system it is in.
BUG=127550
TEST=Manual
Review URL: https://chromiumcodereview.appspot.com/10381093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136414 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r-- | chrome/browser/ui/window_snapshot/window_snapshot_aura.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc b/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc index fcc5f58..b18f4db 100644 --- a/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc +++ b/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc @@ -26,22 +26,22 @@ 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); + gfx::Rect read_pixels_bounds_in_pixel = + ui::ConvertRectToPixel(window->layer(), read_pixels_bounds_in_pixel); - DCHECK_GE(compositor->size().width(), read_pixels_bounds.right()); - DCHECK_GE(compositor->size().height(), read_pixels_bounds.bottom()); + DCHECK_GE(compositor->size().width(), read_pixels_bounds_in_pixel.right()); + DCHECK_GE(compositor->size().height(), read_pixels_bounds_in_pixel.bottom()); DCHECK_LE(0, read_pixels_bounds.x()); DCHECK_LE(0, read_pixels_bounds.y()); SkBitmap bitmap; - if (!compositor->ReadPixels(&bitmap, read_pixels_bounds)) + if (!compositor->ReadPixels(&bitmap, read_pixels_bounds_in_pixel)) return false; unsigned char* pixels = reinterpret_cast<unsigned char*>(bitmap.getPixels()); gfx::PNGCodec::Encode(pixels, gfx::PNGCodec::FORMAT_BGRA, - snapshot_bounds.size(), + read_pixels_bounds_in_pixel.size(), bitmap.rowBytes(), true, std::vector<gfx::PNGCodec::Comment>(), png_representation); |