skia2/gm/draw_bitmap_rect_skbug4374.cpp
Mike Reed 046c2b7d90 move onto new factories for SkMatrix
Just rename, no functional changes expected.

Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-05-21 15:04:09 +00:00

26 lines
729 B
C++

/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkRect.h"
#include "tools/Resources.h"
// https://bug.skia.org/4374
DEF_SIMPLE_GM(draw_bitmap_rect_skbug4734, canvas, 64, 64) {
SkBitmap source;
if (GetResourceAsBitmap("images/randPixels.png", &source)) {
SkRect rect = SkRect::Make(source.bounds());
rect.inset(0.5, 1.5);
SkRect dst;
SkMatrix::Scale(8, 8).mapRect(&dst, rect);
canvas->drawBitmapRect(source, rect, dst, nullptr);
}
}