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

Unified Diff: gm/stroketext.cpp

Issue 1333553002: GM: replace boilerplate with macros (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-09 (Wednesday) 11:01:10 EDT Created 5 years, 3 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 | « gm/strokefill.cpp ('k') | gm/texdata.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/stroketext.cpp
diff --git a/gm/stroketext.cpp b/gm/stroketext.cpp
index 75ce164bcf733fed37cf96d6896a96dd5df18986..d0a9882256ba5a12fb0cb0badd3bd91a63a57eb7 100644
--- a/gm/stroketext.cpp
+++ b/gm/stroketext.cpp
@@ -59,28 +59,14 @@ static void draw_text_set(SkCanvas* canvas, const SkPaint& paint) {
draw_text_stroked(canvas, p, 10);
}
-class StrokeTextGM : public skiagm::GM {
- // Skia has a threshold above which it draws text via paths instead of using scalercontext
- // and caching the glyph. This GM wants to ensure that we draw stroking correctly on both
- // sides of this threshold.
+namespace {
enum {
kBelowThreshold_TextSize = 255,
kAboveThreshold_TextSize = 257
};
-public:
- StrokeTextGM() {}
-
-protected:
-
- SkString onShortName() override {
- return SkString("stroketext");
- }
-
- SkISize onISize() override {
- return SkISize::Make(1200, 480);
- }
+}
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM(stroketext, canvas, 1200, 480) {
if (true) { test_nulldev(canvas); }
SkPaint paint;
paint.setAntiAlias(true);
@@ -92,10 +78,4 @@ protected:
canvas->translate(600, 0);
paint.setTextSize(kAboveThreshold_TextSize);
draw_text_set(canvas, paint);
- }
-
-private:
- typedef skiagm::GM INHERITED;
-};
-
-DEF_GM(return new StrokeTextGM;)
+}
« no previous file with comments | « gm/strokefill.cpp ('k') | gm/texdata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698