Move alpha-ramp AA to GrContext, detect cases when AA is applied via other methods (smooth lines, MSAA) or rect falls on integer coords and skip the alpha ramp path. Use pre-fab index buffer for alpha-ramped fill rects and stroke rects.
Review URL: http://codereview.appspot.com/4449047/
git-svn-id: http://skia.googlecode.com/svn/trunk@1169 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrContext.h b/gpu/include/GrContext.h
index 5eda2b7..07d76f8 100644
--- a/gpu/include/GrContext.h
+++ b/gpu/include/GrContext.h
@@ -568,8 +568,26 @@
GrIndexBufferAllocPool* fDrawBufferIBAllocPool;
GrInOrderDrawBuffer* fDrawBuffer;
+ GrIndexBuffer* fAAFillRectIndexBuffer;
+ GrIndexBuffer* fAAStrokeRectIndexBuffer;
+
GrContext(GrGpu* gpu);
+ void fillAARect(GrDrawTarget* target,
+ const GrPaint& paint,
+ const GrRect& devRect);
+
+ void strokeAARect(GrDrawTarget* target,
+ const GrPaint& paint,
+ const GrRect& devRect,
+ const GrVec& devStrokeSize);
+
+ inline int aaFillRectIndexCount() const;
+ GrIndexBuffer* aaFillRectIndexBuffer();
+
+ inline int aaStrokeRectIndexCount() const;
+ GrIndexBuffer* aaStrokeRectIndexBuffer();
+
void setupDrawBuffer();
void flushDrawBuffer();