| 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 #include "GrPipeline.h" | 8 #include "GrPipeline.h" |
| 9 | 9 |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // No need to have an override color if it isn't even going to be used. | 52 // No need to have an override color if it isn't even going to be used. |
| 53 if (SkToBool(GrXferProcessor::kIgnoreColor_OptFlag & optFlags)) { | 53 if (SkToBool(GrXferProcessor::kIgnoreColor_OptFlag & optFlags)) { |
| 54 overrideColor = GrColor_ILLEGAL; | 54 overrideColor = GrColor_ILLEGAL; |
| 55 } | 55 } |
| 56 | 56 |
| 57 GrPipeline* pipeline = new (memory) GrPipeline; | 57 GrPipeline* pipeline = new (memory) GrPipeline; |
| 58 pipeline->fXferProcessor.reset(xferProcessor.get()); | 58 pipeline->fXferProcessor.reset(xferProcessor.get()); |
| 59 | 59 |
| 60 pipeline->fRenderTarget.reset(builder.fRenderTarget.get()); | 60 pipeline->fRenderTarget.reset(builder.fRenderTarget.get()); |
| 61 SkASSERT(pipeline->fRenderTarget); | 61 SkASSERT(pipeline->fRenderTarget); |
| 62 pipeline->fScissorState = args.fClip->scissorState(); | 62 pipeline->fScissorState = *args.fScissor; |
| 63 pipeline->fStencilSettings = builder.getStencil(); | 63 pipeline->fStencilSettings = builder.getStencil(); |
| 64 pipeline->fDrawFace = builder.getDrawFace(); | 64 pipeline->fDrawFace = builder.getDrawFace(); |
| 65 | 65 |
| 66 pipeline->fFlags = 0; | 66 pipeline->fFlags = 0; |
| 67 if (args.fClip->isCoCenteredMultisampledDraw()) { | 67 if (builder.isHWAntialias()) { |
| 68 SkASSERT(args.fCaps->programmableSampleLocationsSupport() && !builder.is
HWAntialias()); | |
| 69 pipeline->fFlags |= (kHWAA_Flag | kCoCenteredSamples_Flag); | |
| 70 } else if (builder.isHWAntialias()) { | |
| 71 pipeline->fFlags |= kHWAA_Flag; | 68 pipeline->fFlags |= kHWAA_Flag; |
| 72 } | 69 } |
| 73 if (builder.snapVerticesToPixelCenters()) { | 70 if (builder.snapVerticesToPixelCenters()) { |
| 74 pipeline->fFlags |= kSnapVertices_Flag; | 71 pipeline->fFlags |= kSnapVertices_Flag; |
| 75 } | 72 } |
| 76 | 73 |
| 77 int firstColorProcessorIdx = args.fColorPOI.firstEffectiveProcessorIndex(); | 74 int firstColorProcessorIdx = args.fColorPOI.firstEffectiveProcessorIndex(); |
| 78 | 75 |
| 79 // TODO: Once we can handle single or four channel input into coverage GrFra
gmentProcessors | 76 // TODO: Once we can handle single or four channel input into coverage GrFra
gmentProcessors |
| 80 // then we can use GrPipelineBuilder's coverageProcInfo (like color above) t
o set this initial | 77 // then we can use GrPipelineBuilder's coverageProcInfo (like color above) t
o set this initial |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 207 } |
| 211 | 208 |
| 212 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 209 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
| 213 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { | 210 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { |
| 214 return false; | 211 return false; |
| 215 } | 212 } |
| 216 } | 213 } |
| 217 return true; | 214 return true; |
| 218 } | 215 } |
| 219 | 216 |
| OLD | NEW |