diff options
author | marcheu@chromium.org <marcheu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-21 22:25:13 +0000 |
---|---|---|
committer | marcheu@chromium.org <marcheu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-21 22:25:13 +0000 |
commit | 87ea28589efc8fd43328af6216cc15561c4205ce (patch) | |
tree | 30eaa88c023130701a22b70eb4f08727b628090a /chromeos/display | |
parent | ad0c052c654f23162e05d848d89a8345b294d983 (diff) | |
download | chromium_src-87ea28589efc8fd43328af6216cc15561c4205ce.zip chromium_src-87ea28589efc8fd43328af6216cc15561c4205ce.tar.gz chromium_src-87ea28589efc8fd43328af6216cc15561c4205ce.tar.bz2 |
output_configurator: Check against the old screen size.
We were checking against the new screen size, which should always fit
(given that we're setting it up so that it does). However what we need
to check against is the current size. This patch fixes that.
BUG=None, found by code inspection
TEST=builds, works on Link. Switched between clone mode and extended desktop
Change-Id: Ie4b5278fd677fedacebcc98c06ad410915bfd1fd
Review URL: https://chromiumcodereview.appspot.com/11647046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/display')
-rw-r--r-- | chromeos/display/output_configurator.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index dc3692d..b6480de 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -170,9 +170,7 @@ void DestroyUnusedCrtcs(Display* display, XRRScreenResources* screen, Window window, CrtcConfig* config1, - CrtcConfig* config2, - int width, - int height) { + CrtcConfig* config2) { // Setting the screen size will fail if any CRTC doesn't fit afterwards. // At the same time, turning CRTCs off and back on uses up a lot of time. // This function tries to be smart to avoid too many off/on cycles: @@ -203,8 +201,10 @@ void DestroyUnusedCrtcs(Display* display, // In case our CRTC doesn't fit in our current framebuffer, disable it. // It'll get reenabled after we resize the framebuffer. XRRModeInfo* mode_info = ModeInfoForID(screen, config.mode); - if (static_cast<int>(mode_info->width) > width || - static_cast<int>(mode_info->height) > height) { + int current_width = DisplayWidth(display, DefaultScreen(display)); + int current_height = DisplayHeight(display, DefaultScreen(display)); + if (static_cast<int>(mode_info->width) > current_width || + static_cast<int>(mode_info->height) > current_height) { config.mode = None; config.output = None; } @@ -225,7 +225,7 @@ void CreateFrameBuffer(Display* display, CrtcConfig* config2) { VLOG(1) << "CreateFrameBuffer " << width << " by " << height; - DestroyUnusedCrtcs(display, screen, window, config1, config2, width, height); + DestroyUnusedCrtcs(display, screen, window, config1, config2); int mm_width = width * kPixelsToMmScale; int mm_height = height * kPixelsToMmScale; |