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 REG_FIDDLE(Bitmap_getSubset, 256, 256, true, 3) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6 SkIRect bounds;
7 source.getBounds(&bounds);
8 bounds.inset(100, 100);
9 SkBitmap subset;
10 source.extractSubset(&subset, bounds);
11 SkIRect r = source.getSubset();
12 SkDebugf("source: %d, %d, %d, %d\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
13 r = subset.getSubset();
14 SkDebugf("subset: %d, %d, %d, %d\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
15 }
16 } // END FIDDLE
17