| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 GrNoClip noClip; | 44 GrNoClip noClip; |
| 45 GrPathRenderer::DrawPathArgs args; | 45 GrPathRenderer::DrawPathArgs args; |
| 46 args.fPaint = &paint; | 46 args.fPaint = &paint; |
| 47 args.fUserStencilSettings = &GrUserStencilSettings::kUnused; | 47 args.fUserStencilSettings = &GrUserStencilSettings::kUnused; |
| 48 args.fDrawContext = drawContext; | 48 args.fDrawContext = drawContext; |
| 49 args.fClip = &noClip; | 49 args.fClip = &noClip; |
| 50 args.fResourceProvider = rp; | 50 args.fResourceProvider = rp; |
| 51 args.fViewMatrix = &matrix; | 51 args.fViewMatrix = &matrix; |
| 52 args.fShape = &shape; | 52 args.fShape = &shape; |
| 53 args.fAntiAlias = true; | 53 args.fAntiAlias = true; |
| 54 | 54 args.fGammaCorrect = false; |
| 55 pr->drawPath(args); | 55 pr->drawPath(args); |
| 56 } | 56 } |
| 57 | 57 |
| 58 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo)
{ | 58 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo)
{ |
| 59 // The DF PR only works with contexts that support derivatives | 59 // The DF PR only works with contexts that support derivatives |
| 60 if (!ctxInfo.grContext()->caps()->shaderCaps()->shaderDerivativeSupport()) { | 60 if (!ctxInfo.grContext()->caps()->shaderCaps()->shaderDerivativeSupport()) { |
| 61 return; | 61 return; |
| 62 } | 62 } |
| 63 sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBacki
ngFit::kApprox, | 63 sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBacki
ngFit::kApprox, |
| 64 800, 80
0, | 64 800, 80
0, |
| 65 kSkia88
88_GrPixelConfig, | 65 kSkia88
88_GrPixelConfig, |
| 66 0, | 66 0, |
| 67 kTopLef
t_GrSurfaceOrigin)); | 67 kTopLef
t_GrSurfaceOrigin)); |
| 68 if (!drawContext) { | 68 if (!drawContext) { |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 | 71 |
| 72 GrAADistanceFieldPathRenderer dfpr; | 72 GrAADistanceFieldPathRenderer dfpr; |
| 73 GrTestTarget tt; | 73 GrTestTarget tt; |
| 74 ctxInfo.grContext()->getTestTarget(&tt, drawContext); | 74 ctxInfo.grContext()->getTestTarget(&tt, drawContext); |
| 75 GrResourceProvider* rp = tt.resourceProvider(); | 75 GrResourceProvider* rp = tt.resourceProvider(); |
| 76 | 76 |
| 77 test_far_from_origin(drawContext.get(), &dfpr, rp); | 77 test_far_from_origin(drawContext.get(), &dfpr, rp); |
| 78 ctxInfo.grContext()->flush(); | 78 ctxInfo.grContext()->flush(); |
| 79 } | 79 } |
| 80 #endif | 80 #endif |
| OLD | NEW |