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

Side by Side Diff: bench/nanobench.cpp

Issue 1511773005: Make SkGLContext lifetime more well-defined (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix the test 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 | dm/DM.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 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 bool init(SkImageInfo info, Benchmark* bench) override { 169 bool init(SkImageInfo info, Benchmark* bench) override {
170 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDeviceInde pendentFonts_Flag : 170 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDeviceInde pendentFonts_Flag :
171 0; 171 0;
172 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); 172 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
173 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con fig.ctxType, 173 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con fig.ctxType,
174 this->con fig.ctxOptions), 174 this->con fig.ctxOptions),
175 SkSurface::kNo_Budgeted , info, 175 SkSurface::kNo_Budgeted , info,
176 this->config.samples, & props)); 176 this->config.samples, & props));
177 this->gl = gGrFactory->getContextInfo(this->config.ctxType, 177 this->gl = gGrFactory->getContextInfo(this->config.ctxType,
178 this->config.ctxOptions)->fGLConte xt; 178 this->config.ctxOptions).fGLContex t;
179 if (!this->surface.get()) { 179 if (!this->surface.get()) {
180 return false; 180 return false;
181 } 181 }
182 if (!this->gl->fenceSyncSupport()) { 182 if (!this->gl->fenceSyncSupport()) {
183 SkDebugf("WARNING: GL context for config \"%s\" does not support fen ce sync. " 183 SkDebugf("WARNING: GL context for config \"%s\" does not support fen ce sync. "
184 "Timings might not be accurate.\n", this->config.name); 184 "Timings might not be accurate.\n", this->config.name);
185 } 185 }
186 return true; 186 return true;
187 } 187 }
188 void fillOptions(ResultsWriter* log) override { 188 void fillOptions(ResultsWriter* log) override {
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 1223
1224 return 0; 1224 return 0;
1225 } 1225 }
1226 1226
1227 #if !defined SK_BUILD_FOR_IOS 1227 #if !defined SK_BUILD_FOR_IOS
1228 int main(int argc, char** argv) { 1228 int main(int argc, char** argv) {
1229 SkCommandLineFlags::Parse(argc, argv); 1229 SkCommandLineFlags::Parse(argc, argv);
1230 return nanobench_main(); 1230 return nanobench_main();
1231 } 1231 }
1232 #endif 1232 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698