Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: src/gpu/GrDrawState.h

Issue 12918032: Add GrPaint stage for xfermodes. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698