1 // Copyright 2019 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 #include "tools/fiddle/examples.h"
4 // HASH=185746dc0faa6f1df30c4afe098646ff
5 REG_FIDDLE(Canvas_drawImage, 256, 64, false, 4) {
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7    // sk_sp<SkImage> image;
8    SkImage* imagePtr = image.get();
9    canvas->drawImage(imagePtr, 0, 0);
10    SkPaint paint;
11    canvas->drawImage(imagePtr, 80, 0, SkSamplingOptions(), &paint);
12    paint.setAlpha(0x80);
13    canvas->drawImage(imagePtr, 160, 0, SkSamplingOptions(), &paint);
14 }
15 }  // END FIDDLE
16