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 #ifndef GrProcOptInfo_DEFINED | 8 #ifndef GrProcOptInfo_DEFINED |
9 #define GrProcOptInfo_DEFINED | 9 #define GrProcOptInfo_DEFINED |
10 | 10 |
11 #include "GrColor.h" | 11 #include "GrColor.h" |
12 #include "GrInvariantOutput.h" | 12 #include "GrInvariantOutput.h" |
13 #include "GrStagedProcessor.h" | 13 #include "GrStagedProcessor.h" |
14 | 14 |
15 class GrBatch; | 15 class GrDrawBatch; |
16 class GrFragmentProcessor; | 16 class GrFragmentProcessor; |
17 class GrPrimitiveProcessor; | 17 class GrPrimitiveProcessor; |
18 class GrProcessor; | 18 class GrProcessor; |
19 | 19 |
20 /** | 20 /** |
21 * GrProcOptInfo gathers invariant data from a set of processor stages.It is use
d to recognize | 21 * GrProcOptInfo gathers invariant data from a set of processor stages.It is use
d to recognize |
22 * optimizations related to eliminating stages and vertex attributes that aren't
necessary for a | 22 * optimizations related to eliminating stages and vertex attributes that aren't
necessary for a |
23 * draw. | 23 * draw. |
24 */ | 24 */ |
25 class GrProcOptInfo { | 25 class GrProcOptInfo { |
26 public: | 26 public: |
27 GrProcOptInfo() | 27 GrProcOptInfo() |
28 : fInOut(0, static_cast<GrColorComponentFlags>(0), false) | 28 : fInOut(0, static_cast<GrColorComponentFlags>(0), false) |
29 , fFirstEffectStageIndex(0) | 29 , fFirstEffectStageIndex(0) |
30 , fInputColorIsUsed(true) | 30 , fInputColorIsUsed(true) |
31 , fInputColor(0) | 31 , fInputColor(0) |
32 , fReadsFragPosition(false) {} | 32 , fReadsFragPosition(false) {} |
33 | 33 |
34 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s
tartColor, | 34 void calcWithInitialValues(const GrFragmentStage*, int stageCount, GrColor s
tartColor, |
35 GrColorComponentFlags flags, bool areCoverageStag
es); | 35 GrColorComponentFlags flags, bool areCoverageStag
es); |
36 | 36 |
37 void calcColorWithBatch(const GrBatch*, const GrFragmentStage*, int stagecou
nt); | 37 void calcColorWithBatch(const GrDrawBatch*, const GrFragmentStage*, int stag
ecount); |
38 void calcCoverageWithBatch(const GrBatch*, const GrFragmentStage*, int stage
count); | 38 void calcCoverageWithBatch(const GrDrawBatch*, const GrFragmentStage*, int s
tagecount); |
39 | 39 |
40 // TODO delete these when batch is everywhere | 40 // TODO delete these when batch is everywhere |
41 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag
e*, int stagecount); | 41 void calcColorWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentStag
e*, int stagecount); |
42 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS
tage*, | 42 void calcCoverageWithPrimProc(const GrPrimitiveProcessor*, const GrFragmentS
tage*, |
43 int stagecount); | 43 int stagecount); |
44 | 44 |
45 bool isSolidWhite() const { return fInOut.isSolidWhite(); } | 45 bool isSolidWhite() const { return fInOut.isSolidWhite(); } |
46 bool isOpaque() const { return fInOut.isOpaque(); } | 46 bool isOpaque() const { return fInOut.isOpaque(); } |
47 bool isSingleComponent() const { return fInOut.isSingleComponent(); } | 47 bool isSingleComponent() const { return fInOut.isSingleComponent(); } |
48 bool allStagesMultiplyInput() const { return fInOut.allStagesMulInput(); } | 48 bool allStagesMultiplyInput() const { return fInOut.allStagesMulInput(); } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void internalCalc(const GrFragmentStage*, int stagecount, bool initWillReadF
ragPosition); | 91 void internalCalc(const GrFragmentStage*, int stagecount, bool initWillReadF
ragPosition); |
92 | 92 |
93 GrInvariantOutput fInOut; | 93 GrInvariantOutput fInOut; |
94 int fFirstEffectStageIndex; | 94 int fFirstEffectStageIndex; |
95 bool fInputColorIsUsed; | 95 bool fInputColorIsUsed; |
96 GrColor fInputColor; | 96 GrColor fInputColor; |
97 bool fReadsFragPosition; | 97 bool fReadsFragPosition; |
98 }; | 98 }; |
99 | 99 |
100 #endif | 100 #endif |
OLD | NEW |