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

Side by Side Diff: mojo/examples/sample_app/native_viewport_client_impl.cc

Issue 99323005: [Mojo] Fix race condition in sample_app's SwapBuffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/examples/sample_app/sample_gles2_delegate.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/examples/sample_app/native_viewport_client_impl.h" 5 #include "mojo/examples/sample_app/native_viewport_client_impl.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "mojo/public/bindings/gles2_client/gles2_client_impl.h" 9 #include "mojo/public/bindings/gles2_client/gles2_client_impl.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace examples { 12 namespace examples {
13 13
14 NativeViewportClientImpl::NativeViewportClientImpl(ScopedMessagePipeHandle pipe) 14 NativeViewportClientImpl::NativeViewportClientImpl(ScopedMessagePipeHandle pipe)
15 : service_(pipe.Pass()) { 15 : service_(pipe.Pass()) {
16 service_.SetPeer(this); 16 service_.SetPeer(this);
17 } 17 }
18 18
19 NativeViewportClientImpl::~NativeViewportClientImpl() { 19 NativeViewportClientImpl::~NativeViewportClientImpl() {
20 service_->Close();
20 } 21 }
21 22
22 void NativeViewportClientImpl::Open() { 23 void NativeViewportClientImpl::Open() {
23 service_->Open(); 24 service_->Open();
24 25
25 ScopedMessagePipeHandle gles2; 26 ScopedMessagePipeHandle gles2;
26 ScopedMessagePipeHandle gles2_client; 27 ScopedMessagePipeHandle gles2_client;
27 CreateMessagePipe(&gles2, &gles2_client); 28 CreateMessagePipe(&gles2, &gles2_client);
28 29
29 gles2_client_.reset(new GLES2ClientImpl(&gles2_delegate_, gles2.Pass())); 30 gles2_client_.reset(new GLES2ClientImpl(&gles2_delegate_, gles2.Pass()));
30 service_->CreateGLES2Context(gles2_client.release()); 31 service_->CreateGLES2Context(gles2_client.release());
31 } 32 }
32 33
33 void NativeViewportClientImpl::DidOpen() { 34 void NativeViewportClientImpl::DidOpen() {
34 } 35 }
35 36
36 } // namespace examples 37 } // namespace examples
37 } // namespace mojo 38 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/examples/sample_app/sample_gles2_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698