add mask for paint-bits to layerdrawlooper
change addLayer variants that don't respect paint changes to return void
git-svn-id: http://skia.googlecode.com/svn/trunk@1123 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleDrawLooper.cpp b/samplecode/SampleDrawLooper.cpp
index 7cf53b2..e1b63a1 100644
--- a/samplecode/SampleDrawLooper.cpp
+++ b/samplecode/SampleDrawLooper.cpp
@@ -30,14 +30,18 @@
fLooper = new SkLayerDrawLooper;
+ SkLayerDrawLooper::LayerInfo info;
+ info.fFlagsMask = SkPaint::kAntiAlias_Flag;
+ info.fPaintBits = SkLayerDrawLooper::kStyle_Bit | SkLayerDrawLooper::kMaskFilter_Bit;
+ info.fColorMode = SkXfermode::kSrc_Mode;
+
for (int i = 0; i < SK_ARRAY_COUNT(gParams); i++) {
- SkPaint* paint = fLooper->addLayer(gParams[i].fOffset,
- gParams[i].fOffset);
+ info.fOffset.set(gParams[i].fOffset, gParams[i].fOffset);
+ SkPaint* paint = fLooper->addLayer(info);
paint->setAntiAlias(true);
paint->setColor(gParams[i].fColor);
paint->setStyle(gParams[i].fStyle);
paint->setStrokeWidth(gParams[i].fWidth);
- paint->setTextSize(SkIntToScalar(72));
if (gParams[i].fBlur > 0) {
SkMaskFilter* mf = SkBlurMaskFilter::Create(SkIntToScalar(gParams[i].fBlur),
SkBlurMaskFilter::kNormal_BlurStyle);
@@ -69,6 +73,7 @@
this->drawBG(canvas);
SkPaint paint;
+ paint.setTextSize(SkIntToScalar(72));
paint.setLooper(fLooper);
canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50),