diff options
author | ynovikov@chromium.org <ynovikov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 22:56:34 +0000 |
---|---|---|
committer | ynovikov@chromium.org <ynovikov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 22:56:34 +0000 |
commit | 7cd27661306f00f0a3d86945317ba7226dc0c07e (patch) | |
tree | 001a8924fdab02d52f1250448fbbf86aeff07d0c /chromeos/display/output_configurator.h | |
parent | bcd32b1077eb4a311d5c45092c1eb98a68bc1edf (diff) | |
download | chromium_src-7cd27661306f00f0a3d86945317ba7226dc0c07e.zip chromium_src-7cd27661306f00f0a3d86945317ba7226dc0c07e.tar.gz chromium_src-7cd27661306f00f0a3d86945317ba7226dc0c07e.tar.bz2 |
Prefer aspect ratio preserving mirror mode, use panel fitting when possible.
Previously, the resolution chosen for mirror mode would be
the highest common resolution among the internal and external displays.
This would often fall back to the 1024x768 case,
which looks bad on wide displays and internal panels.
Now, external display resolutions with display's native aspect ratio
will be considered first for mirror mode,
trying to create a matching internal display resolution using panel fitting,
when possible, if one doesn't exist already.
For that sake, this commit also enables panel fitting on SNB.
In case of 2 external monitors, mirror mode will first try to find
a common resolution which will preserve aspect ratio on at least one of them.
If an aspect ratio preserving resolution has not been found,
fall back to the existing solution of highest common resolution.
BUG=chrome-os-partner:16384
TEST=For the displays in bug report, mirror mode resolution is 1280x720.
Review URL: https://chromiumcodereview.appspot.com/11411304
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171877 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/display/output_configurator.h')
-rw-r--r-- | chromeos/display/output_configurator.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h index df5f638..b52a4b6 100644 --- a/chromeos/display/output_configurator.h +++ b/chromeos/display/output_configurator.h @@ -110,23 +110,28 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { OutputSnapshot* one, OutputSnapshot* two); - // Should be called if the internal (built-in) output didn't advertise a mode - // which would be capable to support mirror mode. - // Relies on hardware panel fitting support, - // returns immediately if it is not available. - // Tries to add the native mode of the external output to the internal output, - // assuming panel fitter hardware will take care of scaling and letterboxing. - // The RROutput IDs |output_one| and |output_two| are used - // to look up the modes and configure the internal output, - // |output_one_mode| and |output_two_mode| are the out-parameters - // for the modes on the two outputs which will have same resolution. - // Returns false if it fails to configure the internal output appropriately. - bool AddMirrorModeToInternalOutput(Display* display, - XRRScreenResources* screen, - RROutput output_one, - RROutput output_two, - RRMode* output_one_mode, - RRMode* output_two_mode); + // Looks for a mode on internal and external outputs having same resolution. + // |display| and |screen| parameters are needed for some XRandR calls. + // |internal_info| and |external_info| are used to search for the modes. + // |internal_output_id| is used to create a new mode, if applicable. + // |try_creating|=true will enable creating panel-fitting mode + // on the |internal_info| output instead of + // only searching for a matching mode. Note: it may lead to a crash, + // if |internal_info| is not capable of panel fitting. + // |preserve_aspect|=true will limit the search / creation + // only to the modes having the native aspect ratio of |external_info|. + // |internal_mirror_mode| and |external_mirror_mode| are the out-parameters + // for the modes on the two outputs which will have the same resolution. + // Returns false if no mode appropriate for mirroring has been found/created. + bool FindOrCreateMirrorMode(Display* display, + XRRScreenResources* screen, + XRROutputInfo* internal_info, + XRROutputInfo* external_info, + RROutput internal_output_id, + bool try_creating, + bool preserve_aspect, + RRMode* internal_mirror_mode, + RRMode* external_mirror_mode); // Tells if the output specified by |output_info| is for internal display. static bool IsInternalOutput(const XRROutputInfo* output_info); |