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

Unified Diff: services/ui/ws/display.cc

Issue 2161993002: Start using display.mojom.Display in mus+ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@display_traits
Patch Set: Formatting. Created 4 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
Index: services/ui/ws/display.cc
diff --git a/services/ui/ws/display.cc b/services/ui/ws/display.cc
index f733e83b6f0414ecf630f81bda5ae94e813fbbd1..c640c65f32a77d8448526f10d522a3122a669c32 100644
--- a/services/ui/ws/display.cc
+++ b/services/ui/ws/display.cc
@@ -5,6 +5,7 @@
#include "services/ui/ws/display.h"
#include <set>
+#include <utility>
#include <vector>
#include "base/debug/debugger.h"
@@ -80,25 +81,34 @@ const DisplayManager* Display::display_manager() const {
return window_server_->display_manager();
}
-mojom::DisplayPtr Display::ToMojomDisplay() const {
- mojom::DisplayPtr display_ptr = mojom::Display::New();
- display_ptr = mojom::Display::New();
- display_ptr->id = id_;
- // TODO(sky): Display should know it's origin.
- display_ptr->bounds.SetRect(0, 0, root_->bounds().size().width(),
- root_->bounds().size().height());
- // TODO(sky): window manager needs an API to set the work area.
- display_ptr->work_area = display_ptr->bounds;
- display_ptr->device_pixel_ratio = platform_display_->GetDeviceScaleFactor();
- display_ptr->rotation = platform_display_->GetRotation();
+mojom::WmDisplayPtr Display::ToWmDisplay() const {
+ mojom::WmDisplayPtr display_ptr = mojom::WmDisplay::New();
+
+ display_ptr->display = ToDisplay();
+
// TODO(sky): make this real.
display_ptr->is_primary = true;
// TODO(sky): make this real.
- display_ptr->touch_support = mojom::TouchSupport::UNKNOWN;
display_ptr->frame_decoration_values = mojom::FrameDecorationValues::New();
return display_ptr;
}
+::display::Display Display::ToDisplay() const {
+ ::display::Display display(id_);
+
+ // TODO(sky): Display should know it's origin.
Tom Sepez 2016/07/19 16:22:25 nit: its
kylechar 2016/07/19 18:55:20 Done.
+ display.set_bounds(gfx::Rect(0, 0, root_->bounds().size().width(),
+ root_->bounds().size().height()));
+ // TODO(sky): window manager needs an API to set the work area.
+ display.set_work_area(display.bounds());
+ display.set_device_scale_factor(platform_display_->GetDeviceScaleFactor());
+ display.set_rotation(platform_display_->GetRotation());
+ display.set_touch_support(
+ ::display::Display::TouchSupport::TOUCH_SUPPORT_UNKNOWN);
+
+ return display;
+}
+
void Display::SchedulePaint(const ServerWindow* window,
const gfx::Rect& bounds) {
DCHECK(root_->Contains(window));
@@ -116,7 +126,7 @@ void Display::ScheduleSurfaceDestruction(ServerWindow* window) {
window->AddObserver(this);
}
-mojom::Rotation Display::GetRotation() const {
+::display::Display::Rotation Display::GetRotation() const {
return platform_display_->GetRotation();
}

Powered by Google App Engine
This is Rietveld 408576698