| OLD | NEW |
| 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 #ifndef DMGpuSupport_DEFINED | 8 #ifndef DMGpuSupport_DEFINED |
| 9 #define DMGpuSupport_DEFINED | 9 #define DMGpuSupport_DEFINED |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 static inline sk_sp<SkSurface> NewGpuSurface( | 31 static inline sk_sp<SkSurface> NewGpuSurface( |
| 32 sk_gpu_test::GrContextFactory* grFactory, | 32 sk_gpu_test::GrContextFactory* grFactory, |
| 33 sk_gpu_test::GrContextFactory::ContextType type, | 33 sk_gpu_test::GrContextFactory::ContextType type, |
| 34 sk_gpu_test::GrContextFactory::ContextOptions options, | 34 sk_gpu_test::GrContextFactory::ContextOptions options, |
| 35 SkImageInfo info, | 35 SkImageInfo info, |
| 36 int samples, | 36 int samples, |
| 37 bool useDIText) { | 37 bool useDIText) { |
| 38 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag
: 0; | 38 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag
: 0; |
| 39 if (SkImageInfoIsGammaCorrect(info)) { | 39 if (SkImageInfoIsGammaCorrect(info)) { |
| 40 flags |= SkSurfaceProps::kAllowSRGBInputs_Flag; | 40 flags |= SkSurfaceProps::kGammaCorrect_Flag; |
| 41 } | 41 } |
| 42 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 42 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
| 43 return SkSurface::MakeRenderTarget(grFactory->get(type, options), SkBudgeted
::kNo, | 43 return SkSurface::MakeRenderTarget(grFactory->get(type, options), SkBudgeted
::kNo, |
| 44 info, samples, &props); | 44 info, samples, &props); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace DM | 47 } // namespace DM |
| 48 | 48 |
| 49 #else// !SK_SUPPORT_GPU | 49 #else// !SK_SUPPORT_GPU |
| 50 | 50 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 int, | 106 int, |
| 107 bool) { | 107 bool) { |
| 108 return nullptr; | 108 return nullptr; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace DM | 111 } // namespace DM |
| 112 | 112 |
| 113 #endif//SK_SUPPORT_GPU | 113 #endif//SK_SUPPORT_GPU |
| 114 | 114 |
| 115 #endif//DMGpuSupport_DEFINED | 115 #endif//DMGpuSupport_DEFINED |
| OLD | NEW |