From eb80cbdc7faf7ca07ae3afb3d131714f43a8a8ad Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Fri, 1 Mar 2013 03:45:48 +0000 Subject: Don't reconfigure framebuffer if the size is the same BUG=none TEST=manual Review URL: https://chromiumcodereview.appspot.com/12380041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185447 0039d316-1c4b-4281-b951-d872f2087c98 --- chromeos/display/output_configurator.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'chromeos/display') diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index 8bb89bf..00c0f72 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -226,10 +226,15 @@ void CreateFrameBuffer(Display* display, CrtcConfig* config1, CrtcConfig* config2) { TRACE_EVENT0("chromeos", "OutputConfigurator::CreateFrameBuffer"); - VLOG(1) << "CreateFrameBuffer " << width << " by " << height; - DestroyUnusedCrtcs(display, screen, window, config1, config2); + int current_width = DisplayWidth(display, DefaultScreen(display)); + int current_height = DisplayHeight(display, DefaultScreen(display)); + VLOG(1) << "CreateFrameBuffer " << width << " x " << height + << " (current=" << current_width << " x " << current_height << ")"; + if (width == current_width && height == current_height) + return; + DestroyUnusedCrtcs(display, screen, window, config1, config2); int mm_width = width * kPixelsToMmScale; int mm_height = height * kPixelsToMmScale; XRRSetScreenSize(display, window, width, height, mm_width, mm_height); -- cgit v1.1