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

Side by Side Diff: client/deps/glbench/src/utils.cc

Issue 1732030: Replaced funky state machines with classes. This is in preparation of doing the same to gl_Bench. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: Got rid of static test list initialization, fixed USE_EGL. Created 10 years, 7 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 | « client/deps/glbench/src/utils.h ('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 (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 <fcntl.h> 5 #include <fcntl.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 #include <sys/mman.h> 8 #include <sys/mman.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 *length = sb.st_size; 44 *length = sb.st_size;
45 45
46 return mmap_ptr; 46 return mmap_ptr;
47 } 47 }
48 48
49 49
50 static void print_info_log(int obj) 50 static void print_info_log(int obj)
51 { 51 {
52 char info_log[4096]; 52 char info_log[4096];
53 int length; 53 int length;
54 glGetInfoLogARB(obj, sizeof(info_log)-1, &length, info_log); 54 glGetError();
55 glGetShaderInfoLog(obj, sizeof(info_log)-1, &length, info_log);
56 if (glGetError() != 0)
57 glGetProgramInfoLog(obj, sizeof(info_log)-1, &length, info_log);
55 char *p = info_log; 58 char *p = info_log;
56 while (p < info_log + length) { 59 while (p < info_log + length) {
57 char *newline = strchr(p, '\n'); 60 char *newline = strchr(p, '\n');
58 if (newline) 61 if (newline)
59 *newline = '\0'; 62 *newline = '\0';
60 printf("# Log: %s\n", p); 63 printf("# Log: %s\n", p);
61 if (!newline) 64 if (!newline)
62 break; 65 break;
63 p = newline + 1; 66 p = newline + 1;
64 } 67 }
(...skipping 17 matching lines...) Expand all
82 glAttachShader(program, fragment_shader); 85 glAttachShader(program, fragment_shader);
83 glLinkProgram(program); 86 glLinkProgram(program);
84 print_info_log(program); 87 print_info_log(program);
85 glUseProgram(program); 88 glUseProgram(program);
86 89
87 glDeleteShader(vertex_shader); 90 glDeleteShader(vertex_shader);
88 glDeleteShader(fragment_shader); 91 glDeleteShader(fragment_shader);
89 92
90 return program; 93 return program;
91 } 94 }
OLDNEW
« no previous file with comments | « client/deps/glbench/src/utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698