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

Side by Side Diff: shell/native_application_support.cc

Issue 1909133002: Add MGLEcho (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: git add Created 4 years, 8 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 | « mojo/public/platform/native/mgl_echo_thunks.c ('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 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 "shell/native_application_support.h" 5 #include "shell/native_application_support.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/public/platform/native/gles2_impl_chromium_bind_uniform_location_ thunks.h" 10 #include "mojo/public/platform/native/gles2_impl_chromium_bind_uniform_location_ thunks.h"
11 #include "mojo/public/platform/native/gles2_impl_chromium_map_sub_thunks.h" 11 #include "mojo/public/platform/native/gles2_impl_chromium_map_sub_thunks.h"
12 #include "mojo/public/platform/native/gles2_impl_chromium_miscellaneous_thunks.h " 12 #include "mojo/public/platform/native/gles2_impl_chromium_miscellaneous_thunks.h "
13 #include "mojo/public/platform/native/gles2_impl_chromium_resize_thunks.h" 13 #include "mojo/public/platform/native/gles2_impl_chromium_resize_thunks.h"
14 #include "mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.h" 14 #include "mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.h"
15 #include "mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks .h" 15 #include "mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks .h"
16 #include "mojo/public/platform/native/gles2_impl_ext_debug_marker_thunks.h" 16 #include "mojo/public/platform/native/gles2_impl_ext_debug_marker_thunks.h"
17 #include "mojo/public/platform/native/gles2_impl_ext_discard_framebuffer_thunks. h" 17 #include "mojo/public/platform/native/gles2_impl_ext_discard_framebuffer_thunks. h"
18 #include "mojo/public/platform/native/gles2_impl_ext_multisampled_render_to_text ure_thunks.h" 18 #include "mojo/public/platform/native/gles2_impl_ext_multisampled_render_to_text ure_thunks.h"
19 #include "mojo/public/platform/native/gles2_impl_ext_occlusion_query_thunks.h" 19 #include "mojo/public/platform/native/gles2_impl_ext_occlusion_query_thunks.h"
20 #include "mojo/public/platform/native/gles2_impl_ext_texture_storage_thunks.h" 20 #include "mojo/public/platform/native/gles2_impl_ext_texture_storage_thunks.h"
21 #include "mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thu nks.h" 21 #include "mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thu nks.h"
22 #include "mojo/public/platform/native/gles2_impl_oes_vertex_array_object_thunks. h" 22 #include "mojo/public/platform/native/gles2_impl_oes_vertex_array_object_thunks. h"
23 #include "mojo/public/platform/native/gles2_impl_thunks.h" 23 #include "mojo/public/platform/native/gles2_impl_thunks.h"
24 #include "mojo/public/platform/native/mgl_echo_thunks.h"
24 #include "mojo/public/platform/native/mgl_onscreen_thunks.h" 25 #include "mojo/public/platform/native/mgl_onscreen_thunks.h"
25 #include "mojo/public/platform/native/mgl_signal_sync_point_thunks.h" 26 #include "mojo/public/platform/native/mgl_signal_sync_point_thunks.h"
26 #include "mojo/public/platform/native/mgl_thunks.h" 27 #include "mojo/public/platform/native/mgl_thunks.h"
27 #include "mojo/public/platform/native/platform_handle_private_thunks.h" 28 #include "mojo/public/platform/native/platform_handle_private_thunks.h"
28 #include "mojo/public/platform/native/system_impl_private_thunks.h" 29 #include "mojo/public/platform/native/system_impl_private_thunks.h"
29 #include "mojo/public/platform/native/system_thunks.h" 30 #include "mojo/public/platform/native/system_thunks.h"
30 31
31 namespace shell { 32 namespace shell {
32 33
33 namespace { 34 namespace {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 SetThunks(MojoMakeGLES2ImplCHROMIUMMiscellaneousThunks, 115 SetThunks(MojoMakeGLES2ImplCHROMIUMMiscellaneousThunks,
115 "MojoSetGLES2ImplCHROMIUMMiscellaneousThunks", app_library); 116 "MojoSetGLES2ImplCHROMIUMMiscellaneousThunks", app_library);
116 SetThunks(MojoMakeGLES2ImplCHROMIUMResizeThunks, 117 SetThunks(MojoMakeGLES2ImplCHROMIUMResizeThunks,
117 "MojoSetGLES2ImplCHROMIUMResizeThunks", app_library); 118 "MojoSetGLES2ImplCHROMIUMResizeThunks", app_library);
118 SetThunks(MojoMakeGLES2ImplCHROMIUMSyncPointThunks, 119 SetThunks(MojoMakeGLES2ImplCHROMIUMSyncPointThunks,
119 "MojoSetGLES2ImplCHROMIUMSyncPointThunks", app_library); 120 "MojoSetGLES2ImplCHROMIUMSyncPointThunks", app_library);
120 SetThunks(MojoMakeGLES2ImplCHROMIUMTextureMailboxThunks, 121 SetThunks(MojoMakeGLES2ImplCHROMIUMTextureMailboxThunks,
121 "MojoSetGLES2ImplCHROMIUMTextureMailboxThunks", app_library); 122 "MojoSetGLES2ImplCHROMIUMTextureMailboxThunks", app_library);
122 123
123 if (SetThunks(MojoMakeMGLThunks, "MojoSetMGLThunks", app_library)) { 124 if (SetThunks(MojoMakeMGLThunks, "MojoSetMGLThunks", app_library)) {
125 SetThunks(MojoMakeMGLEchoThunks, "MojoSetMGLEchoThunks", app_library);
126
124 // TODO(jamesr): We should only need to expose the onscreen thunks to apps 127 // TODO(jamesr): We should only need to expose the onscreen thunks to apps
125 // that need to draw to the screen like the system compositor. 128 // that need to draw to the screen like the system compositor.
126 SetThunks(MojoMakeMGLOnscreenThunks, "MojoSetMGLOnscreenThunks", 129 SetThunks(MojoMakeMGLOnscreenThunks, "MojoSetMGLOnscreenThunks",
127 app_library); 130 app_library);
128 131
129 SetThunks(MojoMakeMGLSignalSyncPointThunks, 132 SetThunks(MojoMakeMGLSignalSyncPointThunks,
130 "MojoSetMGLSignalSyncPointThunks", app_library); 133 "MojoSetMGLSignalSyncPointThunks", app_library);
131 } 134 }
132 135
133 typedef MojoResult (*MojoMainFunction)(MojoHandle); 136 typedef MojoResult (*MojoMainFunction)(MojoHandle);
134 MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( 137 MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>(
135 base::GetFunctionPointerFromNativeLibrary(app_library, "MojoMain")); 138 base::GetFunctionPointerFromNativeLibrary(app_library, "MojoMain"));
136 if (!main_function) { 139 if (!main_function) {
137 LOG(ERROR) << "MojoMain not found"; 140 LOG(ERROR) << "MojoMain not found";
138 return false; 141 return false;
139 } 142 }
140 // |MojoMain()| takes ownership of the Application request handle. 143 // |MojoMain()| takes ownership of the Application request handle.
141 MojoHandle handle = application_request.PassMessagePipe().release().value(); 144 MojoHandle handle = application_request.PassMessagePipe().release().value();
142 MojoResult result = main_function(handle); 145 MojoResult result = main_function(handle);
143 LOG_IF(ERROR, result != MOJO_RESULT_OK) 146 LOG_IF(ERROR, result != MOJO_RESULT_OK)
144 << "MojoMain returned error (result: " << result << ")"; 147 << "MojoMain returned error (result: " << result << ")";
145 return true; 148 return true;
146 } 149 }
147 150
148 } // namespace shell 151 } // namespace shell
OLDNEW
« no previous file with comments | « mojo/public/platform/native/mgl_echo_thunks.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698