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

Side by Side Diff: mojo/public/platform/native/gles2_thunks.cc

Issue 428413002: Make async waiter explicit MojoGLES2CreateContext param (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/public/platform/native/gles2_thunks.h ('k') | mojo/services/surfaces/surfaces_impl.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 "mojo/public/platform/native/gles2_thunks.h" 5 #include "mojo/public/platform/native/gles2_thunks.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 8
9 #include "mojo/public/platform/native/thunk_export.h" 9 #include "mojo/public/platform/native/thunk_export.h"
10 10
11 extern "C" { 11 extern "C" {
12 12
13 static MojoGLES2ControlThunks g_control_thunks = {0}; 13 static MojoGLES2ControlThunks g_control_thunks = {0};
14 static MojoGLES2ImplThunks g_impl_thunks = {0}; 14 static MojoGLES2ImplThunks g_impl_thunks = {0};
15 15
16 void MojoGLES2Initialize(const MojoAsyncWaiter* async_waiter) { 16 MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle,
17 assert(g_control_thunks.GLES2Initialize); 17 MojoGLES2ContextLost lost_callback,
18 g_control_thunks.GLES2Initialize(async_waiter); 18 void* closure,
19 } 19 const MojoAsyncWaiter* async_waiter) {
20
21 void MojoGLES2Terminate() {
22 assert(g_control_thunks.GLES2Terminate);
23 g_control_thunks.GLES2Terminate();
24 }
25
26 MojoGLES2Context MojoGLES2CreateContext(
27 MojoHandle handle,
28 MojoGLES2ContextLost lost_callback,
29 void* closure) {
30 assert(g_control_thunks.GLES2CreateContext); 20 assert(g_control_thunks.GLES2CreateContext);
31 return g_control_thunks.GLES2CreateContext(handle, lost_callback, closure); 21 return g_control_thunks.GLES2CreateContext(
22 handle, lost_callback, closure, async_waiter);
32 } 23 }
33 24
34 void MojoGLES2DestroyContext(MojoGLES2Context context) { 25 void MojoGLES2DestroyContext(MojoGLES2Context context) {
35 assert(g_control_thunks.GLES2DestroyContext); 26 assert(g_control_thunks.GLES2DestroyContext);
36 g_control_thunks.GLES2DestroyContext(context); 27 g_control_thunks.GLES2DestroyContext(context);
37 } 28 }
38 29
39 void MojoGLES2MakeCurrent(MojoGLES2Context context) { 30 void MojoGLES2MakeCurrent(MojoGLES2Context context) {
40 assert(g_control_thunks.GLES2MakeCurrent); 31 assert(g_control_thunks.GLES2MakeCurrent);
41 g_control_thunks.GLES2MakeCurrent(context); 32 g_control_thunks.GLES2MakeCurrent(context);
(...skipping 30 matching lines...) Expand all
72 } 63 }
73 64
74 extern "C" THUNK_EXPORT size_t MojoSetGLES2ImplThunks( 65 extern "C" THUNK_EXPORT size_t MojoSetGLES2ImplThunks(
75 const MojoGLES2ImplThunks* gles2_impl_thunks) { 66 const MojoGLES2ImplThunks* gles2_impl_thunks) {
76 if (gles2_impl_thunks->size >= sizeof(g_impl_thunks)) 67 if (gles2_impl_thunks->size >= sizeof(g_impl_thunks))
77 g_impl_thunks = *gles2_impl_thunks; 68 g_impl_thunks = *gles2_impl_thunks;
78 return sizeof(g_impl_thunks); 69 return sizeof(g_impl_thunks);
79 } 70 }
80 71
81 } // extern "C" 72 } // extern "C"
OLDNEW
« no previous file with comments | « mojo/public/platform/native/gles2_thunks.h ('k') | mojo/services/surfaces/surfaces_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698