1cb93a386Sopenharmony_ci// Copyright 2019 Google LLC. 2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h" 4cb93a386Sopenharmony_ci// HASH=3412c2a16cb529af0e04878d264451f2 5cb93a386Sopenharmony_ciREG_FIDDLE(Canvas_drawPatch_2_b, 256, 256, false, 6) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci // SkBitmap source = checkerboard; 8cb93a386Sopenharmony_ci SkPaint paint; 9cb93a386Sopenharmony_ci paint.setAntiAlias(true); 10cb93a386Sopenharmony_ci SkPoint cubics[] = { { 3, 1 }, { 4, 2 }, { 5, 1 }, { 7, 3 }, 11cb93a386Sopenharmony_ci /* { 7, 3 }, */ { 6, 4 }, { 7, 5 }, { 5, 7 }, 12cb93a386Sopenharmony_ci /* { 5, 7 }, */ { 4, 6 }, { 3, 7 }, { 1, 5 }, 13cb93a386Sopenharmony_ci /* { 1, 5 }, */ { 2, 4 }, { 1, 3 }, /* { 3, 1 } */ }; 14cb93a386Sopenharmony_ci SkPoint texCoords[] = { { 0, 0 }, { 0, 62}, { 62, 62}, { 62, 0 } }; 15cb93a386Sopenharmony_ci paint.setShader(source.makeShader(SkSamplingOptions(SkFilterMode::kLinear))); 16cb93a386Sopenharmony_ci canvas->scale(30, 30); 17cb93a386Sopenharmony_ci canvas->drawPatch(cubics, nullptr, texCoords, paint); 18cb93a386Sopenharmony_ci} 19cb93a386Sopenharmony_ci} // END FIDDLE 20