Use coverage stages for supersample AA resolve, edgeAA, and glyph masks. Expose a mask stage through GrPaint
Review URL: http://codereview.appspot.com/4548048/
git-svn-id: http://skia.googlecode.com/svn/trunk@1356 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrDrawTarget.h b/gpu/include/GrDrawTarget.h
index 9a00b57..985cca7 100644
--- a/gpu/include/GrDrawTarget.h
+++ b/gpu/include/GrDrawTarget.h
@@ -50,7 +50,7 @@
* or not.
*/
enum {
- kNumStages = 2,
+ kNumStages = 3,
kMaxTexCoords = kNumStages
};
@@ -147,6 +147,7 @@
// default stencil setting should be disabled
GrAssert(fStencilSettings.isDisabled());
+ fFirstCoverageStage = kNumStages;
}
uint32_t fFlagBits;
GrBlendCoeff fSrcBlend;
@@ -250,6 +251,18 @@
}
/**
+ * Shortcut for preConcatSamplerMatrix on all stages in mask with same
+ * matrix
+ */
+ void preConcatSamplerMatrices(int stageMask, const GrMatrix& matrix) {
+ for (int i = 0; i < kNumStages; ++i) {
+ if ((1 << i) & stageMask) {
+ this->preConcatSamplerMatrix(i, matrix);
+ }
+ }
+ }
+
+ /**
* Gets the matrix of a stage's sampler
*
* @param stage the stage to of sampler to get