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=1df575f9b8132306ce0552a2554ed132
5cb93a386Sopenharmony_ciREG_FIDDLE(Canvas_drawAtlas, 256, 256, false, 3) {
6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) {
7cb93a386Sopenharmony_ci  // SkBitmap source = mandrill;
8cb93a386Sopenharmony_ci  SkRSXform xforms[] = { { .5f, 0, 0, 0 }, {0, .5f, 200, 100 } };
9cb93a386Sopenharmony_ci  SkRect tex[] = { { 0, 0, 250, 250 }, { 0, 0, 250, 250 } };
10cb93a386Sopenharmony_ci  SkColor colors[] = { 0x7f55aa00, 0x7f3333bf };
11cb93a386Sopenharmony_ci  const SkImage* imagePtr = image.get();
12cb93a386Sopenharmony_ci  SkSamplingOptions sampling;
13cb93a386Sopenharmony_ci  canvas->drawAtlas(imagePtr, xforms, tex, colors, 2, SkBlendMode::kSrcOver,
14cb93a386Sopenharmony_ci                    sampling, nullptr, nullptr);
15cb93a386Sopenharmony_ci}
16cb93a386Sopenharmony_ci}  // END FIDDLE
17