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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } else { | 100 } else { |
101 skPaint.setColor(kPaintColors[paintType]); | 101 skPaint.setColor(kPaintColors[paintType]); |
102 } | 102 } |
103 // SRGBTODO: No sRGB inputs allowed here? | 103 // SRGBTODO: No sRGB inputs allowed here? |
104 SkAssertResult(SkPaintToGrPaint(context, skPaint, viewMatrix
, false, &grPaint)); | 104 SkAssertResult(SkPaintToGrPaint(context, skPaint, viewMatrix
, false, &grPaint)); |
105 | 105 |
106 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; | 106 GrConstColorProcessor::InputMode mode = (GrConstColorProcess
or::InputMode) m; |
107 GrColor color = kColors[procColor]; | 107 GrColor color = kColors[procColor]; |
108 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor::
Create(color, mode)); | 108 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor::
Create(color, mode)); |
109 | 109 |
110 GrPipelineBuilder pipelineBuilder(grPaint, drawContext->acce
ssRenderTarget()); | 110 GrPipelineBuilder pipelineBuilder(grPaint, |
| 111 drawContext->isUnifiedMult
isampled()); |
| 112 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar
get()); |
111 pipelineBuilder.addColorFragmentProcessor(fp); | 113 pipelineBuilder.addColorFragmentProcessor(fp); |
112 | 114 |
113 SkAutoTUnref<GrDrawBatch> batch( | 115 SkAutoTUnref<GrDrawBatch> batch( |
114 GrRectBatchFactory::CreateNonAAFill(grPaint.getColor
(), viewMatrix, | 116 GrRectBatchFactory::CreateNonAAFill(grPaint.getColor
(), viewMatrix, |
115 renderRect, null
ptr, nullptr)); | 117 renderRect, null
ptr, nullptr)); |
116 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 118 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
117 | 119 |
118 // Draw labels for the input to the processor and the proces
sor to the right of | 120 // Draw labels for the input to the processor and the proces
sor to the right of |
119 // the test rect. The input label appears above the processo
r label. | 121 // the test rect. The input label appears above the processo
r label. |
120 SkPaint labelPaint; | 122 SkPaint labelPaint; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 typedef GM INHERITED; | 186 typedef GM INHERITED; |
185 }; | 187 }; |
186 | 188 |
187 const SkScalar ConstColorProcessor::kPad = 10.f; | 189 const SkScalar ConstColorProcessor::kPad = 10.f; |
188 const SkScalar ConstColorProcessor::kRectSize = 20.f; | 190 const SkScalar ConstColorProcessor::kRectSize = 20.f; |
189 | 191 |
190 DEF_GM(return new ConstColorProcessor;) | 192 DEF_GM(return new ConstColorProcessor;) |
191 } | 193 } |
192 | 194 |
193 #endif | 195 #endif |
OLD | NEW |