| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, rt, skPaint, viewMat
rix, false, |
| 108 &grPaint)); | 108 &grPaint)); |
| 109 | 109 |
| 110 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; | 110 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; |
| 111 GrColor color = kColors[procColor]; | 111 GrColor color = kColors[procColor]; |
| 112 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor::
Create(color, mode)); | 112 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor::
Create(color, mode)); |
| 113 | 113 |
| 114 GrPipelineBuilder pipelineBuilder; | |
| 115 GrClip clip; | 114 GrClip clip; |
| 116 pipelineBuilder.setFromPaint(grPaint, rt, clip); | 115 GrPipelineBuilder pipelineBuilder(grPaint, rt, clip); |
| 117 pipelineBuilder.addColorProcessor(fp); | 116 pipelineBuilder.addColorProcessor(fp); |
| 118 | 117 |
| 119 tt.target()->drawSimpleRect(&pipelineBuilder, | 118 tt.target()->drawSimpleRect(&pipelineBuilder, |
| 120 grPaint.getColor(), | 119 grPaint.getColor(), |
| 121 viewMatrix, | 120 viewMatrix, |
| 122 renderRect); | 121 renderRect); |
| 123 | 122 |
| 124 // Draw labels for the input to the processor and the proces
sor to the right of | 123 // Draw labels for the input to the processor and the proces
sor to the right of |
| 125 // the test rect. The input label appears above the processo
r label. | 124 // the test rect. The input label appears above the processo
r label. |
| 126 SkPaint labelPaint; | 125 SkPaint labelPaint; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 typedef GM INHERITED; | 189 typedef GM INHERITED; |
| 191 }; | 190 }; |
| 192 | 191 |
| 193 const SkScalar ConstColorProcessor::kPad = 10.f; | 192 const SkScalar ConstColorProcessor::kPad = 10.f; |
| 194 const SkScalar ConstColorProcessor::kRectSize = 20.f; | 193 const SkScalar ConstColorProcessor::kRectSize = 20.f; |
| 195 | 194 |
| 196 DEF_GM( return SkNEW(ConstColorProcessor); ) | 195 DEF_GM( return SkNEW(ConstColorProcessor); ) |
| 197 } | 196 } |
| 198 | 197 |
| 199 #endif | 198 #endif |
| OLD | NEW |