OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrOptDrawState.h" | 8 #include "GrOptDrawState.h" |
9 | 9 |
10 #include "GrDrawState.h" | 10 #include "GrDrawState.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 if (colorPOI.firstEffectiveStageIndex() != 0) { | 48 if (colorPOI.firstEffectiveStageIndex() != 0) { |
49 overrideColor = colorPOI.inputColorToEffectiveStage(); | 49 overrideColor = colorPOI.inputColorToEffectiveStage(); |
50 } | 50 } |
51 | 51 |
52 GrXferProcessor::OptFlags optFlags; | 52 GrXferProcessor::OptFlags optFlags; |
53 if (xferProcessor) { | 53 if (xferProcessor) { |
54 fXferProcessor.reset(xferProcessor.get()); | 54 fXferProcessor.reset(xferProcessor.get()); |
55 | 55 |
56 optFlags = xferProcessor->getOptimizations(colorPOI, | 56 optFlags = xferProcessor->getOptimizations(colorPOI, |
57 coveragePOI, | 57 coveragePOI, |
58 drawState.isCoverageDrawing()
, | |
59 drawState.isColorWriteDisable
d(), | 58 drawState.isColorWriteDisable
d(), |
60 drawState.getStencil().doesWr
ite(), | 59 drawState.getStencil().doesWr
ite(), |
61 &overrideColor, | 60 &overrideColor, |
62 caps); | 61 caps); |
63 } | 62 } |
64 | 63 |
65 // When path rendering the stencil settings are not always set on the draw s
tate | 64 // When path rendering the stencil settings are not always set on the draw s
tate |
66 // so we must check the draw type. In cases where we will skip drawing we si
mply return a | 65 // so we must check the draw type. In cases where we will skip drawing we si
mply return a |
67 // null GrOptDrawState. | 66 // null GrOptDrawState. |
68 if (!xferProcessor || ((GrXferProcessor::kSkipDraw_OptFlag & optFlags) && | 67 if (!xferProcessor || ((GrXferProcessor::kSkipDraw_OptFlag & optFlags) && |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 206 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
208 return false; | 207 return false; |
209 } | 208 } |
210 } | 209 } |
211 | 210 |
212 // Now update the GrPrimitiveProcessor's batch tracker | 211 // Now update the GrPrimitiveProcessor's batch tracker |
213 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); | 212 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); |
214 return true; | 213 return true; |
215 } | 214 } |
216 | 215 |
OLD | NEW |