1 /*
2 * Copyright 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include <log/log.h>
18 #include <stdio.h>
19 #include <string.h>
20
21 namespace {
22 bool gSave = false;
23 }
24
25 namespace renderenginebench {
26
parseFlagsForHelp(int argc,char ** argv)27 void parseFlagsForHelp(int argc, char** argv) {
28 for (int i = 0; i < argc; i++) {
29 if (!strcmp(argv[i], "--help")) {
30 printf("RenderEngineBench-specific flags:\n");
31 printf("[--save]: Save the output to the device to confirm drawing result.\n");
32 break;
33 }
34 }
35 }
36
parseFlags(int argc,char ** argv)37 void parseFlags(int argc, char** argv) {
38 for (int i = 0; i < argc; i++) {
39 if (!strcmp(argv[i], "--save")) {
40 gSave = true;
41 }
42 }
43 }
44
save()45 bool save() {
46 return gSave;
47 }
48 } // namespace renderenginebench
49