diff options
author | halcanary <halcanary@google.com> | 2015-09-23 12:46:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-23 12:46:25 -0700 |
commit | 5cd406f0f6dfe74f052cf8f79bd200cffaed65b8 (patch) | |
tree | d954908a473944b458a6046f685b3a6a47ce20a6 /gm/draw_bitmap_rect_skbug4374.cpp | |
parent | f12a1673f024d30d30f06b9f88b5cc072b8a2d1e (diff) |
GM for http://skbug.com/4374
BUG=skia:4374
Review URL: https://codereview.chromium.org/1367623002
Diffstat (limited to 'gm/draw_bitmap_rect_skbug4374.cpp')
-rw-r--r-- | gm/draw_bitmap_rect_skbug4374.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gm/draw_bitmap_rect_skbug4374.cpp b/gm/draw_bitmap_rect_skbug4374.cpp new file mode 100644 index 0000000000..8ba600b6ac --- /dev/null +++ b/gm/draw_bitmap_rect_skbug4374.cpp @@ -0,0 +1,19 @@ +/* + * 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 "Resources.h" +#include "gm.h" +// http://skbug.com/4374 +DEF_SIMPLE_GM(draw_bitmap_rect_skbug4734, canvas, 64, 64) { + SkBitmap source; + if (GetResourceAsBitmap("randPixels.png", &source)) { + SkRect rect = SkRect::Make(source.bounds()); + rect.inset(0.5, 1.5); + SkRect dst; + SkMatrix::MakeScale(8.0f).mapRect(&dst, rect); + canvas->drawBitmapRect(source, rect, dst, nullptr); + } +} |