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=4bbae00b40ed2cfcd0007921ad693a7b 6cb93a386Sopenharmony_ciREG_FIDDLE(Path_Direction, 256, 100, false, 0) { 7cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 8cb93a386Sopenharmony_ci const SkPoint arrow[] = { {40, -5}, {45, 0}, {40, 5} }; 9cb93a386Sopenharmony_ci const SkRect rect = {10, 10, 90, 90}; 10cb93a386Sopenharmony_ci SkPaint rectPaint; 11cb93a386Sopenharmony_ci rectPaint.setAntiAlias(true); 12cb93a386Sopenharmony_ci SkPaint textPaint(rectPaint); 13cb93a386Sopenharmony_ci rectPaint.setStyle(SkPaint::kStroke_Style); 14cb93a386Sopenharmony_ci SkPaint arrowPaint(rectPaint); 15cb93a386Sopenharmony_ci SkPath arrowPath; 16cb93a386Sopenharmony_ci arrowPath.addPoly(arrow, SK_ARRAY_COUNT(arrow), true); 17cb93a386Sopenharmony_ci arrowPaint.setPathEffect(SkPath1DPathEffect::Make(arrowPath, 320, 0, 18cb93a386Sopenharmony_ci SkPath1DPathEffect::kRotate_Style)); 19cb93a386Sopenharmony_ci for (auto direction : { SkPathDirection::kCW, SkPathDirection::kCCW } ) { 20cb93a386Sopenharmony_ci canvas->drawRect(rect, rectPaint); 21cb93a386Sopenharmony_ci for (unsigned start : { 0, 1, 2, 3 } ) { 22cb93a386Sopenharmony_ci SkPath path; 23cb93a386Sopenharmony_ci path.addRect(rect, direction, start); 24cb93a386Sopenharmony_ci canvas->drawPath(path, arrowPaint); 25cb93a386Sopenharmony_ci } 26cb93a386Sopenharmony_ci canvas->drawString(SkPathDirection::kCW == direction ? "CW" : "CCW", rect.centerX(), 27cb93a386Sopenharmony_ci rect.centerY(), textPaint); 28cb93a386Sopenharmony_ci canvas->translate(120, 0); 29cb93a386Sopenharmony_ci } 30cb93a386Sopenharmony_ci} 31cb93a386Sopenharmony_ci} // END FIDDLE 32cb93a386Sopenharmony_ci#endif // Disabled until updated to use current API. 33