| OLD | NEW |
| 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_miscellaneous_thunks.h
" | 10 #include "mojo/public/platform/native/gles2_impl_chromium_miscellaneous_thunks.h
" |
| 11 #include "mojo/public/platform/native/gles2_impl_chromium_resize_thunks.h" |
| 11 #include "mojo/public/platform/native/gles2_impl_chromium_sub_image_thunks.h" | 12 #include "mojo/public/platform/native/gles2_impl_chromium_sub_image_thunks.h" |
| 12 #include "mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.h" | 13 #include "mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.h" |
| 13 #include "mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks
.h" | 14 #include "mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks
.h" |
| 14 #include "mojo/public/platform/native/gles2_impl_occlusion_query_ext_thunks.h" | 15 #include "mojo/public/platform/native/gles2_impl_occlusion_query_ext_thunks.h" |
| 15 #include "mojo/public/platform/native/gles2_impl_thunks.h" | 16 #include "mojo/public/platform/native/gles2_impl_thunks.h" |
| 16 #include "mojo/public/platform/native/gles2_thunks.h" | 17 #include "mojo/public/platform/native/gles2_thunks.h" |
| 17 #include "mojo/public/platform/native/system_impl_private_thunks.h" | 18 #include "mojo/public/platform/native/system_impl_private_thunks.h" |
| 18 #include "mojo/public/platform/native/system_thunks.h" | 19 #include "mojo/public/platform/native/system_thunks.h" |
| 19 | 20 |
| 20 namespace shell { | 21 namespace shell { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 if (!SetThunks(&MojoMakeGLES2ImplThunks, "MojoSetGLES2ImplThunks", | 78 if (!SetThunks(&MojoMakeGLES2ImplThunks, "MojoSetGLES2ImplThunks", |
| 78 app_library)) { | 79 app_library)) { |
| 79 LOG(ERROR) | 80 LOG(ERROR) |
| 80 << "MojoSetGLES2ControlThunks found, but not MojoSetGLES2ImplThunks"; | 81 << "MojoSetGLES2ControlThunks found, but not MojoSetGLES2ImplThunks"; |
| 81 return false; | 82 return false; |
| 82 } | 83 } |
| 83 | 84 |
| 84 // If the application is using GLES2 extension points, register those | 85 // If the application is using GLES2 extension points, register those |
| 85 // thunks. Applications may use or not use any of these, so don't warn if | 86 // thunks. Applications may use or not use any of these, so don't warn if |
| 86 // they are missing. | 87 // they are missing. |
| 88 SetThunks(MojoMakeGLES2ImplOcclusionQueryExtThunks, |
| 89 "MojoSetGLES2ImplOcclusionQueryExtThunks", app_library); |
| 90 // "Chromium" extensions: |
| 87 SetThunks(MojoMakeGLES2ImplChromiumMiscellaneousThunks, | 91 SetThunks(MojoMakeGLES2ImplChromiumMiscellaneousThunks, |
| 88 "MojoSetGLES2ImplChromiumMiscellaneousThunks", app_library); | 92 "MojoSetGLES2ImplChromiumMiscellaneousThunks", app_library); |
| 93 SetThunks(MojoMakeGLES2ImplChromiumResizeThunks, |
| 94 "MojoSetGLES2ImplChromiumResizeThunks", app_library); |
| 89 SetThunks(MojoMakeGLES2ImplChromiumSubImageThunks, | 95 SetThunks(MojoMakeGLES2ImplChromiumSubImageThunks, |
| 90 "MojoSetGLES2ImplChromiumSubImageThunks", app_library); | 96 "MojoSetGLES2ImplChromiumSubImageThunks", app_library); |
| 97 SetThunks(MojoMakeGLES2ImplChromiumSyncPointThunks, |
| 98 "MojoSetGLES2ImplChromiumSyncPointThunks", app_library); |
| 91 SetThunks(MojoMakeGLES2ImplChromiumTextureMailboxThunks, | 99 SetThunks(MojoMakeGLES2ImplChromiumTextureMailboxThunks, |
| 92 "MojoSetGLES2ImplChromiumTextureMailboxThunks", app_library); | 100 "MojoSetGLES2ImplChromiumTextureMailboxThunks", app_library); |
| 93 SetThunks(MojoMakeGLES2ImplChromiumSyncPointThunks, | |
| 94 "MojoSetGLES2ImplChromiumSyncPointThunks", app_library); | |
| 95 SetThunks(MojoMakeGLES2ImplOcclusionQueryExtThunks, | |
| 96 "MojoSetGLES2ImplOcclusionQueryExtThunks", app_library); | |
| 97 } | 101 } |
| 98 // Unlike system thunks, we don't warn on a lack of GLES2 thunks because | 102 // Unlike system thunks, we don't warn on a lack of GLES2 thunks because |
| 99 // not everything is a visual app. | 103 // not everything is a visual app. |
| 100 | 104 |
| 101 // Go shared library support requires us to initialize the runtime before we | 105 // Go shared library support requires us to initialize the runtime before we |
| 102 // start running any go code. This is a temporary patch. | 106 // start running any go code. This is a temporary patch. |
| 103 typedef void (*InitGoRuntimeFn)(); | 107 typedef void (*InitGoRuntimeFn)(); |
| 104 InitGoRuntimeFn init_go_runtime = reinterpret_cast<InitGoRuntimeFn>( | 108 InitGoRuntimeFn init_go_runtime = reinterpret_cast<InitGoRuntimeFn>( |
| 105 base::GetFunctionPointerFromNativeLibrary(app_library, "InitGoRuntime")); | 109 base::GetFunctionPointerFromNativeLibrary(app_library, "InitGoRuntime")); |
| 106 if (init_go_runtime) { | 110 if (init_go_runtime) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 117 } | 121 } |
| 118 // |MojoMain()| takes ownership of the Application request handle. | 122 // |MojoMain()| takes ownership of the Application request handle. |
| 119 MojoHandle handle = application_request.PassMessagePipe().release().value(); | 123 MojoHandle handle = application_request.PassMessagePipe().release().value(); |
| 120 MojoResult result = main_function(handle); | 124 MojoResult result = main_function(handle); |
| 121 LOG_IF(ERROR, result != MOJO_RESULT_OK) | 125 LOG_IF(ERROR, result != MOJO_RESULT_OK) |
| 122 << "MojoMain returned error (result: " << result << ")"; | 126 << "MojoMain returned error (result: " << result << ")"; |
| 123 return true; | 127 return true; |
| 124 } | 128 } |
| 125 | 129 |
| 126 } // namespace shell | 130 } // namespace shell |
| OLD | NEW |