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

Side by Side Diff: platform_tools/android/launcher/skia_launcher.cpp

Issue 753543003: Change how SkDebugf is sent to stdout on Android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comment. Created 6 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
« no previous file with comments | « gyp/apptype_console.gypi ('k') | src/ports/SkDebug_android.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // find the address of the main function 91 // find the address of the main function
92 int (*app_main)(int, const char**); 92 int (*app_main)(int, const char**);
93 *(void **) (&app_main) = dlsym(appLibrary, "main"); 93 *(void **) (&app_main) = dlsym(appLibrary, "main");
94 94
95 if (!app_main) { 95 if (!app_main) {
96 printf("ERROR: Unable to load the main function of the selected program. \n"); 96 printf("ERROR: Unable to load the main function of the selected program. \n");
97 printf("ERROR: %s\n", dlerror()); 97 printf("ERROR: %s\n", dlerror());
98 return -1; 98 return -1;
99 } 99 }
100 100
101 // find the address of the SkPrintToConsole function
102 void (*app_SkDebugToStdOut)(bool);
103 *(void **) (&app_SkDebugToStdOut) = dlsym(skiaLibrary, "AndroidSkDebugToStdO ut");
104
105 if (app_SkDebugToStdOut) {
106 (*app_SkDebugToStdOut)(true);
107 } else {
108 printf("WARNING: Unable to redirect output to the console.\n");
109 printf("WARNING: %s\n", dlerror());
110 }
111
112 // pass all additional arguments to the main function 101 // pass all additional arguments to the main function
113 return launch_app(app_main, argc - 1, ++argv); 102 return launch_app(app_main, argc - 1, ++argv);
114 } 103 }
OLDNEW
« no previous file with comments | « gyp/apptype_console.gypi ('k') | src/ports/SkDebug_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698