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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 args.fAntiAlias = true; | 56 args.fAntiAlias = true; |
57 args.fGammaCorrect = false; | 57 args.fGammaCorrect = false; |
58 pr->drawPath(args); | 58 pr->drawPath(args); |
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> dc(ctxInfo.grContext()->makeDrawContext(SkBackingFit::k
Approx, |
67 800, 80
0, | 67 800, 800, |
68 kSkia88
88_GrPixelConfig, | 68 kSkia8888_GrPix
elConfig, |
69 nullptr
, | 69 nullptr, |
70 0, | 70 0, |
71 kTopLef
t_GrSurfaceOrigin)); | 71 kTopLeft_GrSurf
aceOrigin)); |
72 if (!drawContext) { | 72 if (!dc) { |
73 return; | 73 return; |
74 } | 74 } |
75 | 75 |
76 GrAADistanceFieldPathRenderer dfpr; | 76 GrAADistanceFieldPathRenderer dfpr; |
77 GrTestTarget tt; | 77 GrTestTarget tt; |
78 ctxInfo.grContext()->getTestTarget(&tt, drawContext); | 78 ctxInfo.grContext()->getTestTarget(&tt, dc); |
79 GrResourceProvider* rp = tt.resourceProvider(); | 79 GrResourceProvider* rp = tt.resourceProvider(); |
80 | 80 |
81 test_far_from_origin(drawContext.get(), &dfpr, rp); | 81 test_far_from_origin(dc.get(), &dfpr, rp); |
82 ctxInfo.grContext()->flush(); | 82 ctxInfo.grContext()->flush(); |
83 } | 83 } |
84 #endif | 84 #endif |
OLD | NEW |