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

Unified Diff: services/ui/display/viewport_metrics.h

Issue 2434923002: Handle modified displays in mustash. (Closed)
Patch Set: Fix PlatformScreenStub for tests. Created 4 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 | « services/ui/display/platform_screen_stub.cc ('k') | services/ui/display/viewport_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/display/viewport_metrics.h
diff --git a/services/ui/display/viewport_metrics.h b/services/ui/display/viewport_metrics.h
new file mode 100644
index 0000000000000000000000000000000000000000..b8be4f00989c5dbce0dc41203aa95e37273a54df
--- /dev/null
+++ b/services/ui/display/viewport_metrics.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_
+#define SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_
+
+#include "ui/display/display.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace display {
+
+struct ViewportMetrics {
+ std::string ToString() const;
+
+ gfx::Rect bounds; // DIP.
+ gfx::Rect work_area; // DIP.
+ gfx::Size pixel_size;
+ Display::Rotation rotation = Display::ROTATE_0;
+ float device_scale_factor = 0.0f;
+};
+
+inline bool operator==(const ViewportMetrics& lhs, const ViewportMetrics& rhs) {
+ return lhs.bounds == rhs.bounds && lhs.work_area == rhs.work_area &&
+ lhs.pixel_size == rhs.pixel_size && lhs.rotation == rhs.rotation &&
+ lhs.device_scale_factor == rhs.device_scale_factor;
+}
+
+inline bool operator!=(const ViewportMetrics& lhs, const ViewportMetrics& rhs) {
+ return !(lhs == rhs);
+}
+
+} // namespace display
+
+#endif // SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_
« no previous file with comments | « services/ui/display/platform_screen_stub.cc ('k') | services/ui/display/viewport_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698