Chromium Code Reviews| Index: ui/ozone/platform/dri/dri_window_delegate_proxy.cc |
| diff --git a/ui/ozone/platform/dri/dri_window_delegate_proxy.cc b/ui/ozone/platform/dri/dri_window_delegate_proxy.cc |
| index 297bbd7fd1973fb0908c897fcce7c701af60db7a..2d6776082fb2df4fa4a9744b09ead5214b9456de 100644 |
| --- a/ui/ozone/platform/dri/dri_window_delegate_proxy.cc |
| +++ b/ui/ozone/platform/dri/dri_window_delegate_proxy.cc |
| @@ -12,18 +12,20 @@ namespace ui { |
| DriWindowDelegateProxy::DriWindowDelegateProxy( |
| gfx::AcceleratedWidget widget, |
| GpuPlatformSupportHostGbm* sender) |
| - : widget_(widget), sender_(sender) { |
| + : widget_(widget), sender_(sender), has_connection_(false) { |
| } |
| DriWindowDelegateProxy::~DriWindowDelegateProxy() { |
| } |
| void DriWindowDelegateProxy::Initialize() { |
| - bool status = sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_)); |
| - DCHECK(status); |
| + TRACE_EVENT1("dri", "DriWindowDelegateProxy::Initialize", "widget", widget_); |
|
dnicoara
2014/08/29 22:36:48
Can I now remove the Initialize/Shutdown functions
alexst (slow to review)
2014/09/02 13:37:07
Init can go, but shutdown still sends an IPC.
dnicoara
2014/09/03 17:17:25
I like the symmetry so I'm going to leave it then.
|
| + sender_->AddChannelObserver(this); |
| } |
| void DriWindowDelegateProxy::Shutdown() { |
| + TRACE_EVENT1("dri", "DriWindowDelegateProxy::Shutdown", "widget", widget_); |
| + sender_->RemoveChannelObserver(this); |
| bool status = sender_->Send(new OzoneGpuMsg_DestroyWindowDelegate(widget_)); |
|
alexst (slow to review)
2014/09/02 13:37:07
Is it possible to not have a connection here? Some
dnicoara
2014/09/03 17:17:25
Done.
|
| DCHECK(status); |
| } |
| @@ -38,9 +40,30 @@ HardwareDisplayController* DriWindowDelegateProxy::GetController() { |
| } |
| void DriWindowDelegateProxy::OnBoundsChanged(const gfx::Rect& bounds) { |
| + TRACE_EVENT1( |
| + "dri", "DriWindowDelegateProxy::OnBoundsChanged", "widget", widget_); |
| + bounds_ = bounds; |
| + if (!has_connection_) |
| + return; |
| + |
| bool status = |
| sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds)); |
| DCHECK(status); |
| } |
| +void DriWindowDelegateProxy::OnChannelEstablished() { |
| + TRACE_EVENT1( |
| + "dri", "DriWindowDelegateProxy::OnChannelEstablished", "widget", widget_); |
| + has_connection_ = true; |
| + bool status = sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_)); |
| + DCHECK(status); |
| + OnBoundsChanged(bounds_); |
| +} |
| + |
| +void DriWindowDelegateProxy::OnChannelDestroyed() { |
| + TRACE_EVENT1( |
| + "dri", "DriWindowDelegateProxy::OnChannelDestroyed", "widget", widget_); |
| + has_connection_ = false; |
| +} |
| + |
| } // namespace ui |