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

Unified Diff: ui/gfx/display.cc

Issue 11140006: Fix code around display overscan settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
« no previous file with comments | « ui/gfx/display.h ('k') | ui/gfx/display_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/display.cc
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc
index e647f650603ff777e9a2c46931e5e11c7d3c645a..fb9c13c7f6a3d0a20e1548ff88dae09f8527f60b 100644
--- a/ui/gfx/display.cc
+++ b/ui/gfx/display.cc
@@ -108,6 +108,14 @@ void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) {
work_area_.Inset(insets);
}
+void Display::SetOverscanInsets(const gfx::Insets& insets) {
+ Rect bounds_in_pixel(bounds_in_pixel_);
+ bounds_in_pixel.Inset(overscan_insets_.Scale(device_scale_factor_).Scale(-1));
+ bounds_in_pixel.Inset(insets.Scale(device_scale_factor_));
+ SetScaleAndBounds(device_scale_factor_, bounds_in_pixel);
oshima 2012/10/16 22:46:26 this updates bounds_in_pixel, so it will keep shri
+ overscan_insets_ = insets;
+}
+
gfx::Size Display::GetSizeInPixel() const {
return gfx::ToFlooredSize(size().Scale(device_scale_factor_));
}
« no previous file with comments | « ui/gfx/display.h ('k') | ui/gfx/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698