1 /*
2  * Copyright 2015 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #include "gm/gm.h"
9 #include "include/core/SkBitmap.h"
10 #include "include/core/SkCanvas.h"
11 #include "include/core/SkMatrix.h"
12 #include "include/core/SkRect.h"
13 #include "tools/Resources.h"
14 
15 // https://bug.skia.org/4374
16 DEF_SIMPLE_GM(draw_bitmap_rect_skbug4734, canvas, 64, 64) {
17     SkBitmap source;
18     if (GetResourceAsBitmap("images/randPixels.png", &source)) {
19         SkRect rect = SkRect::Make(source.bounds());
20         rect.inset(0.5, 1.5);
21         SkRect dst;
22         SkMatrix::Scale(8, 8).mapRect(&dst, rect);
23         canvas->drawBitmapRect(source, rect, dst, nullptr);
24     }
25 }
26