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

Side by Side Diff: ui/ozone/platform/wayland/wayland_output.cc

Issue 2027943002: [WIP] Make content_shell run under Wayland Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (09.28.2016)Rebase on master 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/wayland/wayland_output.h ('k') | ui/ozone/public/ozone_platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/wayland/wayland_output.h" 5 #include "ui/ozone/platform/wayland/wayland_output.h"
6 6
7 #include <wayland-client.h> 7 #include <wayland-client.h>
8 8
9 #include "ui/ozone/platform/wayland/wayland_connection.h" 9 #include "ui/ozone/platform/wayland/wayland_connection.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 WaylandOutput::WaylandOutput(wl_output* output) 13 WaylandOutput::WaylandOutput(wl_output* output, uint32_t name)
14 : output_(output), rect_(0, 0, 0, 0), observer_(nullptr) { 14 : output_(output), name_(name), rect_(0, 0, 0, 0) {
15 static const wl_output_listener output_listener = { 15 static const wl_output_listener output_listener = {
16 &WaylandOutput::OutputHandleGeometry, &WaylandOutput::OutputHandleMode, 16 &WaylandOutput::OutputHandleGeometry, &WaylandOutput::OutputHandleMode,
17 }; 17 };
18 wl_output_add_listener(output, &output_listener, this); 18 wl_output_add_listener(output, &output_listener, this);
19 } 19 }
20 20
21 WaylandOutput::~WaylandOutput() {} 21 WaylandOutput::~WaylandOutput() {}
22 22
23 // static 23 // static
24 void WaylandOutput::OutputHandleGeometry(void* data, 24 void WaylandOutput::OutputHandleGeometry(void* data,
(...skipping 16 matching lines...) Expand all
41 uint32_t flags, 41 uint32_t flags,
42 int32_t width, 42 int32_t width,
43 int32_t height, 43 int32_t height,
44 int32_t refresh) { 44 int32_t refresh) {
45 WaylandOutput* output = static_cast<WaylandOutput*>(data); 45 WaylandOutput* output = static_cast<WaylandOutput*>(data);
46 46
47 if (flags & WL_OUTPUT_MODE_CURRENT) { 47 if (flags & WL_OUTPUT_MODE_CURRENT) {
48 output->rect_.set_width(width); 48 output->rect_.set_width(width);
49 output->rect_.set_height(height); 49 output->rect_.set_height(height);
50 50
51 if (output->observer()) 51 if (!WaylandConnection::GetInstance())
52 output->observer()->OnOutputReadyForUse(); 52 return;
53
54 WaylandConnection::GetInstance()->OnOutputGeometryChanged(output->name_,
55 output->rect_);
53 } 56 }
54 } 57 }
55 58
56 } // namespace ui 59 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/wayland/wayland_output.h ('k') | ui/ozone/public/ozone_platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698