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

Unified Diff: chromeos/display/output_util.h

Issue 21297003: Add ability to set resolution on external display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adraddressed comment, adjusted test Created 7 years, 5 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 | « chromeos/display/output_configurator_unittest.cc ('k') | chromeos/display/output_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_util.h
diff --git a/chromeos/display/output_util.h b/chromeos/display/output_util.h
index 345759df927fb07e054f445867c02d127bf78252..d464ba6241d8b878e5c9127e165639d27764d011 100644
--- a/chromeos/display/output_util.h
+++ b/chromeos/display/output_util.h
@@ -13,6 +13,13 @@
// Forward declarations for Xlib and Xrandr.
// This is so unused X definitions don't pollute the namespace.
typedef unsigned long XID;
+typedef XID RRMode;
+struct _XRRModeInfo;
+typedef _XRRModeInfo XRRModeInfo;
+struct _XRRScreenResources;
+typedef _XRRScreenResources XRRScreenResources;
+struct _XRROutputInfo;
+typedef _XRROutputInfo XRROutputInfo;
namespace chromeos {
@@ -57,6 +64,32 @@ CHROMEOS_EXPORT bool ParseOutputOverscanFlag(const unsigned char* prop,
// Returns true if an output named |name| is an internal display.
CHROMEOS_EXPORT bool IsInternalOutputName(const std::string& name);
+// Find a XRRModeInfo that matches |mode|.
+CHROMEOS_EXPORT const XRRModeInfo* FindModeInfo(
+ const XRRScreenResources* screen_resources,
+ XID mode);
+
+// Find a mode that matches the given size with highest refresh
+// rate. Non-interlaced mode takes precedence, so non-interlaced mode
+// with a lower refresh rate will be used even if there is an interlaced
+// mode with a higher refresh rate.
+CHROMEOS_EXPORT RRMode FindOutputModeMatchingSize(
+ const XRRScreenResources* screen_resources,
+ const XRROutputInfo* output_info,
+ size_t width,
+ size_t height);
+
+namespace test {
+
+// Creates XRRModeInfo for unit tests.
+CHROMEOS_EXPORT XRRModeInfo CreateModeInfo(int id,
+ int width,
+ int height,
+ bool interlaced,
+ float refresh_rate);
+
+} // namespace test
+
} // namespace chromeos
#endif // CHROMEOS_DISPLAY_OUTPUT_UTIL_H_
« no previous file with comments | « chromeos/display/output_configurator_unittest.cc ('k') | chromeos/display/output_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698