OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "nanobench.h" | 10 #include "nanobench.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 SkGLContext* gl; | 149 SkGLContext* gl; |
150 | 150 |
151 void setup() override { | 151 void setup() override { |
152 this->gl->makeCurrent(); | 152 this->gl->makeCurrent(); |
153 // Make sure we're done with whatever came before. | 153 // Make sure we're done with whatever came before. |
154 SK_GL(*this->gl, Finish()); | 154 SK_GL(*this->gl, Finish()); |
155 } | 155 } |
156 void endTiming() override { | 156 void endTiming() override { |
157 if (this->gl) { | 157 if (this->gl) { |
158 SK_GL(*this->gl, Flush()); | 158 SK_GL(*this->gl, Flush()); |
159 this->gl->swapBuffers(); | 159 this->gl->waitOnSyncOrSwap(); |
160 } | 160 } |
161 } | 161 } |
162 void fence() override { | 162 void fence() override { |
163 SK_GL(*this->gl, Finish()); | 163 SK_GL(*this->gl, Finish()); |
164 } | 164 } |
165 | 165 |
166 bool needsFrameTiming(int* maxFrameLag) const override { | 166 bool needsFrameTiming(int* maxFrameLag) const override { |
167 if (!this->gl->getMaxGpuFrameLag(maxFrameLag)) { | 167 if (!this->gl->getMaxGpuFrameLag(maxFrameLag)) { |
168 // Frame lag is unknown. | 168 // Frame lag is unknown. |
169 *maxFrameLag = FLAGS_gpuFrameLag; | 169 *maxFrameLag = FLAGS_gpuFrameLag; |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 | 1258 |
1259 return 0; | 1259 return 0; |
1260 } | 1260 } |
1261 | 1261 |
1262 #if !defined SK_BUILD_FOR_IOS | 1262 #if !defined SK_BUILD_FOR_IOS |
1263 int main(int argc, char** argv) { | 1263 int main(int argc, char** argv) { |
1264 SkCommandLineFlags::Parse(argc, argv); | 1264 SkCommandLineFlags::Parse(argc, argv); |
1265 return nanobench_main(); | 1265 return nanobench_main(); |
1266 } | 1266 } |
1267 #endif | 1267 #endif |
OLD | NEW |