Optimize colorfilter path when using a constant color.\nReviewed at http://codereview.appspot.com/4548041/
git-svn-id: http://skia.googlecode.com/svn/trunk@1328 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index 15def87..601da09 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -163,17 +163,26 @@
// doesn't set the texture/sampler/matrix state
// caller needs to null out GrPaint's texture if
// non-textured drawing is desired.
+ // Set constantColor to true if a constant color
+ // will be used. This is an optimization, and can
+ // always be set to false. constantColor should
+ // never be true if justAlpha is true.
bool skPaint2GrPaintNoShader(const SkPaint& skPaint,
bool justAlpha,
- GrPaint* grPaint);
+ GrPaint* grPaint,
+ bool constantColor);
// uses the SkShader to setup paint, act used to
// hold lock on cached texture and free it when
// destroyed.
+ // If there is no shader, constantColor will
+ // be passed to skPaint2GrPaintNoShader. Otherwise
+ // it is ignored.
bool skPaint2GrPaintShader(const SkPaint& skPaint,
SkAutoCachedTexture* act,
const SkMatrix& ctm,
- GrPaint* grPaint);
+ GrPaint* grPaint,
+ bool constantColor);
SkDrawProcs* initDrawForText(GrTextContext*);
bool bindDeviceAsTexture(GrPaint* paint);