OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return; | 97 return; |
98 } | 98 } |
99 | 99 |
100 GrPaint grPaint; | 100 GrPaint grPaint; |
101 SkPaint skPaint; | 101 SkPaint skPaint; |
102 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { | 102 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { |
103 skPaint.setShader(fShader); | 103 skPaint.setShader(fShader); |
104 } else { | 104 } else { |
105 skPaint.setColor(kPaintColors[paintType]); | 105 skPaint.setColor(kPaintColors[paintType]); |
106 } | 106 } |
107 SkAssertResult(SkPaint2GrPaint(context, rt, skPaint, viewMat
rix, false, | 107 SkAssertResult(SkPaint2GrPaint(context, skPaint, viewMatrix,
false, &grPaint)); |
108 &grPaint)); | |
109 | 108 |
110 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; | 109 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; |
111 GrColor color = kColors[procColor]; | 110 GrColor color = kColors[procColor]; |
112 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor::
Create(color, mode)); | 111 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor::
Create(color, mode)); |
113 | 112 |
114 GrClip clip; | 113 GrClip clip; |
115 GrPipelineBuilder pipelineBuilder(grPaint, rt, clip); | 114 GrPipelineBuilder pipelineBuilder(grPaint, rt, clip); |
116 pipelineBuilder.addColorFragmentProcessor(fp); | 115 pipelineBuilder.addColorFragmentProcessor(fp); |
117 | 116 |
118 tt.target()->drawNonAARect(pipelineBuilder, | 117 tt.target()->drawNonAARect(pipelineBuilder, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 typedef GM INHERITED; | 188 typedef GM INHERITED; |
190 }; | 189 }; |
191 | 190 |
192 const SkScalar ConstColorProcessor::kPad = 10.f; | 191 const SkScalar ConstColorProcessor::kPad = 10.f; |
193 const SkScalar ConstColorProcessor::kRectSize = 20.f; | 192 const SkScalar ConstColorProcessor::kRectSize = 20.f; |
194 | 193 |
195 DEF_GM(return new ConstColorProcessor;) | 194 DEF_GM(return new ConstColorProcessor;) |
196 } | 195 } |
197 | 196 |
198 #endif | 197 #endif |
OLD | NEW |