Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: gm/imagemagnifier.cpp

Issue 637283009: Fix imagemagnifier GM quality and speed. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add code review link Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698