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

Side by Side Diff: ui/ozone/platform/dri/dri_window_delegate_proxy.cc

Issue 522463005: [Ozone-GBM] Handle GPU crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reland of: [Ozone-GBM] Handle GPU crashes Created 6 years, 3 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/dri/dri_window_delegate_proxy.h ('k') | ui/ozone/platform/dri/dri_wrapper.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/dri/dri_window_delegate_proxy.h" 5 #include "ui/ozone/platform/dri/dri_window_delegate_proxy.h"
6 6
7 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" 7 #include "ui/ozone/common/gpu/ozone_gpu_messages.h"
8 #include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h" 8 #include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 DriWindowDelegateProxy::DriWindowDelegateProxy( 12 DriWindowDelegateProxy::DriWindowDelegateProxy(
13 gfx::AcceleratedWidget widget, 13 gfx::AcceleratedWidget widget,
14 GpuPlatformSupportHostGbm* sender) 14 GpuPlatformSupportHostGbm* sender)
15 : widget_(widget), sender_(sender) { 15 : widget_(widget), sender_(sender), has_connection_(false) {
16 } 16 }
17 17
18 DriWindowDelegateProxy::~DriWindowDelegateProxy() { 18 DriWindowDelegateProxy::~DriWindowDelegateProxy() {
19 } 19 }
20 20
21 void DriWindowDelegateProxy::Initialize() { 21 void DriWindowDelegateProxy::Initialize() {
22 bool status = sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_)); 22 TRACE_EVENT1("dri", "DriWindowDelegateProxy::Initialize", "widget", widget_);
23 DCHECK(status); 23 sender_->AddChannelObserver(this);
24 } 24 }
25 25
26 void DriWindowDelegateProxy::Shutdown() { 26 void DriWindowDelegateProxy::Shutdown() {
27 TRACE_EVENT1("dri", "DriWindowDelegateProxy::Shutdown", "widget", widget_);
28 sender_->RemoveChannelObserver(this);
29 if (!has_connection_)
30 return;
31
27 bool status = sender_->Send(new OzoneGpuMsg_DestroyWindowDelegate(widget_)); 32 bool status = sender_->Send(new OzoneGpuMsg_DestroyWindowDelegate(widget_));
28 DCHECK(status); 33 DCHECK(status);
29 } 34 }
30 35
31 gfx::AcceleratedWidget DriWindowDelegateProxy::GetAcceleratedWidget() { 36 gfx::AcceleratedWidget DriWindowDelegateProxy::GetAcceleratedWidget() {
32 return widget_; 37 return widget_;
33 } 38 }
34 39
35 HardwareDisplayController* DriWindowDelegateProxy::GetController() { 40 HardwareDisplayController* DriWindowDelegateProxy::GetController() {
36 NOTREACHED(); 41 NOTREACHED();
37 return NULL; 42 return NULL;
38 } 43 }
39 44
40 void DriWindowDelegateProxy::OnBoundsChanged(const gfx::Rect& bounds) { 45 void DriWindowDelegateProxy::OnBoundsChanged(const gfx::Rect& bounds) {
46 TRACE_EVENT2("dri",
47 "DriWindowDelegateProxy::OnBoundsChanged",
48 "widget",
49 widget_,
50 "bounds",
51 bounds.ToString());
52 bounds_ = bounds;
53 if (!has_connection_)
54 return;
55
41 bool status = 56 bool status =
42 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds)); 57 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds));
43 DCHECK(status); 58 DCHECK(status);
44 } 59 }
45 60
61 void DriWindowDelegateProxy::OnChannelEstablished() {
62 TRACE_EVENT1(
63 "dri", "DriWindowDelegateProxy::OnChannelEstablished", "widget", widget_);
64 has_connection_ = true;
65 bool status = sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_));
66 DCHECK(status);
67 OnBoundsChanged(bounds_);
68 }
69
70 void DriWindowDelegateProxy::OnChannelDestroyed() {
71 TRACE_EVENT1(
72 "dri", "DriWindowDelegateProxy::OnChannelDestroyed", "widget", widget_);
73 has_connection_ = false;
74 }
75
46 } // namespace ui 76 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_window_delegate_proxy.h ('k') | ui/ozone/platform/dri/dri_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698