blob: de6845cdd3db236d1852e57198571c01f51b88ea [file] [log] [blame]
Hal Canary87515122019-03-15 14:22:51 -04001// 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.
Mike Kleinc0bd9f92019-04-23 12:05:21 -05003#include "tools/fiddle/examples.h"
Hal Canary87515122019-03-15 14:22:51 -04004// HASH=7f92cd5c9b9f4b1ac3cd933b08037bfe
Hal Canarya7181e7c2019-03-18 16:06:34 -04005REG_FIDDLE(Canvas_drawImageRect_2, 256, 256, false, 4) {
Hal Canary87515122019-03-15 14:22:51 -04006void draw(SkCanvas* canvas) {
7 // sk_sp<SkImage> image;
8 for (auto i : { 1, 2, 4, 8 } ) {
Mike Reedb339d052021-01-28 11:20:41 -05009 canvas->drawImageRect(image.get(), SkRect::MakeLTRB(0, 0, 100, 100),
10 SkRect::MakeXYWH(i * 20, i * 20, i * 20, i * 20), SkSamplingOptions(),
11 nullptr, SkCanvas::kStrict_SrcRectConstraint);
Hal Canary87515122019-03-15 14:22:51 -040012 }
13}
14} // END FIDDLE