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.fScissor; | 62 pipeline->fScissorState = args.fClip->scissorState(); |
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 (builder.isHWAntialias()) { | 67 if (args.fClip->isCoCenteredMultisampledDraw()) { |
| 68 SkASSERT(args.fCaps->programmableSampleLocationsSupport() && !builder.is
HWAntialias()); |
| 69 pipeline->fFlags |= (kHWAA_Flag | kCoCenteredSamples_Flag); |
| 70 } else if (builder.isHWAntialias()) { |
68 pipeline->fFlags |= kHWAA_Flag; | 71 pipeline->fFlags |= kHWAA_Flag; |
69 } | 72 } |
70 if (builder.snapVerticesToPixelCenters()) { | 73 if (builder.snapVerticesToPixelCenters()) { |
71 pipeline->fFlags |= kSnapVertices_Flag; | 74 pipeline->fFlags |= kSnapVertices_Flag; |
72 } | 75 } |
73 | 76 |
74 int firstColorProcessorIdx = args.fColorPOI.firstEffectiveProcessorIndex(); | 77 int firstColorProcessorIdx = args.fColorPOI.firstEffectiveProcessorIndex(); |
75 | 78 |
76 // TODO: Once we can handle single or four channel input into coverage GrFra
gmentProcessors | 79 // TODO: Once we can handle single or four channel input into coverage GrFra
gmentProcessors |
77 // then we can use GrPipelineBuilder's coverageProcInfo (like color above) t
o set this initial | 80 // 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... |
207 } | 210 } |
208 | 211 |
209 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 212 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
210 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { | 213 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { |
211 return false; | 214 return false; |
212 } | 215 } |
213 } | 216 } |
214 return true; | 217 return true; |
215 } | 218 } |
216 | 219 |
OLD | NEW |