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

Side by Side Diff: bench/nanobench.cpp

Issue 1606883005: Revert to old behavior for swap buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | include/gpu/gl/SkGLContext.h » ('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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | include/gpu/gl/SkGLContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698