OLD | NEW |
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 GrContextFactory::GLContextOptions ctxOptions, int numSamples) { | 186 GrContextFactory::GLContextOptions ctxOptions, int numSamples) { |
187 GrContext* context = factory->get(ctxType, ctxOptions); | 187 GrContext* context = factory->get(ctxType, ctxOptions); |
188 int maxRTSize = context->caps()->maxRenderTargetSize(); | 188 int maxRTSize = context->caps()->maxRenderTargetSize(); |
189 SkImageInfo info = SkImageInfo::Make(SkTMin(bench->getSize().fX, maxRTSi
ze), | 189 SkImageInfo info = SkImageInfo::Make(SkTMin(bench->getSize().fX, maxRTSi
ze), |
190 SkTMin(bench->getSize().fY, maxRTSi
ze), | 190 SkTMin(bench->getSize().fY, maxRTSi
ze), |
191 kN32_SkColorType, kPremul_SkAlphaT
ype); | 191 kN32_SkColorType, kPremul_SkAlphaT
ype); |
192 uint32_t flags = useDfText ? SkSurfaceProps::kUseDeviceIndependentFonts_
Flag : | 192 uint32_t flags = useDfText ? SkSurfaceProps::kUseDeviceIndependentFonts_
Flag : |
193 0; | 193 0; |
194 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 194 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
195 fSurface.reset(SkSurface::NewRenderTarget(context, | 195 fSurface.reset(SkSurface::NewRenderTarget(context, |
196 SkSurface::kNo_Budgeted, info, | 196 SkBudgeted::kNo, info, |
197 numSamples, &props)); | 197 numSamples, &props)); |
198 fGL = factory->getContextInfo(ctxType, ctxOptions).fGLContext; | 198 fGL = factory->getContextInfo(ctxType, ctxOptions).fGLContext; |
199 if (!fSurface.get()) { | 199 if (!fSurface.get()) { |
200 return false; | 200 return false; |
201 } | 201 } |
202 | 202 |
203 // Kilobench should only be used on platforms with fence sync support | 203 // Kilobench should only be used on platforms with fence sync support |
204 SkASSERT(fGL->fenceSyncSupport()); | 204 SkASSERT(fGL->fenceSyncSupport()); |
205 return true; | 205 return true; |
206 } | 206 } |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 } | 655 } |
656 return 0; | 656 return 0; |
657 } | 657 } |
658 | 658 |
659 #if !defined SK_BUILD_FOR_IOS | 659 #if !defined SK_BUILD_FOR_IOS |
660 int main(int argc, char** argv) { | 660 int main(int argc, char** argv) { |
661 SkCommandLineFlags::Parse(argc, argv); | 661 SkCommandLineFlags::Parse(argc, argv); |
662 return kilobench_main(); | 662 return kilobench_main(); |
663 } | 663 } |
664 #endif | 664 #endif |
OLD | NEW |