| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |