| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, | 110 GrPipelineBuilder pipelineBuilder(grPaint, |
| 111 drawContext->isUnifiedMult
isampled()); | 111 drawContext->isUnifiedMult
isampled()); |
| 112 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar
get()); | |
| 113 pipelineBuilder.addColorFragmentProcessor(fp); | 112 pipelineBuilder.addColorFragmentProcessor(fp); |
| 114 | 113 |
| 115 SkAutoTUnref<GrDrawBatch> batch( | 114 SkAutoTUnref<GrDrawBatch> batch( |
| 116 GrRectBatchFactory::CreateNonAAFill(grPaint.getColor
(), viewMatrix, | 115 GrRectBatchFactory::CreateNonAAFill(grPaint.getColor
(), viewMatrix, |
| 117 renderRect, null
ptr, nullptr)); | 116 renderRect, null
ptr, nullptr)); |
| 118 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 117 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
| 119 | 118 |
| 120 // Draw labels for the input to the processor and the proces
sor to the right of | 119 // Draw labels for the input to the processor and the proces
sor to the right of |
| 121 // the test rect. The input label appears above the processo
r label. | 120 // the test rect. The input label appears above the processo
r label. |
| 122 SkPaint labelPaint; | 121 SkPaint labelPaint; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 typedef GM INHERITED; | 185 typedef GM INHERITED; |
| 187 }; | 186 }; |
| 188 | 187 |
| 189 const SkScalar ConstColorProcessor::kPad = 10.f; | 188 const SkScalar ConstColorProcessor::kPad = 10.f; |
| 190 const SkScalar ConstColorProcessor::kRectSize = 20.f; | 189 const SkScalar ConstColorProcessor::kRectSize = 20.f; |
| 191 | 190 |
| 192 DEF_GM(return new ConstColorProcessor;) | 191 DEF_GM(return new ConstColorProcessor;) |
| 193 } | 192 } |
| 194 | 193 |
| 195 #endif | 194 #endif |
| OLD | NEW |