/* * Copyright 2021 Google LLC * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "gm/gm.h" #include "include/core/SkCanvas.h" #include "include/core/SkPathBuilder.h" DEF_SIMPLE_GM(crbug_1257515, canvas, 1139, 400) { // // // // // // SkPathBuilder b; b.moveTo(45.125f, 102.53701800000002f) .lineTo(135.375f, 162.666156f) .lineTo(225.625f, 116.622276f) .lineTo(315.875f, 121.52087700000001f) .lineTo(406.125f, 134.632899f) .lineTo(496.375f, 192.317736f) .lineTo(586.625f, 138.82944899999998f) .lineTo(676.875f, 234.212031f) .lineTo(767.125f, 207.082926f) .lineTo(857.375f, 128.083857f) .lineTo(947.625f, 127.95689999999999f) .lineTo(1037.875f, 113.956785f); SkPaint p; p.setColor(SK_ColorRED); p.setStrokeWidth(2.f); p.setStyle(SkPaint::kStroke_Style); p.setStrokeCap(SkPaint::kRound_Cap); p.setStrokeJoin(SkPaint::kRound_Join); p.setAntiAlias(true); canvas->save(); canvas->translate(-50.f, -200.f); canvas->scale(2.f, 2.f); canvas->drawPath(b.detach(), p); canvas->restore(); // // // // b.moveTo(128.5307f, 587.5728f) .lineTo(232.4748f, 617.037f) .lineTo(335.4189f, 624.8472f) .lineTo(438.3631f, 630.5933f) .lineTo(541.3073f, 625.1138f) .lineTo(644.2513f, 626.8717f) .lineTo(747.1955f, 629.9542f) .lineTo(850.1396f, 629.6956f) .lineTo(953.0838f, 616.4909f) .lineTo(1056.028f, 613.8181f); p.setColor(SkColorSetARGB(255, 47, 136, 255)); p.setStrokeWidth(3.f); p.setStrokeCap(SkPaint::kButt_Cap); p.setStrokeJoin(SkPaint::kBevel_Join); p.setStrokeMiter(10.f); canvas->save(); canvas->translate(-300.f, -900.f); canvas->scale(2.f, 2.f); canvas->drawPath(b.detach(), p); canvas->restore(); }