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

Side by Side Diff: tools/kilobench/kilobench.cpp

Issue 1966013002: Turn ContextInfos returned by GrContextFactory into structs. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Address comment Created 4 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 | « tools/gpu/GrContextFactory.h ('k') | tools/skiaserve/Request.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 2016 Google Inc. 2 * Copyright 2016 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 "GrCaps.h" 8 #include "GrCaps.h"
9 #include "GrContextFactory.h" 9 #include "GrContextFactory.h"
10 #include "Benchmark.h" 10 #include "Benchmark.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 int maxRTSize = context->caps()->maxRenderTargetSize(); 181 int maxRTSize = context->caps()->maxRenderTargetSize();
182 SkImageInfo info = SkImageInfo::Make(SkTMin(bench->getSize().fX, maxRTSi ze), 182 SkImageInfo info = SkImageInfo::Make(SkTMin(bench->getSize().fX, maxRTSi ze),
183 SkTMin(bench->getSize().fY, maxRTSi ze), 183 SkTMin(bench->getSize().fY, maxRTSi ze),
184 kN32_SkColorType, kPremul_SkAlphaT ype); 184 kN32_SkColorType, kPremul_SkAlphaT ype);
185 uint32_t flags = useDfText ? SkSurfaceProps::kUseDeviceIndependentFonts_ Flag : 185 uint32_t flags = useDfText ? SkSurfaceProps::kUseDeviceIndependentFonts_ Flag :
186 0; 186 0;
187 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); 187 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
188 fSurface.reset(SkSurface::MakeRenderTarget(context, 188 fSurface.reset(SkSurface::MakeRenderTarget(context,
189 SkBudgeted::kNo, info, 189 SkBudgeted::kNo, info,
190 numSamples, &props).release() ); 190 numSamples, &props).release() );
191 fGL = factory->getContextInfo(ctxType, ctxOptions).fGLContext; 191 fGL = factory->getContextInfo(ctxType, ctxOptions).glContext();
192 if (!fSurface.get()) { 192 if (!fSurface.get()) {
193 return false; 193 return false;
194 } 194 }
195 195
196 // Kilobench should only be used on platforms with fence sync support 196 // Kilobench should only be used on platforms with fence sync support
197 SkASSERT(fGL->fenceSyncSupport()); 197 SkASSERT(fGL->fenceSyncSupport());
198 return true; 198 return true;
199 } 199 }
200 200
201 SkCanvas* getCanvas() const { 201 SkCanvas* getCanvas() const {
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 return 0; 649 return 0;
650 } 650 }
651 651
652 #if !defined SK_BUILD_FOR_IOS 652 #if !defined SK_BUILD_FOR_IOS
653 int main(int argc, char** argv) { 653 int main(int argc, char** argv) {
654 SkCommandLineFlags::Parse(argc, argv); 654 SkCommandLineFlags::Parse(argc, argv);
655 return kilobench_main(); 655 return kilobench_main();
656 } 656 }
657 #endif 657 #endif
OLDNEW
« no previous file with comments | « tools/gpu/GrContextFactory.h ('k') | tools/skiaserve/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698