1cb93a386Sopenharmony_ci#if 0  // Disabled until updated to use current API.
2cb93a386Sopenharmony_ci// Copyright 2019 Google LLC.
3cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h"
5cb93a386Sopenharmony_ci// HASH=c0216b3f7ebd80b9589ae5728f08fc80
6cb93a386Sopenharmony_ciREG_FIDDLE(Path_contains, 256, 256, false, 0) {
7cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) {
8cb93a386Sopenharmony_ci    SkPath path;
9cb93a386Sopenharmony_ci    SkPaint paint;
10cb93a386Sopenharmony_ci    paint.setTextSize(256);
11cb93a386Sopenharmony_ci    paint.getTextPath("&", 1, 30, 220, &path);
12cb93a386Sopenharmony_ci    for (int y = 2; y < 256; y += 9) {
13cb93a386Sopenharmony_ci       for (int x = 2; x < 256; x += 9) {
14cb93a386Sopenharmony_ci           int coverage = 0;
15cb93a386Sopenharmony_ci           for (int iy = -4; iy <= 4; iy += 2) {
16cb93a386Sopenharmony_ci               for (int ix = -4; ix <= 4; ix += 2) {
17cb93a386Sopenharmony_ci                   coverage += path.contains(x + ix, y + iy);
18cb93a386Sopenharmony_ci               }
19cb93a386Sopenharmony_ci           }
20cb93a386Sopenharmony_ci           paint.setColor(SkColorSetARGB(0x5f, 0xff * coverage / 25, 0, 0xff * (25 - coverage) / 25));
21cb93a386Sopenharmony_ci           canvas->drawCircle(x, y, 8, paint);
22cb93a386Sopenharmony_ci       }
23cb93a386Sopenharmony_ci    }
24cb93a386Sopenharmony_ci}
25cb93a386Sopenharmony_ci}  // END FIDDLE
26cb93a386Sopenharmony_ci#endif  // Disabled until updated to use current API.
27