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

Unified Diff: ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 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: ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc
diff --git a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc
index 47f9f4f95e7b94ac2013f58c53f18ff0118de380..002dcf6002e4212ee6d70e4dd7ebbb53fbf4f0cc 100644
--- a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc
+++ b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc
@@ -10,11 +10,11 @@
namespace ui {
DrmGpuPlatformSupportHost::DrmGpuPlatformSupportHost(DrmCursor* cursor)
- : display_manager_(nullptr),
- window_manager_(nullptr),
- cursor_(cursor),
- delegate_(nullptr) {
-}
+ : connected_(false),
+ display_manager_(nullptr),
+ window_manager_(nullptr),
+ cursor_(cursor),
+ delegate_(nullptr) {}
DrmGpuPlatformSupportHost::~DrmGpuPlatformSupportHost() {
}
@@ -24,7 +24,7 @@ void DrmGpuPlatformSupportHost::SetDisplayManager(
DCHECK(!display_manager_);
display_manager_ = display_manager;
if (IsConnected()) {
- display_manager_->OnChannelEstablished(host_id_);
+ display_manager_->OnChannelEstablished();
}
}
@@ -47,17 +47,17 @@ void DrmGpuPlatformSupportHost::RemoveChannelObserver(
}
bool DrmGpuPlatformSupportHost::IsConnected() {
- return host_id_ >= 0;
+ return connected_;
}
void DrmGpuPlatformSupportHost::OnChannelEstablished(int host_id) {
TRACE_EVENT1("drm", "DrmGpuPlatformSupportHost::OnChannelEstablished",
"host_id", host_id);
- host_id_ = host_id;
+ connected_ = true;
if (display_manager_) {
- display_manager_->OnChannelEstablished(host_id_);
+ display_manager_->OnChannelEstablished();
}
FOR_EACH_OBSERVER(ChannelObserver, channel_observers_,
@@ -68,8 +68,8 @@ void DrmGpuPlatformSupportHost::OnChannelDestroyed(int host_id) {
TRACE_EVENT1("drm", "DrmGpuPlatformSupportHost::OnChannelDestroyed",
"host_id", host_id);
- if (host_id_ == host_id) {
- host_id_ = -1;
+ if (connected_) {
+ connected_ = false;
FOR_EACH_OBSERVER(ChannelObserver, channel_observers_,
OnChannelDestroyed());
}
« no previous file with comments | « ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h ('k') | ui/ozone/platform/drm/mojo/drm_gpu_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698