OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // rect to draw | 92 // rect to draw |
93 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS
ize); | 93 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS
ize); |
94 | 94 |
95 GrPaint grPaint; | 95 GrPaint grPaint; |
96 SkPaint skPaint; | 96 SkPaint skPaint; |
97 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { | 97 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { |
98 skPaint.setShader(fShader); | 98 skPaint.setShader(fShader); |
99 } else { | 99 } else { |
100 skPaint.setColor(kPaintColors[paintType]); | 100 skPaint.setColor(kPaintColors[paintType]); |
101 } | 101 } |
102 // SRGBTODO: No sRGB inputs allowed here? | |
103 SkAssertResult(SkPaintToGrPaint(context, drawContext, skPain
t, viewMatrix, | 102 SkAssertResult(SkPaintToGrPaint(context, drawContext, skPain
t, viewMatrix, |
104 &grPaint)); | 103 &grPaint)); |
105 | 104 |
106 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; | 105 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; |
107 GrColor color = kColors[procColor]; | 106 GrColor color = kColors[procColor]; |
108 sk_sp<GrFragmentProcessor> fp(GrConstColorProcessor::Make(co
lor, mode)); | 107 sk_sp<GrFragmentProcessor> fp(GrConstColorProcessor::Make(co
lor, mode)); |
109 | 108 |
110 grPaint.addColorFragmentProcessor(std::move(fp)); | 109 grPaint.addColorFragmentProcessor(std::move(fp)); |
111 | 110 |
112 SkAutoTUnref<GrDrawBatch> batch( | 111 SkAutoTUnref<GrDrawBatch> batch( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 static constexpr int kWidth = 820; | 179 static constexpr int kWidth = 820; |
181 static constexpr int kHeight = 500; | 180 static constexpr int kHeight = 500; |
182 | 181 |
183 typedef GM INHERITED; | 182 typedef GM INHERITED; |
184 }; | 183 }; |
185 | 184 |
186 DEF_GM(return new ConstColorProcessor;) | 185 DEF_GM(return new ConstColorProcessor;) |
187 } | 186 } |
188 | 187 |
189 #endif | 188 #endif |
OLD | NEW |