halcanary | 5cd406f | 2015-09-23 12:46:24 -0700 | [diff] [blame] | 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 | #include "Resources.h" |
| 8 | #include "gm.h" |
halcanary | 6950de6 | 2015-11-07 05:29:00 -0800 | [diff] [blame] | 9 | // https://bug.skia.org/4374 |
halcanary | 5cd406f | 2015-09-23 12:46:24 -0700 | [diff] [blame] | 10 | DEF_SIMPLE_GM(draw_bitmap_rect_skbug4734, canvas, 64, 64) { |
| 11 | SkBitmap source; |
Hal Canary | c465d13 | 2017-12-08 10:21:31 -0500 | [diff] [blame] | 12 | if (GetResourceAsBitmap("images/randPixels.png", &source)) { |
halcanary | 5cd406f | 2015-09-23 12:46:24 -0700 | [diff] [blame] | 13 | SkRect rect = SkRect::Make(source.bounds()); |
| 14 | rect.inset(0.5, 1.5); |
| 15 | SkRect dst; |
| 16 | SkMatrix::MakeScale(8.0f).mapRect(&dst, rect); |
| 17 | canvas->drawBitmapRect(source, rect, dst, nullptr); |
| 18 | } |
| 19 | } |