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

Side by Side Diff: services/native_viewport/onscreen_context_provider.cc

Issue 1161533005: Fix crash when backgrounding MojoShell on Android. Fixes issue #186. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « services/gles2/command_buffer_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/native_viewport/onscreen_context_provider.h" 5 #include "services/native_viewport/onscreen_context_provider.h"
6 6
7 #include "services/gles2/command_buffer_driver.h" 7 #include "services/gles2/command_buffer_driver.h"
8 #include "services/gles2/gpu_state.h" 8 #include "services/gles2/gpu_state.h"
9 9
10 namespace native_viewport { 10 namespace native_viewport {
(...skipping 14 matching lines...) Expand all
25 void OnscreenContextProvider::Bind( 25 void OnscreenContextProvider::Bind(
26 mojo::InterfaceRequest<mojo::ContextProvider> request) { 26 mojo::InterfaceRequest<mojo::ContextProvider> request) {
27 binding_.Bind(request.Pass()); 27 binding_.Bind(request.Pass());
28 } 28 }
29 29
30 void OnscreenContextProvider::SetAcceleratedWidget( 30 void OnscreenContextProvider::SetAcceleratedWidget(
31 gfx::AcceleratedWidget widget) { 31 gfx::AcceleratedWidget widget) {
32 widget_ = widget; 32 widget_ = widget;
33 33
34 if (widget_ == gfx::kNullAcceleratedWidget) { 34 if (widget_ == gfx::kNullAcceleratedWidget) {
35 if (command_buffer_impl_) 35 if (command_buffer_impl_) {
36 command_buffer_impl_->DidLoseContext(); 36 command_buffer_impl_->DidLoseContext();
37 }
37 return; 38 return;
38 } 39 }
39 40
40 if (pending_create_callback_.is_null()) 41 if (pending_create_callback_.is_null())
41 return; 42 return;
42 43
43 CreateAndReturnCommandBuffer(); 44 CreateAndReturnCommandBuffer();
44 } 45 }
45 46
46 void OnscreenContextProvider::Create( 47 void OnscreenContextProvider::Create(
(...skipping 22 matching lines...) Expand all
69 state_->sync_point_manager(), 70 state_->sync_point_manager(),
70 make_scoped_ptr(new gles2::CommandBufferDriver( 71 make_scoped_ptr(new gles2::CommandBufferDriver(
71 widget_, state_->share_group(), state_->mailbox_manager(), 72 widget_, state_->share_group(), state_->mailbox_manager(),
72 state_->sync_point_manager()))); 73 state_->sync_point_manager())));
73 command_buffer_impl_->set_observer(this); 74 command_buffer_impl_->set_observer(this);
74 pending_create_callback_.Run(cb.Pass()); 75 pending_create_callback_.Run(cb.Pass());
75 pending_create_callback_.reset(); 76 pending_create_callback_.reset();
76 } 77 }
77 78
78 } // namespace mojo 79 } // namespace mojo
OLDNEW
« no previous file with comments | « services/gles2/command_buffer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698