aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--expectations/gm/ignored-tests.txt4
-rw-r--r--gm/imagemagnifier.cpp11
2 files changed, 10 insertions, 5 deletions
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index ad1f7a3bea..51c628bd41 100644
--- a/expectations/gm/ignored-tests.txt
+++ b/expectations/gm/ignored-tests.txt
@@ -53,6 +53,10 @@ drawbitmapmatrix
# New shadow only option in SkDropShadowImageFilter
dropshadowimagefilter
+# senorblanco https://codereview.chromium.org/637283009/
+# quality improvements to imagemagnifier GM
+imagemagnifier
+
#bsalomon slight(?) changes after reseting GrContext between GMs
dftext
megalooper_0x0
diff --git a/gm/imagemagnifier.cpp b/gm/imagemagnifier.cpp
index e2847b4c67..371b3088f9 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);
}