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

Unified Diff: mojo/shell/in_process_dynamic_service_runner.cc

Issue 413303002: mojo: Convert gles2 to the new thunking system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split the set of thunks in two. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« mojo/public/platform/native/gles2_thunks.cc ('K') | « mojo/shell/context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/in_process_dynamic_service_runner.cc
diff --git a/mojo/shell/in_process_dynamic_service_runner.cc b/mojo/shell/in_process_dynamic_service_runner.cc
index 3bfb163462ce500a29cc80b8d3d235397d6ea136..8450fbd50eef805c9567736a61e0945aa83a9aaa 100644
--- a/mojo/shell/in_process_dynamic_service_runner.cc
+++ b/mojo/shell/in_process_dynamic_service_runner.cc
@@ -9,6 +9,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "mojo/public/platform/native/gles2_thunks.h"
#include "mojo/public/platform/native/system_thunks.h"
namespace mojo {
@@ -86,6 +87,50 @@ void InProcessDynamicServiceRunner::Run() {
#endif
}
+ MojoSetGLES2ControlThunksFn mojo_set_gles2_control_thunks_fn =
+ reinterpret_cast<MojoSetGLES2ControlThunksFn>(
+ app_library_.GetFunctionPointer("MojoSetGLES2ControlThunks"));
+ if (mojo_set_gles2_control_thunks_fn) {
+ MojoGLES2ControlThunks gles2_control_thunks =
+ MojoMakeGLES2ControlThunks();
+ size_t expected_size = mojo_set_gles2_control_thunks_fn(
+ &gles2_control_thunks);
+ if (expected_size > sizeof(MojoGLES2ControlThunks)) {
+ LOG(ERROR)
+ << "Invalid app library: expected MojoGLES2ControlThunks size: "
+ << expected_size;
+ break;
+ }
+
+ // If we have the control thunks, we probably also have the
+ // GLES2 implementation thunks.
+ MojoSetGLES2ImplThunksFn mojo_set_gles2_impl_thunks_fn =
+ reinterpret_cast<MojoSetGLES2ImplThunksFn>(
+ app_library_.GetFunctionPointer("MojoSetGLES2ImplThunks"));
+ if (mojo_set_gles2_impl_thunks_fn) {
+ MojoGLES2ImplThunks gles2_impl_thunks =
+ MojoMakeGLES2ImplThunks();
+ size_t expected_size = mojo_set_gles2_impl_thunks_fn(
+ &gles2_impl_thunks);
+ if (expected_size > sizeof(MojoGLES2ImplThunks)) {
+ LOG(ERROR)
+ << "Invalid app library: expected MojoGLES2ImplThunks size: "
+ << expected_size;
+ break;
+ }
+ } else {
+ // In the component build, Mojo Apps link against mojo_gles2_impl.
+#if !defined(COMPONENT_BUILD)
+ // Warn on this really weird case: The library requires the GLES2
+ // control functions, but doesn't require the GLES2 implementation.
+ LOG(WARNING) << "App library has MojoSetGLES2ControlThunks, but "
+ << "doesn't have MojoSetGLES2ImplThunks.";
viettrungluu 2014/07/29 00:27:06 No need for extra <<.
+#endif
+ }
+ }
+ // Unlike system thunks, we don't warn on a lack of GLES2 thunks because
+ // not everything is a visual app.
+
typedef MojoResult (*MojoMainFunction)(MojoHandle);
MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>(
app_library_.GetFunctionPointer("MojoMain"));
« mojo/public/platform/native/gles2_thunks.cc ('K') | « mojo/shell/context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698