diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-18 15:37:14 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-18 15:37:14 +0000 |
commit | f707adc4f8b22fd1a59a900b64333480de653c5b (patch) | |
tree | bc8fc2327ca835edb486b21bf54b6f8c8c9bacff /gm/bitmaprecttest.cpp | |
parent | ee056a82ae59373cae01ebbb4edcd3297d7c92ce (diff) |
augmenting fix in 8700 and 8701, be careful NOT to "sort" the result of mapRect
when we only want to proceed if the matrix is nearly identity. Hence we manually
apply the matrix to the two "points" of the rect.
git-svn-id: http://skia.googlecode.com/svn/trunk@8743 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/bitmaprecttest.cpp')
-rw-r--r-- | gm/bitmaprecttest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gm/bitmaprecttest.cpp b/gm/bitmaprecttest.cpp index 54e0a28267..cade0a7193 100644 --- a/gm/bitmaprecttest.cpp +++ b/gm/bitmaprecttest.cpp @@ -15,6 +15,13 @@ static void make_bm(SkBitmap* bm) { SkCanvas canvas(*bm); SkPaint paint; + + SkPath path; + path.moveTo(6, 6); + path.lineTo(6, 54); + path.lineTo(30, 54); + canvas.drawPath(path, paint); + paint.setStyle(SkPaint::kStroke_Style); canvas.drawRect(SkRect::MakeLTRB(0.5f, 0.5f, 59.5f, 59.5f), paint); } @@ -34,8 +41,13 @@ static void test_bitmaprect(SkCanvas* canvas) { canvas->drawBitmap(bm, 150, 45, NULL); SkScalar scale = 0.472560018f; + canvas->save(); canvas->scale(scale, scale); canvas->drawBitmapRectToRect(bm, NULL, SkRect::MakeXYWH(100, 100, 128, 128), NULL); + canvas->restore(); + + canvas->scale(-1, 1); + canvas->drawBitmap(bm, -310, 45, NULL); } class BitmapRectTestGM : public skiagm::GM { |