OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
11 #include "GrBackendEffectFactory.h" | 11 #include "GrBackendEffectFactory.h" |
12 #include "GrColor.h" | 12 #include "GrColor.h" |
13 #include "GrEffectStage.h" | 13 #include "GrEffectStage.h" |
| 14 #include "GrPaint.h" |
14 #include "GrRefCnt.h" | 15 #include "GrRefCnt.h" |
15 #include "GrRenderTarget.h" | 16 #include "GrRenderTarget.h" |
16 #include "GrStencil.h" | 17 #include "GrStencil.h" |
17 #include "GrTemplates.h" | 18 #include "GrTemplates.h" |
18 #include "GrTexture.h" | 19 #include "GrTexture.h" |
19 #include "GrTypesPriv.h" | 20 #include "GrTypesPriv.h" |
20 #include "effects/GrSimpleTextureEffect.h" | 21 #include "effects/GrSimpleTextureEffect.h" |
21 | 22 |
22 #include "SkMatrix.h" | 23 #include "SkMatrix.h" |
23 #include "SkXfermode.h" | 24 #include "SkXfermode.h" |
(...skipping 22 matching lines...) Expand all Loading... |
46 * coverage rather than as input to the src/dst color blend step. | 47 * coverage rather than as input to the src/dst color blend step. |
47 * | 48 * |
48 * The input color to the first enabled color-stage is either the constant c
olor or interpolated | 49 * The input color to the first enabled color-stage is either the constant c
olor or interpolated |
49 * per-vertex colors, depending upon GrAttribBindings. The input to the firs
t coverage stage is | 50 * per-vertex colors, depending upon GrAttribBindings. The input to the firs
t coverage stage is |
50 * either a constant coverage (usually full-coverage) or interpolated per-ve
rtex coverage. | 51 * either a constant coverage (usually full-coverage) or interpolated per-ve
rtex coverage. |
51 * | 52 * |
52 * See the documentation of kCoverageDrawing_StateBit for information about
disabling the | 53 * See the documentation of kCoverageDrawing_StateBit for information about
disabling the |
53 * the color / coverage distinction. | 54 * the color / coverage distinction. |
54 * | 55 * |
55 * Stages 0 through GrPaint::kTotalStages-1 are reserved for stages copied f
rom the client's | 56 * Stages 0 through GrPaint::kTotalStages-1 are reserved for stages copied f
rom the client's |
56 * GrPaint. Stages GrPaint::kTotalStages through kNumStages-2 are earmarked
for use by | 57 * GrPaint. Stage GrPaint::kTotalStages is earmarked for use by GrTextContex
t, GrPathRenderer- |
57 * GrTextContext and GrPathRenderer-derived classes. kNumStages-1 is earmark
ed for clipping | 58 * derived classes, and the rect/oval helper classes. GrPaint::kTotalStages+
1 is earmarked for |
58 * by GrClipMaskManager. | 59 * clipping by GrClipMaskManager. TODO: replace fixed size array of stages w
ith variable size |
| 60 * arrays of color and coverage stages. |
59 */ | 61 */ |
60 enum { | 62 enum { |
61 kNumStages = 5, | 63 kNumStages = GrPaint::kTotalStages + 2, |
62 }; | 64 }; |
63 | 65 |
64 GrDrawState() { | 66 GrDrawState() { |
65 #if GR_DEBUG | 67 #if GR_DEBUG |
66 VertexAttributesUnitTest(); | 68 VertexAttributesUnitTest(); |
67 #endif | 69 #endif |
68 this->reset(); | 70 this->reset(); |
69 } | 71 } |
70 | 72 |
71 GrDrawState(const GrDrawState& state) { | 73 GrDrawState(const GrDrawState& state) { |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 int fAttribIndices[kAttribIndexCount]; | 1227 int fAttribIndices[kAttribIndexCount]; |
1226 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs; | 1228 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs; |
1227 GrEffectStage fStages[kNumStages]; | 1229 GrEffectStage fStages[kNumStages]; |
1228 | 1230 |
1229 typedef GrRefCnt INHERITED; | 1231 typedef GrRefCnt INHERITED; |
1230 }; | 1232 }; |
1231 | 1233 |
1232 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1234 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1233 | 1235 |
1234 #endif | 1236 #endif |
OLD | NEW |