Index: gm/imagemagnifier.cpp |
diff --git a/gm/imagemagnifier.cpp b/gm/imagemagnifier.cpp |
index e2847b4c67312707b5aa1110a3b87986702a877a..371b3088f9e57c378e811183cd0745c5910c88b2 100644 |
--- a/gm/imagemagnifier.cpp |
+++ b/gm/imagemagnifier.cpp |
@@ -35,23 +35,24 @@ protected: |
} |
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
- SkPaint paint; |
- paint.setImageFilter( |
+ SkPaint filterPaint; |
+ filterPaint.setImageFilter( |
SkMagnifierImageFilter::Create( |
SkRect::MakeXYWH(SkIntToScalar(100), SkIntToScalar(100), |
SkIntToScalar(WIDTH / 2), |
SkIntToScalar(HEIGHT / 2)), |
100))->unref(); |
- canvas->saveLayer(NULL, &paint); |
- paint.setAntiAlias(true); |
- sk_tool_utils::set_portable_typeface(&paint); |
+ canvas->saveLayer(NULL, &filterPaint); |
const char* str = "The quick brown fox jumped over the lazy dog."; |
SkRandom rand; |
for (int i = 0; i < 25; ++i) { |
int x = rand.nextULessThan(WIDTH); |
int y = rand.nextULessThan(HEIGHT); |
+ SkPaint paint; |
+ sk_tool_utils::set_portable_typeface(&paint); |
paint.setColor(rand.nextBits(24) | 0xFF000000); |
paint.setTextSize(rand.nextRangeScalar(0, 300)); |
+ paint.setAntiAlias(true); |
canvas->drawText(str, strlen(str), SkIntToScalar(x), |
SkIntToScalar(y), paint); |
} |