From 9e65f9399ea9d50dca723ca23c10ec4145b54abe Mon Sep 17 00:00:00 2001 From: mtklein Date: Wed, 6 Apr 2016 13:57:38 -0700 Subject: [PATCH] alternate textblobgeometrychange fix... just make our own surface if needed This should decopple fixing the replay modes from revising the API. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1868553005 Review URL: https://codereview.chromium.org/1868553005 --- gm/textblobgeometrychange.cpp | 38 +++--- tools/dm_flags.json | 240 ---------------------------------- tools/dm_flags.py | 4 +- 3 files changed, 18 insertions(+), 264 deletions(-) diff --git a/gm/textblobgeometrychange.cpp b/gm/textblobgeometrychange.cpp index b1c5b17988..b02bc07bf0 100644 --- a/gm/textblobgeometrychange.cpp +++ b/gm/textblobgeometrychange.cpp @@ -47,28 +47,24 @@ protected: uint32_t allowSRGBInputs = canvas->getProps(&canvasProps) ? canvasProps.flags() & SkSurfaceProps::kAllowSRGBInputs_Flag : 0; SkSurfaceProps props(allowSRGBInputs, kUnknown_SkPixelGeometry); - auto surface(canvas->makeSurface(info, &props)); - if (surface) { - SkCanvas* c = surface->getCanvas(); - - // LCD text on white background - SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight / 2.f); - SkPaint rectPaint; - rectPaint.setColor(0xffffffff); - canvas->drawRect(rect, rectPaint); - canvas->drawTextBlob(blob.get(), 10, 50, paint); - - // This should not look garbled since we should disable LCD text in this case - // (i.e., unknown pixel geometry) - c->clear(0x00ffffff); - c->drawTextBlob(blob.get(), 10, 150, paint); - surface->draw(canvas, 0, 0, nullptr); - } else { - const char* text = "This test requires a surface"; - size_t len = strlen(text); - SkPaint paint; - canvas->drawText(text, len, 10, 100, paint); + auto surface = canvas->makeSurface(info, &props); + if (!surface) { + surface = SkSurface::MakeRaster(info, &props); } + SkCanvas* c = surface->getCanvas(); + + // LCD text on white background + SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight / 2.f); + SkPaint rectPaint; + rectPaint.setColor(0xffffffff); + canvas->drawRect(rect, rectPaint); + canvas->drawTextBlob(blob.get(), 10, 50, paint); + + // This should not look garbled since we should disable LCD text in this case + // (i.e., unknown pixel geometry) + c->clear(0x00ffffff); + c->drawTextBlob(blob.get(), 10, 150, paint); + surface->draw(canvas, 0, 0, nullptr); } private: diff --git a/tools/dm_flags.json b/tools/dm_flags.json index a33c3fab09..710050e289 100644 --- a/tools/dm_flags.json +++ b/tools/dm_flags.json @@ -141,10 +141,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -177,18 +173,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -337,10 +321,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -373,18 +353,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -630,10 +598,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -666,18 +630,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -921,10 +873,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -957,18 +905,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -1215,10 +1151,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -1251,18 +1183,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -1502,10 +1422,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -1538,18 +1454,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -1791,10 +1695,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -1827,18 +1727,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -2076,10 +1964,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -2112,18 +1996,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -2308,10 +2180,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -2344,18 +2212,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -2633,10 +2489,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -2669,18 +2521,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -2834,10 +2674,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -2870,18 +2706,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -3038,10 +2862,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -3074,18 +2894,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -3259,10 +3067,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -3295,18 +3099,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -3479,10 +3271,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -3515,18 +3303,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", @@ -3825,10 +3601,6 @@ "serialize-8888", "gm", "_", - "textblobgeometrychange", - "serialize-8888", - "gm", - "_", "verylargebitmap", "serialize-8888", "gm", @@ -3861,18 +3633,6 @@ "sp-8888", "gm", "_", - "textblobgeometrychange", - "pic-8888", - "gm", - "_", - "textblobgeometrychange", - "2ndpic-8888", - "gm", - "_", - "textblobgeometrychange", - "sp-8888", - "gm", - "_", "patch_primitive", "sp-8888", "gm", diff --git a/tools/dm_flags.py b/tools/dm_flags.py index 95ddb2c00e..5704deceaf 100755 --- a/tools/dm_flags.py +++ b/tools/dm_flags.py @@ -169,14 +169,12 @@ def get_args(bot): 'fontmgr_iter', 'lightingshader', 'path_stroke_with_zero_length', - 'textblobgeometrychange', 'verylargebitmap', # Windows only. 'verylarge_picture_image']: # Windows only. blacklist.extend(['serialize-8888', 'gm', '_', test]) # skia:4769 for test in ['drawfilter', - 'path_stroke_with_zero_length', - 'textblobgeometrychange']: + 'path_stroke_with_zero_length']: blacklist.extend([ 'sp-8888', 'gm', '_', test]) blacklist.extend([ 'pic-8888', 'gm', '_', test]) blacklist.extend(['2ndpic-8888', 'gm', '_', test])