OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // | 36 // |
37 static void test_bitmaprect(SkCanvas* canvas) { | 37 static void test_bitmaprect(SkCanvas* canvas) { |
38 SkBitmap bm; | 38 SkBitmap bm; |
39 make_bm(&bm); | 39 make_bm(&bm); |
40 | 40 |
41 canvas->drawBitmap(bm, 150, 45, NULL); | 41 canvas->drawBitmap(bm, 150, 45, NULL); |
42 | 42 |
43 SkScalar scale = 0.472560018f; | 43 SkScalar scale = 0.472560018f; |
44 canvas->save(); | 44 canvas->save(); |
45 canvas->scale(scale, scale); | 45 canvas->scale(scale, scale); |
46 canvas->drawBitmapRect(bm, SkRect::MakeXYWH(100, 100, 128, 128)); | 46 canvas->drawBitmapRect(bm, SkRect::MakeXYWH(100, 100, 128, 128), nullptr); |
47 canvas->restore(); | 47 canvas->restore(); |
48 | 48 |
49 canvas->scale(-1, 1); | 49 canvas->scale(-1, 1); |
50 canvas->drawBitmap(bm, -310, 45, NULL); | 50 canvas->drawBitmap(bm, -310, 45, NULL); |
51 } | 51 } |
52 | 52 |
53 class BitmapRectTestGM : public skiagm::GM { | 53 class BitmapRectTestGM : public skiagm::GM { |
54 public: | 54 public: |
55 BitmapRectTestGM() { | 55 BitmapRectTestGM() { |
56 | 56 |
(...skipping 12 matching lines...) Expand all Loading... |
69 test_bitmaprect(canvas); | 69 test_bitmaprect(canvas); |
70 } | 70 } |
71 | 71 |
72 private: | 72 private: |
73 typedef skiagm::GM INHERITED; | 73 typedef skiagm::GM INHERITED; |
74 }; | 74 }; |
75 | 75 |
76 ////////////////////////////////////////////////////////////////////////////// | 76 ////////////////////////////////////////////////////////////////////////////// |
77 | 77 |
78 DEF_GM( return new BitmapRectTestGM; ) | 78 DEF_GM( return new BitmapRectTestGM; ) |
OLD | NEW |