| 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 "Test.h" | 8 #include "Test.h" |
| 9 | 9 |
| 10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo)
{ | 61 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo)
{ |
| 62 // The DF PR only works with contexts that support derivatives | 62 // The DF PR only works with contexts that support derivatives |
| 63 if (!ctxInfo.grContext()->caps()->shaderCaps()->shaderDerivativeSupport()) { | 63 if (!ctxInfo.grContext()->caps()->shaderCaps()->shaderDerivativeSupport()) { |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBacki
ngFit::kApprox, | 66 sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBacki
ngFit::kApprox, |
| 67 800, 80
0, | 67 800, 80
0, |
| 68 kSkia88
88_GrPixelConfig, | 68 kSkia88
88_GrPixelConfig, |
| 69 nullptr
, |
| 69 0, | 70 0, |
| 70 kTopLef
t_GrSurfaceOrigin)); | 71 kTopLef
t_GrSurfaceOrigin)); |
| 71 if (!drawContext) { | 72 if (!drawContext) { |
| 72 return; | 73 return; |
| 73 } | 74 } |
| 74 | 75 |
| 75 GrAADistanceFieldPathRenderer dfpr; | 76 GrAADistanceFieldPathRenderer dfpr; |
| 76 GrTestTarget tt; | 77 GrTestTarget tt; |
| 77 ctxInfo.grContext()->getTestTarget(&tt, drawContext); | 78 ctxInfo.grContext()->getTestTarget(&tt, drawContext); |
| 78 GrResourceProvider* rp = tt.resourceProvider(); | 79 GrResourceProvider* rp = tt.resourceProvider(); |
| 79 | 80 |
| 80 test_far_from_origin(drawContext.get(), &dfpr, rp); | 81 test_far_from_origin(drawContext.get(), &dfpr, rp); |
| 81 ctxInfo.grContext()->flush(); | 82 ctxInfo.grContext()->flush(); |
| 82 } | 83 } |
| 83 #endif | 84 #endif |
| OLD | NEW |