Debian Codegraph @

docs/examples/Bitmap_getBounds.cpp

raw
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_getBounds, 256, 160, false, 3) {
5 void draw(SkCanvas* canvas) {
6 SkRect bounds;
7 source.getBounds(&bounds);
8 bounds.offset(100, 100);
9 SkPaint paint;
10 paint.setColor(SK_ColorGRAY);
11 canvas->scale(.25f, .25f);
12 canvas->drawRect(bounds, paint);
13 canvas->drawImage(source.asImage(), 40, 40);
14 }
15 } // END FIDDLE