blob: 03770d3ff537ca238ed243e96f6d62e278d24fab [file] [log] [blame]
halcanary5cd406f2015-09-23 12:46:24 -07001/*
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 */
Ben Wagner7fde8e12019-05-01 17:28:53 -04007
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "gm/gm.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -04009#include "include/core/SkBitmap.h"
10#include "include/core/SkCanvas.h"
11#include "include/core/SkMatrix.h"
12#include "include/core/SkRect.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050013#include "tools/Resources.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040014
halcanary6950de62015-11-07 05:29:00 -080015// https://bug.skia.org/4374
halcanary5cd406f2015-09-23 12:46:24 -070016DEF_SIMPLE_GM(draw_bitmap_rect_skbug4734, canvas, 64, 64) {
17 SkBitmap source;
Hal Canaryc465d132017-12-08 10:21:31 -050018 if (GetResourceAsBitmap("images/randPixels.png", &source)) {
halcanary5cd406f2015-09-23 12:46:24 -070019 SkRect rect = SkRect::Make(source.bounds());
20 rect.inset(0.5, 1.5);
21 SkRect dst;
Mike Reed1f607332020-05-21 12:11:27 -040022 SkMatrix::Scale(8, 8).mapRect(&dst, rect);
halcanary5cd406f2015-09-23 12:46:24 -070023 canvas->drawBitmapRect(source, rect, dst, nullptr);
24 }
25}